SVN_SILENT made messages (.desktop file)
[kdepim.git] / kaddressbook / main.cpp
blobe9ab693b47705ddb3fae74b40a4aa316543ae0ab
1 /*
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
34 public:
35 KAddressBookApplication()
36 : KontactInterface::PimUniqueApplication(),
37 mMainWindow(0)
40 virtual int newInstance();
42 private:
43 MainWindow *mMainWindow;
46 int KAddressBookApplication::newInstance()
48 qCDebug(KADDRESSBOOK_LOG);
49 if (!mMainWindow) {
50 mMainWindow = new MainWindow;
51 mMainWindow->show();
53 mMainWindow->mainWidget()->handleCommandLine();
54 return 0;
57 int main(int argc, char **argv)
59 KLocalizedString::setApplicationDomain("kaddressbook");
60 AboutData about;
62 KCmdLineArgs::init(argc, argv, &about);
64 KCmdLineArgs::addCmdLineOptions(kaddressbook_options()); // Add KAddressBook options
65 KUniqueApplication::addCmdLineOptions();
66 if (!KAddressBookApplication::start()) {
67 return 0;
70 KAddressBookApplication app;
72 return app.exec();