Changeset View
Changeset View
Standalone View
Standalone View
greeter/main.cpp
Show All 11 Lines | |||||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. | ||
15 | 15 | | |||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | *********************************************************************/ | 18 | *********************************************************************/ | ||
19 | #include <KLocalizedString> | 19 | #include <KLocalizedString> | ||
20 | #include <KQuickAddons/QtQuickSettings> | ||||
20 | 21 | | |||
21 | #include <QDateTime> | 22 | #include <QDateTime> | ||
22 | #include <QCommandLineParser> | 23 | #include <QCommandLineParser> | ||
23 | #include <QSessionManager> | 24 | #include <QSessionManager> | ||
24 | 25 | | |||
25 | #include <iostream> | 26 | #include <iostream> | ||
26 | 27 | | |||
27 | #include <signal.h> | 28 | #include <signal.h> | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 80 | if (!qEnvironmentVariableIsSet("QT_IM_MODULE") || (qEnvironmentVariableIsSet("QT_IM_MODULE") && qgetenv("QT_IM_MODULE") != QByteArrayLiteral("maliit"))) { | |||
80 | qputenv("QT_IM_MODULE", QByteArrayLiteral("qtvirtualkeyboard")); | 81 | qputenv("QT_IM_MODULE", QByteArrayLiteral("qtvirtualkeyboard")); | ||
81 | } | 82 | } | ||
82 | ScreenLocker::UnlockApp app(argc, argv); | 83 | ScreenLocker::UnlockApp app(argc, argv); | ||
83 | app.setQuitOnLastWindowClosed(false); | 84 | app.setQuitOnLastWindowClosed(false); | ||
84 | QCoreApplication::setApplicationName(QStringLiteral("kscreenlocker_greet")); | 85 | QCoreApplication::setApplicationName(QStringLiteral("kscreenlocker_greet")); | ||
85 | QCoreApplication::setApplicationVersion(QStringLiteral("0.1")); | 86 | QCoreApplication::setApplicationVersion(QStringLiteral("0.1")); | ||
86 | QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org")); | 87 | QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org")); | ||
87 | 88 | | |||
89 | KQuickAddons::QtQuickSettings::init(); | ||||
90 | | ||||
88 | // disable session management for the greeter | 91 | // disable session management for the greeter | ||
89 | auto disableSessionManagement = [](QSessionManager &sm) { | 92 | auto disableSessionManagement = [](QSessionManager &sm) { | ||
90 | sm.setRestartHint(QSessionManager::RestartNever); | 93 | sm.setRestartHint(QSessionManager::RestartNever); | ||
91 | }; | 94 | }; | ||
92 | QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); | 95 | QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); | ||
93 | QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); | 96 | QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); | ||
94 | 97 | | |||
95 | QCommandLineParser parser; | 98 | QCommandLineParser parser; | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |