diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp index b61d52e..dc9bf5e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,13 +40,13 @@ static void sighandler(int sig) { if (sig == SIGUSR1) { - DUMP_TRACE((TQDir::homeDirPath() + "/tdedocker.trace").ascii()); + DUMP_TRACE((TQDir::homeDirPath() + "/tdedocker.trace").local8Bit()); return; } tqDebug("%s", i18n("Caught signal %1. Cleaning up.").arg(sig).local8Bit().data()); - ((TDEDocker *)tqApp)->trayLabelMgr()->undockAll(); - ::exit(0); + ((TDEDocker*)TDEApplication::kApplication())->trayLabelMgr()->undockAll(); + TDEApplication::kApplication()->quit(); } static const TDECmdLineOptions options[] = @@ -69,12 +69,6 @@ static const TDECmdLineOptions options[] = //extern "C" int KDE_EXPORT kdemain(int argc, char* argv[]) int main(int argc, char *argv[]) { - // setup signal handlers that undock and quit - signal(SIGHUP, sighandler); - signal(SIGTERM, sighandler); - signal(SIGINT, sighandler); - signal(SIGUSR1, sighandler); - TDEAboutData about("tdedocker", I18N_NOOP("tdedocker"), "1.3", I18N_NOOP("Docks any application into the system tray\nNOTE: Use -d for all startup scripts."), TDEAboutData::License_GPL); about.addAuthor("John Schember", I18N_NOOP("Original KDocker maintainer"), "[email protected]"); @@ -84,8 +78,14 @@ int main(int argc, char *argv[]) TDECmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::addCmdLineOptions(options); - TDEDocker::addCmdLineOptions(); + TDEDocker::addCmdLineOptions(); TDEDocker app; + // setup signal handlers that undock and quit (must be done after the TDEApplication constructor has run) + signal(SIGHUP, sighandler); + signal(SIGTERM, sighandler); + signal(SIGINT, sighandler); + signal(SIGUSR1, sighandler); + return app.exec(); } |