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 #if QT_VERSION >= 0x050600
33 app
.setAttribute(Qt::AA_EnableHighDpiScaling
);
35 Kdelibs4ConfigMigrator
migrate(QStringLiteral("ktnef"));
36 migrate
.setConfigFiles(QStringList() << QStringLiteral("ktnefrc"));
37 migrate
.setUiFiles(QStringList() << QStringLiteral("ktnefui.rc"));
40 KAboutData
aboutData(QStringLiteral("ktnef"),
42 QStringLiteral(KDEPIM_VERSION
),
43 i18n("Viewer for mail attachments using TNEF format"),
45 i18n("Copyright 2000 Michael Goffioul\nCopyright 2012 Allen Winter"));
48 i18n("Michael Goffioul"),
50 QStringLiteral("kdeprint@swing.be"));
54 i18n("Author, Ported to Qt4/KDE4"),
55 QStringLiteral("winter@kde.org"));
57 KAboutData::setApplicationData(aboutData
);
59 QCommandLineParser parser
;
60 parser
.setApplicationDescription(QApplication::applicationDisplayName());
61 parser
.addVersionOption();
62 parser
.addHelpOption();
63 parser
.addPositionalArgument(QStringLiteral("file"), i18n("An optional argument 'file' "), QStringLiteral("[file]"));
65 aboutData
.setupCommandLine(&parser
);
67 aboutData
.processCommandLine(&parser
);
71 KTNEFMain
*tnef
= new KTNEFMain();
73 const QStringList
&args
= parser
.positionalArguments();
75 if (!args
.isEmpty()) {
76 tnef
->loadFile(args
.first());