From 84a5735e6138038d39bb2cab37fd5266d3af4f43 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Tue, 14 Jun 2016 16:00:40 +0200 Subject: [PATCH] Removing code that I just couldn't understand (so I assume it does nothing) --- daemon/kdeconnectd.cpp | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index 180cc5366..e973115c4 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -39,46 +38,6 @@ #include "kdeconnecttelepathyprotocolfactory.h" #endif - -#ifndef Q_OS_WIN -#include -#endif - -static int sigtermfd[2]; -const static char deadbeef = 1; - - -// TODO: Implement for Windows. -#ifndef Q_OS_WIN -struct sigaction action; -#endif - -void sighandler(int signum) -{ - if( signum == SIGTERM || signum == SIGINT) - { - ssize_t unused = ::write(sigtermfd[0], &deadbeef, sizeof(deadbeef)); - Q_UNUSED(unused); - } -} - -void initializeTermHandlers(QCoreApplication* app, Daemon* daemon) -{ -// TODO: Implement for Windows. -#ifndef Q_OS_WIN - ::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermfd); - QSocketNotifier* snTerm = new QSocketNotifier(sigtermfd[1], QSocketNotifier::Read, app); - QObject::connect(snTerm, SIGNAL(activated(int)), daemon, SLOT(deleteLater())); - - action.sa_handler = sighandler; - sigemptyset(&action.sa_mask); - action.sa_flags = 0; - - sigaction(SIGTERM, &action, nullptr); - sigaction(SIGINT, &action, nullptr); -#endif -} - class DesktopDaemon : public Daemon { Q_OBJECT @@ -131,7 +90,6 @@ int main(int argc, char* argv[]) Daemon* daemon = new DesktopDaemon; QObject::connect(daemon, SIGNAL(destroyed(QObject*)), &app, SLOT(quit())); - initializeTermHandlers(&app, daemon); #ifdef HAVE_TELEPATHY //keep a reference to the KTP CM so that we can register on DBus