From f61c989837240522dea48d9acb92226909667403 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 26 Jul 2022 14:09:12 +0200 Subject: [PATCH] [kdisplaymanager] Relax HAVE_X11 check Only one function (GDMAuthenticate) actually needs X11 --- libkworkspace/kdisplaymanager.cpp | 10 ++++--- libkworkspace/kdisplaymanager.h | 47 ------------------------------- 2 files changed, 6 insertions(+), 51 deletions(-) diff --git a/libkworkspace/kdisplaymanager.cpp b/libkworkspace/kdisplaymanager.cpp index 149924d5c..12b6f7f33 100644 --- a/libkworkspace/kdisplaymanager.cpp +++ b/libkworkspace/kdisplaymanager.cpp @@ -6,8 +6,6 @@ #include "kdisplaymanager.h" -#if HAVE_X11 - #include #include @@ -19,6 +17,9 @@ #include #include #include + +#include "config-X11.h" +#if HAVE_X11 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include #else @@ -27,6 +28,7 @@ #include #include +#endif // HAVE_X11 #include #include @@ -852,6 +854,7 @@ void KDisplayManager::lockSwitchVT(int vt) void KDisplayManager::GDMAuthenticate() { +#if HAVE_X11 FILE *fp; const char *dpy, *dnum, *dne; int dnl; @@ -887,6 +890,5 @@ void KDisplayManager::GDMAuthenticate() } fclose(fp); -} - #endif // HAVE_X11 +} diff --git a/libkworkspace/kdisplaymanager.h b/libkworkspace/kdisplaymanager.h index 22e1c8607..737c48c7f 100644 --- a/libkworkspace/kdisplaymanager.h +++ b/libkworkspace/kdisplaymanager.h @@ -7,7 +7,6 @@ #pragma once -#include "config-libkworkspace.h" #include "kworkspace.h" #include "kworkspace_export.h" #include @@ -24,8 +23,6 @@ typedef QList SessList; class KWORKSPACE_EXPORT KDisplayManager { -#if HAVE_X11 - public: KDisplayManager(); ~KDisplayManager(); @@ -51,52 +48,8 @@ private: void GDMAuthenticate(); -#else // HAVE_X11 - -public: - KDisplayManager() - { - } - - bool canShutdown() - { - return false; - } - void shutdown(KWorkSpace::ShutdownType shutdownType, KWorkSpace::ShutdownMode shutdownMode, const QString &bootOption = QString()) - { - } - - void setLock(bool) - { - } - - bool isSwitchable() - { - return false; - } - int numReserve() - { - return -1; - } - void startReserve() - { - } - bool localSessions(SessList &list) - { - return false; - } - void switchVT(int vt) - { - } - - bool bootOptions(QStringList &opts, int &dflt, int &curr); - -#endif // HAVE_X11 - private: -#if HAVE_X11 class Private; Private *const d; -#endif // HAVE_X11 }; // class KDisplayManager