File indexing completed on 2024-04-28 05:44:28
0001 /* 0002 This file is part of Massif Visualizer 0003 0004 Copyright 2010 Milian Wolff <mail@milianw.de> 0005 0006 This program is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU General Public License as 0008 published by the Free Software Foundation; either version 2 of 0009 the License or (at your option) version 3 or any later version 0010 accepted by the membership of KDE e.V. (or its successor approved 0011 by the membership of KDE e.V.), which shall act as a proxy 0012 defined in Section 14 of version 3 of the license. 0013 0014 This program is distributed in the hope that it will be useful, 0015 but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0017 GNU General Public License for more details. 0018 0019 You should have received a copy of the GNU General Public License 0020 along with this program. If not, see <http://www.gnu.org/licenses/>. 0021 */ 0022 0023 #include <KLocalizedString> 0024 #include <KAboutData> 0025 0026 #include <QApplication> 0027 #include <QUrl> 0028 #include <QDir> 0029 #include <QCommandLineParser> 0030 #include <QDebug> 0031 0032 #include "mainwindow.h" 0033 0034 int main( int argc, char *argv[] ) 0035 { 0036 QApplication app(argc, argv); 0037 0038 KLocalizedString::setApplicationDomain("massif-visualizer"); 0039 0040 KAboutData aboutData(QStringLiteral("massif-visualizer"), i18n("Massif Visualizer"), QStringLiteral("0.7"), 0041 i18n("A visualizer for output generated by Valgrind's massif tool."), KAboutLicense::LGPL, 0042 i18n("Copyright 2010-2015, Milian Wolff <mail@milianw.de>"), QString(), QStringLiteral("massif-visualizer@kde.org")); 0043 0044 aboutData.addAuthor(i18n("Milian Wolff"), i18n("Original author, maintainer"), 0045 QStringLiteral("mail@milianw.de"), QStringLiteral("http://milianw.de")); 0046 0047 aboutData.addAuthor(i18n("Arnold Dumas"), i18n("Multiple document interface, bug fixes"), 0048 QStringLiteral("arnold@dumas.at"), QStringLiteral("http://arnold.dumas.at")); 0049 0050 aboutData.setOrganizationDomain("kde.org"); 0051 0052 KAboutData::setApplicationData(aboutData); 0053 app.setWindowIcon(QIcon::fromTheme(QStringLiteral("massif-visualizer"))); 0054 0055 QCommandLineParser parser; 0056 aboutData.setupCommandLine(&parser); 0057 0058 parser.addPositionalArgument(QStringLiteral("files"), i18n( "Files to load" ), i18n("[FILE...]")); 0059 0060 parser.process(app); 0061 aboutData.processCommandLine(&parser); 0062 0063 Massif::MainWindow* window = new Massif::MainWindow; 0064 0065 foreach (const QString &file, parser.positionalArguments()) { 0066 window->openFile(QUrl::fromUserInput(file, QDir::currentPath(), QUrl::AssumeLocalFile)); 0067 } 0068 0069 window->show(); 0070 return app.exec(); 0071 }