2 This file is part of KAddressBook.
4 Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include "aboutdata.h"
22 #include "mainwindow.h"
23 #include "mainwidget.h"
24 #include "kaddressbook_options.h"
26 #include <KCmdLineArgs>
27 #include "kaddressbook_debug.h"
28 #include <kontactinterface/pimuniqueapplication.h>
30 //-----------------------------------------------------------------------------
32 class KAddressBookApplication
: public KontactInterface::PimUniqueApplication
35 KAddressBookApplication()
36 : KontactInterface::PimUniqueApplication(),
40 virtual int newInstance();
43 MainWindow
*mMainWindow
;
46 int KAddressBookApplication::newInstance()
48 qCDebug(KADDRESSBOOK_LOG
);
50 mMainWindow
= new MainWindow
;
53 mMainWindow
->mainWidget()->handleCommandLine();
57 int main(int argc
, char **argv
)
59 KLocalizedString::setApplicationDomain("kaddressbook");
62 KCmdLineArgs::init(argc
, argv
, &about
);
64 KCmdLineArgs::addCmdLineOptions(kaddressbook_options()); // Add KAddressBook options
65 KUniqueApplication::addCmdLineOptions();
66 if (!KAddressBookApplication::start()) {
70 KAddressBookApplication app
;