Changeset View
Changeset View
Standalone View
Standalone View
kaccess/main.cpp
Show All 20 Lines | |||||
21 | 21 | | |||
22 | #include "kaccess.h" | 22 | #include "kaccess.h" | ||
23 | #include <kdebug.h> | 23 | #include <kdebug.h> | ||
24 | #include <k4aboutdata.h> | 24 | #include <k4aboutdata.h> | ||
25 | #include <kcmdlineargs.h> | 25 | #include <kcmdlineargs.h> | ||
26 | #include <KLocalizedString> | 26 | #include <KLocalizedString> | ||
27 | #include <QX11Info> | 27 | #include <QX11Info> | ||
28 | #include <Kdelibs4ConfigMigrator> | 28 | #include <Kdelibs4ConfigMigrator> | ||
29 | #include <QSessionManager> | ||||
29 | 30 | | |||
30 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char * argv[]) | 31 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char * argv[]) | ||
31 | { | 32 | { | ||
32 | Kdelibs4ConfigMigrator migrate(QStringLiteral("kaccess")); | 33 | Kdelibs4ConfigMigrator migrate(QStringLiteral("kaccess")); | ||
33 | migrate.setConfigFiles(QStringList() << QStringLiteral("kaccessrc")); | 34 | migrate.setConfigFiles(QStringList() << QStringLiteral("kaccessrc")); | ||
34 | migrate.migrate(); | 35 | migrate.migrate(); | ||
35 | 36 | | |||
37 | QGuiApplication::setFallbackSessionManagementEnabled(false); | ||||
38 | | ||||
36 | K4AboutData about(I18N_NOOP("kaccess"), 0, ki18n("KDE Accessibility Tool"), | 39 | K4AboutData about(I18N_NOOP("kaccess"), 0, ki18n("KDE Accessibility Tool"), | ||
37 | 0, KLocalizedString(), K4AboutData::License_GPL, | 40 | 0, KLocalizedString(), K4AboutData::License_GPL, | ||
38 | ki18n("(c) 2000, Matthias Hoelzer-Kluepfel")); | 41 | ki18n("(c) 2000, Matthias Hoelzer-Kluepfel")); | ||
39 | 42 | | |||
40 | about.addAuthor(ki18n("Matthias Hoelzer-Kluepfel"), ki18n("Author") , "hoelzer@kde.org"); | 43 | about.addAuthor(ki18n("Matthias Hoelzer-Kluepfel"), ki18n("Author") , "hoelzer@kde.org"); | ||
41 | 44 | | |||
42 | KCmdLineArgs::init(argc, argv, &about); | 45 | KCmdLineArgs::init(argc, argv, &about); | ||
43 | 46 | | |||
Show All 14 Lines | |||||
58 | kDebug() << "Xlib XKB extension major=" << major << " minor=" << minor; | 61 | kDebug() << "Xlib XKB extension major=" << major << " minor=" << minor; | ||
59 | 62 | | |||
60 | // we need an application object for QX11Info | 63 | // we need an application object for QX11Info | ||
61 | KAccessApp app; | 64 | KAccessApp app; | ||
62 | if (app.isFailed()) { | 65 | if (app.isFailed()) { | ||
63 | return 1; | 66 | return 1; | ||
64 | } | 67 | } | ||
65 | 68 | | |||
69 | auto disableSessionManagement = [](QSessionManager &sm) { | ||||
70 | sm.setRestartHint(QSessionManager::RestartNever); | ||||
71 | }; | ||||
72 | | ||||
73 | QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); | ||||
74 | QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); | ||||
75 | | ||||
76 | | ||||
66 | // verify the X server has matching XKB extension | 77 | // verify the X server has matching XKB extension | ||
67 | // if yes, the XKB extension is initialized | 78 | // if yes, the XKB extension is initialized | ||
68 | int opcode_rtrn; | 79 | int opcode_rtrn; | ||
69 | int error_rtrn; | 80 | int error_rtrn; | ||
70 | int xkb_opcode; | 81 | int xkb_opcode; | ||
71 | if (!XkbQueryExtension(QX11Info::display(), &opcode_rtrn, &xkb_opcode, &error_rtrn, | 82 | if (!XkbQueryExtension(QX11Info::display(), &opcode_rtrn, &xkb_opcode, &error_rtrn, | ||
72 | &major, &minor)) { | 83 | &major, &minor)) { | ||
73 | kError() << "X server has not matching XKB extension" << endl; | 84 | kError() << "X server has not matching XKB extension" << endl; | ||
Show All 11 Lines |