4 KNode, the KDE newsreader
5 Copyright (c) 1999-2010 the KNode authors.
6 See file AUTHORS for details
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
17 #include "knapplication.h"
19 #include <kwindowsystem.h>
21 #include <kcmdlineargs.h>
24 #include "knmainwidget.h"
25 #include "knapplication.moc"
28 int KNApplication::newInstance()
30 kDebug() << "KNApplication::newInstance()";
33 if ( isSessionRestored() ) {
35 while (KNMainWindow::canBeRestored(n
)){
36 if (KNMainWindow::classNameOfToplevel(n
)=="KNMainWindow") {
37 KNMainWindow
* mainWin
= new KNMainWindow
;
40 setMainWidget( mainWin
);
48 KNMainWindow
* mainWin
= new KNMainWindow
;
49 setMainWidget(mainWin
); // this makes the external viewer windows close on shutdown...
54 // Handle window activation and startup notification
55 KUniqueApplication::newInstance();
58 KNMainWidget
*w
= static_cast<KNMainWindow
*>(mainWidget())->mainWidget();
59 w
->handleCommandLine();
61 kDebug() << "KNApplication::newInstance() done";