diff options
author | Pascal Viandier <midi-pascal@videotron.ca> | 2015-10-01 19:38:38 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-10-01 19:38:38 +0200 |
commit | 1e0e72fceb542e4eb984b50f747c38314f055b8f (patch) | |
tree | 40d35ec3682c465348f8d8d73509aeda4729a8bb /src/main.cpp | |
parent | c9e33e7d3fcd5b21a00e13dcbb5742a6c8da6106 (diff) | |
download | kooldock-1e0e72fceb542e4eb984b50f747c38314f055b8f.tar.gz kooldock-1e0e72fceb542e4eb984b50f747c38314f055b8f.zip |
Fix remaining issues and build warnings
Cleanup code
Signed-off-by: Pascal Viandier <midi-pascal@videotron.ca>
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/src/main.cpp b/src/main.cpp index a63a1a0..a5788fb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,12 +7,10 @@ ***************************************************************************/ /*************************************************************************** - * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * - * * ***************************************************************************/ #include <tdecmdlineargs.h> @@ -34,13 +32,14 @@ TQString argv0; #ifndef _ENABLE_DEBUG extern "C" { - static void crashHandler(int /*signal*/) - { - char cmd[1024]; - fprintf(stderr, "kooldock: crashHandler called\n"); - snprintf(cmd, 1023, "%s &", argv0.ascii()); - system(cmd); // try to restart according to argv[0] - } + static void crashHandler(int /*signal*/) + { + char cmd[1024]; + fprintf(stderr, "kooldock: crashHandler called\n"); + snprintf(cmd, 1023, "%s &", argv0.ascii()); + int status = system(cmd); // try to restart according to argv[0] + status++; + } } #endif @@ -57,11 +56,11 @@ static TDECmdLineOptions options[] = int main(int argc, char *argv[]) { - argv0=TQString("%1").arg(argv[0]); + argv0 = TQString("%1").arg(argv[0]); - TDEAboutData aboutData( "kooldock", I18N_NOOP("KoolDock"), - KOOLDOCK_VERSION, description, TDEAboutData::License_GPL, - "(c) 2003, 2006 - KoolDock team", 0, "http://ktown.kde.cl/kooldock", "kooldock-devel@lists.kde.cl"); + TDEAboutData aboutData("kooldock", I18N_NOOP("KoolDock"), + KOOLDOCK_VERSION, description, TDEAboutData::License_GPL, + "(c) 2003, 2006 - KoolDock team", 0, "http://ktown.kde.cl/kooldock", "kooldock-devel@lists.kde.cl"); aboutData.addAuthor("Matias Fernandez",0, "radix@kde.cl"); aboutData.addAuthor("Francisco Guidi",0, "francisco@guidi.com", "http://francisco.guidi.com"); aboutData.addAuthor("Blase Stanek", 0, "bisiek@op.pl"); @@ -77,17 +76,16 @@ int main(int argc, char *argv[]) #ifndef _ENABLE_DEBUG KUniqueApplication::addCmdLineOptions(); #endif - if (TQString("%1").arg(argv[1])=="-kill" || TQString("%1").arg(argv[1])=="-k") - { - system("killall kooldock"); + if ((TQString("%1").arg(argv[1]) == "-kill") || (TQString("%1").arg(argv[1]) == "-k")) { + int status = system("killall kooldock"); + status++; exit(0); } #ifndef _ENABLE_DEBUG - if (!KUniqueApplication::start()) - { - fprintf(stderr, "Kooldock is already running!\n"); - exit(0); + if (!KUniqueApplication::start()) { + fprintf(stderr, "Kooldock is already running!\n"); + exit(0); } #endif @@ -97,14 +95,13 @@ int main(int argc, char *argv[]) #ifdef _ENABLE_DEBUG TDEApplication a; #endif - KoolDock *kooldock = new KoolDock(); + KoolDock* kooldock = new KoolDock(); a.setMainWidget(kooldock); #ifndef _ENABLE_DEBUG - if(TDECrash::crashHandler()!=0) - { - kdDebug(0) << "Installing crash handler" << endl; - TDECrash::setEmergencySaveFunction(crashHandler); // Try to restart on crash + if (TDECrash::crashHandler() !=0 ) { + kdDebug(0) << "Installing crash handler" << endl; + TDECrash::setEmergencySaveFunction(crashHandler); // Try to restart on crash } #endif |