• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
knapplication.cpp
Go to the documentation of this file.
1 /*
2  knapplication.cpp
3 
4  KNode, the KDE newsreader
5  Copyright (c) 1999-2010 the KNode authors.
6  See file AUTHORS for details
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 */
16 
17 #include "knapplication.h"
18 
19 #include <kwindowsystem.h>
20 #include <kdebug.h>
21 #include <kcmdlineargs.h>
22 
23 #include "knode.h"
24 #include "knmainwidget.h"
25 #include "knapplication.moc"
26 
27 
28 int KNApplication::newInstance()
29 {
30  kDebug() << "KNApplication::newInstance()";
31 
32  if (!mainWidget()) {
33  if ( isSessionRestored() ) {
34  int n = 1;
35  while (KNMainWindow::canBeRestored(n)){
36  if (KNMainWindow::classNameOfToplevel(n)=="KNMainWindow") {
37  KNMainWindow* mainWin = new KNMainWindow;
38  mainWin->restore(n);
39  if ( n == 1 )
40  setMainWidget( mainWin );
41  break;
42  }
43  n++;
44  }
45  }
46 
47  if (!mainWidget()) {
48  KNMainWindow* mainWin = new KNMainWindow;
49  setMainWidget(mainWin); // this makes the external viewer windows close on shutdown...
50  mainWin->show();
51  }
52  }
53 
54  // Handle window activation and startup notification
55  KUniqueApplication::newInstance();
56 
57  // process URLs...
58  KNMainWidget *w = static_cast<KNMainWindow*>(mainWidget())->mainWidget();
59  w->handleCommandLine();
60 
61  kDebug() << "KNApplication::newInstance() done";
62  return 0;
63 }
64 
65 
KNApplication::newInstance
int newInstance()
Create new instance of KNode.
Definition: knapplication.cpp:28
KNMainWidget
This is the central part of the KNode GUI.
Definition: knmainwidget.h:57
KNMainWidget::handleCommandLine
Q_SCRIPTABLE bool handleCommandLine()
Process command-line options.
Definition: knmainwidget.cpp:2100
knmainwidget.h
knode.h
KNMainWindow
KNode main window.
Definition: knode.h:38
knapplication.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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