[kdisplaymanager] Relax HAVE_X11 check

Only one function (GDMAuthenticate) actually needs X11
wilder-5.26
Nicolas Fella 4 years ago
parent 5bc7efd0d9
commit f61c989837
  1. 10
      libkworkspace/kdisplaymanager.cpp
  2. 47
      libkworkspace/kdisplaymanager.h

@ -6,8 +6,6 @@
#include "kdisplaymanager.h" #include "kdisplaymanager.h"
#if HAVE_X11
#include <kuser.h> #include <kuser.h>
#include <KLocalizedString> #include <KLocalizedString>
@ -19,6 +17,9 @@
#include <QDBusMetaType> #include <QDBusMetaType>
#include <QDBusObjectPath> #include <QDBusObjectPath>
#include <QDBusReply> #include <QDBusReply>
#include "config-X11.h"
#if HAVE_X11
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <private/qtx11extras_p.h> #include <private/qtx11extras_p.h>
#else #else
@ -27,6 +28,7 @@
#include <X11/Xauth.h> #include <X11/Xauth.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif // HAVE_X11
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
@ -852,6 +854,7 @@ void KDisplayManager::lockSwitchVT(int vt)
void KDisplayManager::GDMAuthenticate() void KDisplayManager::GDMAuthenticate()
{ {
#if HAVE_X11
FILE *fp; FILE *fp;
const char *dpy, *dnum, *dne; const char *dpy, *dnum, *dne;
int dnl; int dnl;
@ -887,6 +890,5 @@ void KDisplayManager::GDMAuthenticate()
} }
fclose(fp); fclose(fp);
}
#endif // HAVE_X11 #endif // HAVE_X11
}

@ -7,7 +7,6 @@
#pragma once #pragma once
#include "config-libkworkspace.h"
#include "kworkspace.h" #include "kworkspace.h"
#include "kworkspace_export.h" #include "kworkspace_export.h"
#include <QByteArray> #include <QByteArray>
@ -24,8 +23,6 @@ typedef QList<SessEnt> SessList;
class KWORKSPACE_EXPORT KDisplayManager class KWORKSPACE_EXPORT KDisplayManager
{ {
#if HAVE_X11
public: public:
KDisplayManager(); KDisplayManager();
~KDisplayManager(); ~KDisplayManager();
@ -51,52 +48,8 @@ private:
void GDMAuthenticate(); 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: private:
#if HAVE_X11
class Private; class Private;
Private *const d; Private *const d;
#endif // HAVE_X11
}; // class KDisplayManager }; // class KDisplayManager

Loading…
Cancel
Save