Fix Bug 362152 - Font selection is not honored
[kdepim.git] / sieveeditor / main.cpp
blob042768e50eefb41eabeb6dac53c4bfd9f8098792
1 /*
2 Copyright (c) 2013-2016 Montel Laurent <montel@kde.org>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
21 #include "kdepim-version.h"
22 #include "sieveeditormainwindow.h"
23 #include <kaboutdata.h>
24 #include <KLocalizedString>
25 #include <Kdelibs4ConfigMigrator>
26 #include <QApplication>
27 #include <KDBusService>
28 #include <QCommandLineParser>
30 int main(int argc, char **argv)
32 QApplication app(argc, argv);
33 app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
34 #if QT_VERSION >= 0x050600
35 app.setAttribute(Qt::AA_EnableHighDpiScaling);
36 #endif
37 Kdelibs4ConfigMigrator migrate(QStringLiteral("sieveeditor"));
38 migrate.setConfigFiles(QStringList() << QStringLiteral("sieveeditorrc") << QStringLiteral("sievetemplaterc"));
39 migrate.setUiFiles(QStringList() << QStringLiteral("sieveeditorui.rc"));
40 migrate.migrate();
42 KLocalizedString::setApplicationDomain("sieveeditor");
44 KAboutData aboutData(QStringLiteral("sieveeditor"),
45 i18n("KSieve Editor"),
46 QStringLiteral(KDEPIM_VERSION),
47 i18n("Sieve Editor"),
48 KAboutLicense::GPL_V2,
49 i18n("Copyright © 2013-2016 sieveeditor authors"));
50 aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("montel@kde.org"));
52 QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail")));
53 KAboutData::setApplicationData(aboutData);
55 QCommandLineParser parser;
56 parser.addVersionOption();
57 parser.addHelpOption();
58 aboutData.setupCommandLine(&parser);
59 parser.process(app);
60 aboutData.processCommandLine(&parser);
62 KDBusService service(KDBusService::Unique);
64 SieveEditorMainWindow *mw = new SieveEditorMainWindow();
65 mw->show();
66 const int val = app.exec();
67 return val;