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

knode

  • sources
  • kde-4.14
  • 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 
26 
27 int KNApplication::newInstance()
28 {
29  kDebug() << "KNApplication::newInstance()";
30 
31  if (!mainWidget()) {
32  if ( isSessionRestored() ) {
33  int n = 1;
34  while (KNMainWindow::canBeRestored(n)){
35  if (KNMainWindow::classNameOfToplevel(n)=="KNMainWindow") {
36  KNMainWindow* mainWin = new KNMainWindow;
37  mainWin->restore(n);
38  if ( n == 1 )
39  setMainWidget( mainWin );
40  break;
41  }
42  n++;
43  }
44  }
45 
46  if (!mainWidget()) {
47  KNMainWindow* mainWin = new KNMainWindow;
48  setMainWidget(mainWin); // this makes the external viewer windows close on shutdown...
49  mainWin->show();
50  }
51  }
52 
53  // Handle window activation and startup notification
54  KUniqueApplication::newInstance();
55 
56  // process URLs...
57  KNMainWidget *w = static_cast<KNMainWindow*>(mainWidget())->mainWidget();
58  w->handleCommandLine();
59 
60  kDebug() << "KNApplication::newInstance() done";
61  return 0;
62 }
63 
64 
KNApplication::newInstance
int newInstance()
Create new instance of KNode.
Definition: knapplication.cpp:27
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:18 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
  • pimprint

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