SVN_SILENT made messages (.desktop file)
[kdepim.git] / ktnef / main.cpp
bloba224b38d4ead21056d9b7a4bfd42afcb4413da03
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 KLocalizedString::setApplicationDomain("ktnef");
31 app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
32 Kdelibs4ConfigMigrator migrate(QStringLiteral("ktnef"));
33 migrate.setConfigFiles(QStringList() << QStringLiteral("ktnefrc"));
34 migrate.setUiFiles(QStringList() << QStringLiteral("ktnefui.rc"));
35 migrate.migrate();
37 KAboutData aboutData(QStringLiteral("ktnef"),
38 i18n("KTnef"),
39 QStringLiteral(KDEPIM_VERSION),
40 i18n("Viewer for mail attachments using TNEF format"),
41 KAboutLicense::GPL,
42 i18n("Copyright 2000 Michael Goffioul\nCopyright 2012 Allen Winter"));
44 aboutData.addAuthor(
45 i18n("Michael Goffioul"),
46 i18n("Author"),
47 QStringLiteral("kdeprint@swing.be"));
49 aboutData.addAuthor(
50 i18n("Allen Winter"),
51 i18n("Author, Ported to Qt4/KDE4"),
52 QStringLiteral("winter@kde.org"));
54 KAboutData::setApplicationData(aboutData);
56 QCommandLineParser parser;
57 parser.setApplicationDescription(QApplication::applicationDisplayName());
58 parser.addVersionOption();
59 parser.addHelpOption();
60 parser.addPositionalArgument(QStringLiteral("file"), i18n("An optional argument 'file' "), QStringLiteral("[file]"));
62 aboutData.setupCommandLine(&parser);
63 parser.process(app);
64 aboutData.processCommandLine(&parser);
66 KDBusService service;
68 KTNEFMain *tnef = new KTNEFMain();
69 tnef->show();
70 const QStringList &args = parser.positionalArguments();
72 if (!args.isEmpty()) {
73 tnef->loadFile(args.first());
76 return app.exec();