[X2Go-Commits] x2godesktopsharing.git - build-main (branch) updated: 3.0.1.2-18-g91df9e9
X2Go dev team
git-admin at x2go.org
Sat Jun 8 01:13:23 CEST 2013
The branch, build-main has been updated
via 91df9e9278ea7dcb4bc17d1f8a934af0dfdd909d (commit)
from 3c4601b7ec0af5717bdd9e6983e451efd1c4b67f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
main.cpp | 9 ++++++++-
sharetray.cpp | 24 ++++++++++++++++++++++++
sharetray.h | 4 ++++
3 files changed, 36 insertions(+), 1 deletion(-)
The diff of changes is:
diff --git a/main.cpp b/main.cpp
index fa54d3d..b435d48 100644
--- a/main.cpp
+++ b/main.cpp
@@ -83,7 +83,7 @@ void client ( const QStringList & cmd )
static int setup_unix_signal_handlers()
{
- struct sigaction keybint, term;
+ struct sigaction keybint, term, abort;
keybint.sa_handler = ShareTray::keybintSignalHandler;
sigemptyset(&keybint.sa_mask);
@@ -100,6 +100,13 @@ static int setup_unix_signal_handlers()
if (sigaction(SIGTERM, &term, 0) > 0)
return 2;
+ abort.sa_handler = ShareTray::abortSignalHandler;
+ sigemptyset(&abort.sa_mask);
+ abort.sa_flags |= SA_RESTART;
+
+ if (sigaction(SIGABRT, &abort, 0) > 0)
+ return 3;
+
return 0;
}
diff --git a/sharetray.cpp b/sharetray.cpp
index 9e81db8..7c00b1e 100644
--- a/sharetray.cpp
+++ b/sharetray.cpp
@@ -40,6 +40,7 @@
//needed to not get an undefined reference to static members
int ShareTray::sigkeybintFd[2];
int ShareTray::sigtermFd[2];
+int ShareTray::sigabortFd[2];
ShareTray::ShareTray()
: QMainWindow()
@@ -177,10 +178,15 @@ ShareTray::ShareTray()
if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermFd))
qFatal("Couldn't create TERM socketpair");
+ if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigabortFd))
+ qFatal("Couldn't create ABRT socketpair");
+
snKeybInt = new QSocketNotifier(sigkeybintFd[1], QSocketNotifier::Read, this);
connect(snKeybInt, SIGNAL(activated(int)), this, SLOT(handleSigKeybInt()));
snTerm = new QSocketNotifier(sigtermFd[1], QSocketNotifier::Read, this);
connect(snTerm, SIGNAL(activated(int)), this, SLOT(handleSigTerm()));
+ snAbort = new QSocketNotifier(sigabortFd[1], QSocketNotifier::Read, this);
+ connect(snAbort, SIGNAL(activated(int)), this, SLOT(handleSigAbort()));
QTimer *timer = new QTimer ( this );
connect ( timer, SIGNAL ( timeout() ), this, SLOT ( slotTimer() ) );
@@ -226,6 +232,18 @@ void ShareTray::handleSigTerm()
snTerm->setEnabled(true);
}
+void ShareTray::handleSigAbort()
+{
+ snAbort->setEnabled(false);
+ char tmp;
+ ::read(sigabortFd[1], &tmp, sizeof(tmp));
+
+ // do Qt stuff here
+ slotMenuClose();
+
+ snAbort->setEnabled(true);
+}
+
void ShareTray::keybintSignalHandler(int)
{
char a = 1;
@@ -238,6 +256,12 @@ void ShareTray::termSignalHandler(int)
::write(sigtermFd[0], &a, sizeof(a));
}
+void ShareTray::abortSignalHandler(int)
+{
+ char a = 1;
+ ::write(sigabortFd[0], &a, sizeof(a));
+}
+
void ShareTray::slotStopSharing()
{
if ( serverSocket )
diff --git a/sharetray.h b/sharetray.h
index 4119244..c7fe8eb 100644
--- a/sharetray.h
+++ b/sharetray.h
@@ -36,6 +36,7 @@ public:
// Unix signal handlers.
static void keybintSignalHandler(int unused);
static void termSignalHandler(int unused);
+ static void abortSignalHandler(int unused);
// desktop sharing socket
QString getSocketAnswer(QString message);
void closeSocket(SimpleLocalSocket* sock);
@@ -65,6 +66,7 @@ public slots:
// Qt signal handlers.
void handleSigKeybInt();
void handleSigTerm();
+ void handleSigAbort();
private slots:
void slotStopSharing();
void slotStartSharing();
@@ -91,8 +93,10 @@ private:
// unix file sockets for signal handler communication (unix <-> Qt)
static int sigkeybintFd[2];
static int sigtermFd[2];
+ static int sigabortFd[2];
QSocketNotifier *snKeybInt;
QSocketNotifier *snTerm;
+ QSocketNotifier *snAbort;
};
#endif
hooks/post-receive
--
x2godesktopsharing.git (Desktop Sharing for X2Go)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2godesktopsharing.git" (Desktop Sharing for X2Go).
More information about the x2go-commits
mailing list