summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-03-26 15:10:12 +0900
committerMichele Calgaro <[email protected]>2020-03-26 15:10:12 +0900
commit88fbf7e81a6ab317262bd97875a0296f59287586 (patch)
tree0effe4e64f5cdf3c0aa42e8ca8096cca8b6ddc89 /src/main.cpp
parent5c2a45303ead893a78c69ddbef21d5acedf654ff (diff)
downloadtdedocker-88fbf7e81a6ab317262bd97875a0296f59287586.tar.gz
tdedocker-88fbf7e81a6ab317262bd97875a0296f59287586.zip
1) Additional work on tq app -> tde app translation.
2) Make sure to exit app after restore if no app window can be grabbed 3) Save state only for known applications (app with empty name will not be saved and restored) Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp20
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();
}