• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KNotify

main.cpp

Go to the documentation of this file.
00001 /*
00002    Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
00003 
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2, or (at your option)
00008    any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018 
00019  */
00020 
00021 
00022 #include <kuniqueapplication.h>
00023 #include <kaboutdata.h>
00024 #include <kcmdlineargs.h>
00025 #include <kdebug.h>
00026 #include <kglobal.h>
00027 #include <klocale.h>
00028 #include <kmessage.h>
00029 #include <kpassivepopupmessagehandler.h>
00030 #include <kdefakes.h>
00031 
00032 #include "knotify.h"
00033 
00034 
00035 int main(int argc, char **argv)
00036 {
00037     KAboutData aboutdata("knotify", "knotify4", ki18n("KNotify"),
00038                          "4.0", ki18n("KDE Notification Daemon"),
00039                          KAboutData::License_GPL, ki18n("(C) 1997-2008, KDE Developers"));
00040     aboutdata.addAuthor(ki18n("Olivier Goffart"),ki18n("Current Maintainer"),"ogoffart@kde.org");
00041     aboutdata.addAuthor(ki18n("Carsten Pfeiffer"),ki18n("Previous Maintainer"),"pfeiffer@kde.org");
00042     aboutdata.addAuthor(ki18n("Christian Esken"),KLocalizedString(),"esken@kde.org");
00043     aboutdata.addAuthor(ki18n("Stefan Westerfeld"),ki18n("Sound support"),"stefan@space.twc.de");
00044     aboutdata.addAuthor(ki18n("Charles Samuels"),ki18n("Previous Maintainer"),"charles@kde.org");
00045     aboutdata.addAuthor(ki18n("Allan Sandfeld Jensen"),ki18n("Porting to KDE 4"),"kde@carewolf.com");
00046 
00047     KCmdLineArgs::init( argc, argv, &aboutdata );
00048     KUniqueApplication::addCmdLineOptions();
00049 
00050     // initialize application
00051     if ( !KUniqueApplication::start() ) {
00052         kDebug() << "Running knotify found";
00053         return 0;
00054     }
00055 
00056     // do not connect to ksmserver at all, knotify is launched on demand and doesn't need
00057     // to know about logout, and moreover it may be ksmserver who tries to launch knotify,
00058     // in which case there is a deadlock with ksmserver waiting for knotify to finish
00059     // startup and knotify waiting to register with ksmserver
00060     unsetenv( "SESSION_MANAGER" ); 
00061     KUniqueApplication app;
00062     
00063     /*
00064      * the default KMessageBoxMessageHandler will do messagesbox that notify
00065      * so we have a deadlock if one debug message is shown as messagebox.
00066      * that's why we're forced to change the default handler
00067      */
00068     KMessage::setMessageHandler( new KPassivePopupMessageHandler(0) );
00069 
00070     // start notify service
00071     KNotify notify;
00072 
00073     return app.exec();
00074 }
00075 

KNotify

Skip menu "KNotify"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal