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"));
37 KAboutData
aboutData(QStringLiteral("ktnef"),
39 QStringLiteral(KDEPIM_VERSION
),
40 i18n("Viewer for mail attachments using TNEF format"),
42 i18n("Copyright 2000 Michael Goffioul\nCopyright 2012 Allen Winter"));
45 i18n("Michael Goffioul"),
47 QStringLiteral("kdeprint@swing.be"));
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
);
64 aboutData
.processCommandLine(&parser
);
68 KTNEFMain
*tnef
= new KTNEFMain();
70 const QStringList
&args
= parser
.positionalArguments();
72 if (!args
.isEmpty()) {
73 tnef
->loadFile(args
.first());