1 | /* |
2 | This file is part of the Nepomuk KDE project. |
3 | SPDX-FileCopyrightText: 2010-14 Vishesh Handa <handa.vish@gmail.com> |
4 | SPDX-FileCopyrightText: 2010-2011 Sebastian Trueg <trueg@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #include "app.h" |
10 | #include "../priority.h" |
11 | |
12 | #include <KCrash> |
13 | #include <KAboutData> |
14 | #include <KLocalizedString> |
15 | #include <QStandardPaths> |
16 | |
17 | #include <QGuiApplication> |
18 | #include <QSessionManager> |
19 | |
20 | int main(int argc, char* argv[]) |
21 | { |
22 | lowerIOPriority(); |
23 | setIdleSchedulingPriority(); |
24 | lowerPriority(); |
25 | |
26 | QGuiApplication::setDesktopSettingsAware(false); |
27 | QGuiApplication app(argc, argv); |
28 | |
29 | KAboutData aboutData(QStringLiteral("baloo" ), i18n("Baloo File Extractor" ), QLatin1String(PROJECT_VERSION)); |
30 | KAboutData::setApplicationData(aboutData); |
31 | |
32 | KCrash::initialize(); |
33 | |
34 | app.setQuitOnLastWindowClosed(false); |
35 | |
36 | auto disableSessionManagement = [](QSessionManager &sm) { |
37 | sm.setRestartHint(QSessionManager::RestartNever); |
38 | }; |
39 | QObject::connect(sender: &app, signal: &QGuiApplication::commitDataRequest, slot&: disableSessionManagement); |
40 | QObject::connect(sender: &app, signal: &QGuiApplication::saveStateRequest, slot&: disableSessionManagement); |
41 | |
42 | Baloo::App appObject; |
43 | return app.exec(); |
44 | } |
45 | |