• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

KNotify

  • sources
  • kde-4.14
  • kde-runtime
  • knotify
main.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
3 
4 
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.
9 
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.
14 
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.
18 
19  */
20 
21 
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 <kdeversion.h>
31 #include <kdefakes.h>
32 
33 #include "knotify.h"
34 
35 
36 int main(int argc, char **argv)
37 {
38  KAboutData aboutdata("knotify", "knotify4", ki18n("KNotify"),
39  KDE_VERSION_STRING, ki18n("KDE Notification Daemon"),
40  KAboutData::License_GPL, ki18n("(C) 1997-2008, KDE Developers"));
41  aboutdata.addAuthor(ki18n("Olivier Goffart"),ki18n("Current Maintainer"),"ogoffart@kde.org");
42  aboutdata.addAuthor(ki18n("Carsten Pfeiffer"),ki18n("Previous Maintainer"),"pfeiffer@kde.org");
43  aboutdata.addAuthor(ki18n("Christian Esken"),KLocalizedString(),"esken@kde.org");
44  aboutdata.addAuthor(ki18n("Stefan Westerfeld"),ki18n("Sound support"),"stefan@space.twc.de");
45  aboutdata.addAuthor(ki18n("Charles Samuels"),ki18n("Previous Maintainer"),"charles@kde.org");
46  aboutdata.addAuthor(ki18n("Allan Sandfeld Jensen"),ki18n("Porting to KDE 4"),"kde@carewolf.com");
47 
48  KCmdLineArgs::init( argc, argv, &aboutdata );
49  KUniqueApplication::addCmdLineOptions();
50 
51  // initialize application
52  if ( !KUniqueApplication::start() ) {
53  kDebug() << "Running knotify found";
54  return 0;
55  }
56 
57  // do not connect to ksmserver at all, knotify is launched on demand and doesn't need
58  // to know about logout, and moreover it may be ksmserver who tries to launch knotify,
59  // in which case there is a deadlock with ksmserver waiting for knotify to finish
60  // startup and knotify waiting to register with ksmserver
61  unsetenv( "SESSION_MANAGER" );
62  KUniqueApplication app;
63 
64  /*
65  * the default KMessageBoxMessageHandler will do messagesbox that notify
66  * so we have a deadlock if one debug message is shown as messagebox.
67  * that's why we're forced to change the default handler
68  */
69  KMessage::setMessageHandler( new KPassivePopupMessageHandler(0) );
70 
71  // start notify service
72  KNotify notify;
73 
74  return app.exec();
75 }
76 
main
int main(int argc, char **argv)
Definition: main.cpp:36
knotify.h
KNotify
Definition: knotify.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNotify

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

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal