increase version
[kdepim.git] / ktnef / main.cpp
blob4e6c6a94f218e599313872714522af8e639c05e4
1 /*
2 This file is part of KTnef.
4 Copyright (C) 2002 Michael Goffioul <kdeprint@swing.be>
5 Copyright (c) 2012 Allen Winter <winter@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 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software Foundation,
14 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17 #include "ktnefmain.h"
18 #include "kdepim-version.h"
20 #include <Kdelibs4ConfigMigrator>
21 #include <kaboutdata.h>
22 #include <KLocalizedString>
23 #include <QCommandLineParser>
24 #include <QApplication>
25 #include <KDBusService>
27 int main(int argc, char *argv[])
29 QApplication app(argc, argv);
30 app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
31 Kdelibs4ConfigMigrator migrate(QStringLiteral("ktnef"));
32 migrate.setConfigFiles(QStringList() << QStringLiteral("ktnefrc"));
33 migrate.setUiFiles(QStringList() << QStringLiteral("ktnefui.rc"));
34 migrate.migrate();
36 KAboutData aboutData(QStringLiteral("ktnef"),
37 i18n("KTnef"),
38 QStringLiteral(KDEPIM_VERSION),
39 i18n("Viewer for mail attachments using TNEF format"),
40 KAboutLicense::GPL,
41 i18n("Copyright 2000 Michael Goffioul\nCopyright 2012 Allen Winter"));
43 aboutData.addAuthor(
44 i18n("Michael Goffioul"),
45 i18n("Author"),
46 QStringLiteral("kdeprint@swing.be"));
48 aboutData.addAuthor(
49 i18n("Allen Winter"),
50 i18n("Author, Ported to Qt4/KDE4"),
51 QStringLiteral("winter@kde.org"));
53 KAboutData::setApplicationData(aboutData);
55 QCommandLineParser parser;
56 parser.setApplicationDescription(QApplication::applicationDisplayName());
57 parser.addVersionOption();
58 parser.addHelpOption();
59 parser.addPositionalArgument(QStringLiteral("file"), i18n("An optional argument 'file' "), QStringLiteral("[file]"));
61 aboutData.setupCommandLine(&parser);
62 parser.process(app);
63 aboutData.processCommandLine(&parser);
65 KDBusService service;
67 KTNEFMain *tnef = new KTNEFMain();
68 tnef->show();
69 const QStringList &args = parser.positionalArguments();
71 if (!args.isEmpty()) {
72 tnef->loadFile(args.first());
75 return app.exec();