add more spacing
[personal-kdebase.git] / runtime / knotify / main.cpp
blob7c842666ae28dc59f1890d7c6a92b45ad6dcffd0
1 /*
2 Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include <kuniqueapplication.h>
23 #include <kaboutdata.h>
24 #include <kcmdlineargs.h>
25 #include <kdebug.h>
26 #include <kglobal.h>
27 #include <klocale.h>
28 #include <kmessage.h>
29 #include <kpassivepopupmessagehandler.h>
30 #include <kdefakes.h>
32 #include "knotify.h"
35 int main(int argc, char **argv)
37 KAboutData aboutdata("knotify", "knotify4", ki18n("KNotify"),
38 "4.0", ki18n("KDE Notification Daemon"),
39 KAboutData::License_GPL, ki18n("(C) 1997-2008, KDE Developers"));
40 aboutdata.addAuthor(ki18n("Olivier Goffart"),ki18n("Current Maintainer"),"ogoffart@kde.org");
41 aboutdata.addAuthor(ki18n("Carsten Pfeiffer"),ki18n("Previous Maintainer"),"pfeiffer@kde.org");
42 aboutdata.addAuthor(ki18n("Christian Esken"),KLocalizedString(),"esken@kde.org");
43 aboutdata.addAuthor(ki18n("Stefan Westerfeld"),ki18n("Sound support"),"stefan@space.twc.de");
44 aboutdata.addAuthor(ki18n("Charles Samuels"),ki18n("Previous Maintainer"),"charles@kde.org");
45 aboutdata.addAuthor(ki18n("Allan Sandfeld Jensen"),ki18n("Porting to KDE 4"),"kde@carewolf.com");
47 KCmdLineArgs::init( argc, argv, &aboutdata );
48 KUniqueApplication::addCmdLineOptions();
50 // initialize application
51 if ( !KUniqueApplication::start() ) {
52 kDebug() << "Running knotify found";
53 return 0;
56 // do not connect to ksmserver at all, knotify is launched on demand and doesn't need
57 // to know about logout, and moreover it may be ksmserver who tries to launch knotify,
58 // in which case there is a deadlock with ksmserver waiting for knotify to finish
59 // startup and knotify waiting to register with ksmserver
60 unsetenv( "SESSION_MANAGER" );
61 KUniqueApplication app;
64 * the default KMessageBoxMessageHandler will do messagesbox that notify
65 * so we have a deadlock if one debug message is shown as messagebox.
66 * that's why we're forced to change the default handler
68 KMessage::setMessageHandler( new KPassivePopupMessageHandler(0) );
70 // start notify service
71 KNotify notify;
73 return app.exec();