File indexing completed on 2024-05-12 16:36:31

0001 /* This file is part of the KDE project
0002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #include <KPrAboutData.h>
0021 #include <KPrDocument.h>
0022 
0023 #include <KoApplication.h>
0024 #include <Calligra2Migration.h>
0025 
0026 #include <QLoggingCategory>
0027 
0028 extern "C" Q_DECL_EXPORT int kdemain( int argc, char **argv )
0029 {
0030     /**
0031      * Disable debug output by default, only log warnings.
0032      * Debug logs can be controlled by the environment variable QT_LOGGING_RULES.
0033      *
0034      * For example, to get full debug output, run the following:
0035      * QT_LOGGING_RULES="calligra.*=true" calligrastage
0036      *
0037      * See: http://doc.qt.io/qt-5/qloggingcategory.html
0038      */
0039     QLoggingCategory::setFilterRules("calligra.*.debug=false\n"
0040                                      "calligra.*.warning=true");
0041 
0042     KoApplication app(STAGE_MIME_TYPE, QStringLiteral("calligrastage"), newKPresenterAboutData, argc, argv);
0043 
0044     // Migrate data from kde4 to kf5 locations
0045     Calligra2Migration m("calligrastage", "stage");
0046     m.setConfigFiles(QStringList() << QStringLiteral("stagerc"));
0047     m.setUiFiles(QStringList() << QStringLiteral("stage.rc") << QStringLiteral("stage_readonly.rc"));
0048     m.migrate();
0049 
0050     if (!app.start()) {
0051         return 1;
0052     }
0053 
0054     return app.exec();
0055 }