File indexing completed on 2024-05-05 08:08:36

0001 /***************************************************************************
0002                           main.cpp  -  description
0003                              -------------------
0004     begin                : mer jui 11 22:27:28 EDT 2001
0005     copyright            : (C) 2001 by Gaël de Chalendar
0006     email                : Gael.de.Chalendar@free.fr
0007 
0008 This is the standard main function of a KDE application 
0009 
0010    KsirK is free software; you can redistribute it and/or
0011    modify it under the terms of the GNU General Public
0012    License as published by the Free Software Foundation, either version 2
0013    of the License, or (at your option) any later version.
0014 
0015    This program is distributed in the hope that it will be useful,
0016    but WITHOUT ANY WARRANTY; without even the implied warranty of
0017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018    General Public License for more details.
0019 
0020    You should have received a copy of the GNU General Public License
0021    along with this program; if not, write to the Free Software
0022    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0023    02110-1301, USA
0024 
0025 ***************************************************************************/
0026 
0027 #include "mainwindow.h"
0028 
0029 
0030 #include <KAboutData>
0031 #include <KLocalizedString>
0032 #include "ksirkskineditor_debug.h"
0033 
0034 #include "../ksirk_version.h"
0035 
0036 #include <KToolBar>
0037 #include <QApplication>
0038 #include <QCommandLineParser>
0039 #include <QCommandLineOption>
0040 
0041 int main(int argc, char *argv[])
0042 {
0043   qCDebug(KSIRKSKINEDITOR_LOG) << "Hello World!";
0044 
0045   QApplication app(argc, argv);
0046   KLocalizedString::setApplicationDomain("ksirkskineditor");
0047   KAboutData aboutData(
0048     QStringLiteral("ksirkskineditor"),
0049     i18n("KsirK Skin Editor"),
0050     QStringLiteral(KSIRK_VERSION_STRING),
0051     i18n("KsirK Skin Editor"),
0052     KAboutLicense::GPL,
0053     i18n("(c) 2008, Gaël de Chalendar\n"),
0054     i18n("For help and user manual, please see\nThe KsirK Web site"),
0055     QStringLiteral("https://apps.kde.org/ksirk"));
0056   aboutData.addAuthor(i18n("Gaël de Chalendar aka Kleag"),QString(), QStringLiteral("kleag@free.fr"));
0057   QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-locale")));
0058 
0059     QCommandLineParser parser;
0060     KAboutData::setApplicationData(aboutData);
0061     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[File]"), i18n("file to open")));
0062 
0063     aboutData.setupCommandLine(&parser);
0064     parser.process(app);
0065     aboutData.processCommandLine(&parser);
0066 
0067   if (app.isSessionRestored())
0068   {
0069       kRestoreMainWindows<KsirkSkinEditor::MainWindow>();
0070   }
0071   else
0072   {
0073     qCDebug(KSIRKSKINEDITOR_LOG) << "Creating main window";
0074     KsirkSkinEditor::MainWindow *ksirkskineditor = new KsirkSkinEditor::MainWindow();
0075     ksirkskineditor->show();
0076   }
0077   qCDebug(KSIRKSKINEDITOR_LOG) << "Executing app";
0078   return app.exec();
0079 }