Merge remote-tracking branch 'origin/Applications/16.08'
[kdepim.git] / korganizer / src / main.cpp
blobfe9567841ab871b4c24191ac07d56b1949dfdf08
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 1997-1999 Preston Brown <pbrown@kde.org>
5 Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution.
26 #include "aboutdata.h"
27 #include "koapp.h"
28 #include "korganizer.h"
29 #include "korganizer_options.h"
30 #include "korganizer_debug.h"
31 #include "korgmigrateapplication.h"
33 #include <KLocalizedString>
34 #include <KCrash>
35 int main(int argc, char **argv)
37 KOrganizerApp app(argc, &argv);
38 app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
39 app.setAttribute(Qt::AA_EnableHighDpiScaling);
40 KCrash::initialize();
41 KLocalizedString::setApplicationDomain("korganizer");
42 KOrgMigrateApplication migrate;
43 migrate.migrate();
45 KOrg::AboutData aboutData;
46 app.setAboutData(aboutData);
48 QCommandLineParser *cmdArgs = app.cmdArgs();
49 korganizer_options(cmdArgs);
51 const QStringList args = QApplication::arguments();
52 cmdArgs->process(args);
53 aboutData.processCommandLine(cmdArgs);
55 if (!KOrganizerApp::start(args)) {
56 qCDebug(KORGANIZER_LOG) << "korganizer already running, exiting";
57 return 0;
60 if (app.isSessionRestored()) {
61 kRestoreMainWindows<KOrganizer>();
64 return app.exec();