knotes
application.cpp
Go to the documentation of this file.00001 /******************************************************************* 00002 KNotes -- Notes for the KDE project 00003 00004 Copyright (c) 1997-2007, The KNotes Developers 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 as published by the Free Software Foundation; either version 2 00009 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 *******************************************************************/ 00020 00021 #include "application.h" 00022 #include "knotesapp.h" 00023 #include <kcmdlineargs.h> 00024 00025 00026 Application::Application() 00027 : KPIM::PimApplication(), mMainWindow( 0 ) 00028 { 00029 mCmdLineArguments = KCmdLineArgs::parsedArgs(); 00030 } 00031 00032 Application::~Application() 00033 { 00034 delete mMainWindow; 00035 } 00036 00037 int Application::newInstance() 00038 { 00039 if ( !mMainWindow ) { 00040 mMainWindow = new KNotesApp(); 00041 } else { 00042 if ( !args()->isSet( "skip-note" ) ) { 00043 mMainWindow->newNote(); 00044 } 00045 } 00046 00047 return KUniqueApplication::newInstance(); 00048 } 00049 00050 KCmdLineArgs *Application::args() const 00051 { 00052 return mCmdLineArguments; 00053 }
KDE 4.2 API Reference