File 0001-Revert-Rename-XDisplay-and-WaylandDisplay-config-sec.patch of Package sddm

From 3433d340ed936160c2178f3c021308d44008cf48 Mon Sep 17 00:00:00 2001
From: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Date: Mon, 29 Aug 2016 12:11:03 +0200
Subject: [PATCH] Revert "Rename XDisplay and WaylandDisplay config sections"

This reverts commit 98bcb147acb793bf642e8a7bc9f69facb80e469a.

The section name changes are not backwards compatible causing issues
to downstream as reported in #679 and #680.

The fastest way to resolve the issue is to revert the patch, what
I want to see in the future is an upgrade path when the
configuration format changes.
---
 data/man/sddm.conf.rst.in        |  4 ++--
 src/common/Configuration.h       |  4 ++--
 src/common/Session.cpp           |  4 ++--
 src/daemon/Display.cpp           |  4 ++--
 src/daemon/Seat.cpp              |  2 +-
 src/daemon/XorgDisplayServer.cpp | 14 +++++++-------
 src/greeter/SessionModel.cpp     | 12 ++++++------
 src/helper/Backend.cpp           |  2 +-
 src/helper/UserSession.cpp       | 10 +++++-----
 9 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/data/man/sddm.conf.rst.in b/data/man/sddm.conf.rst.in
index 3238af5..b10de94 100644
--- a/data/man/sddm.conf.rst.in
+++ b/data/man/sddm.conf.rst.in
@@ -75,7 +75,7 @@ OPTIONS
 	them altogether.
 	Default value is true.
 
-[X11] section:
+[XDisplay] section:
 
 `ServerPath=`
 	Path of the X server.
@@ -125,7 +125,7 @@ OPTIONS
 	increase as new displays added.
 	Default value is @MINIMUM_VT@.
 
-[Wayland] section:
+[WaylandDisplay] section:
 
 `SessionDir=`
 	Path of the directory containing session files.
diff --git a/src/common/Configuration.h b/src/common/Configuration.h
index f790343..666e3e6 100644
--- a/src/common/Configuration.h
+++ b/src/common/Configuration.h
@@ -57,7 +57,7 @@ namespace SDDM {
         );
 
         // TODO: Not absolutely sure if everything belongs here. Xsessions, VT and probably some more seem universal
-        Section(X11,
+        Section(XDisplay,
             Entry(ServerPath,          QString,     _S("/usr/bin/X"),                           _S("Path to X server binary"));
             Entry(ServerArguments,     QString,     _S("-nolisten tcp"),                        _S("Arguments passed to the X server invocation"));
             Entry(XephyrPath,          QString,     _S("/usr/bin/Xephyr"),                      _S("Path to Xephyr binary"));
@@ -71,7 +71,7 @@ namespace SDDM {
             Entry(MinimumVT,           int,         MINIMUM_VT,                                 _S("The lowest virtual terminal number that will be used."));
         );
 
-        Section(Wayland,
+        Section(WaylandDisplay,
             Entry(SessionDir,          QString,     _S("/usr/share/wayland-sessions"),          _S("Directory containing available Wayland sessions"));
             Entry(SessionCommand,      QString,     _S(WAYLAND_SESSION_COMMAND),                _S("Path to a script to execute when starting the desktop session"));
 	    Entry(SessionLogFile,      QString,     _S(".local/share/sddm/wayland-session.log"),_S("Path to the user session log file"));
diff --git a/src/common/Session.cpp b/src/common/Session.cpp
index 844572c..3605176 100644
--- a/src/common/Session.cpp
+++ b/src/common/Session.cpp
@@ -118,11 +118,11 @@ namespace SDDM {
 
         switch (type) {
         case X11Session:
-            m_dir = QDir(mainConfig.X11.SessionDir.get());
+            m_dir = QDir(mainConfig.XDisplay.SessionDir.get());
             m_xdgSessionType = QStringLiteral("x11");
             break;
         case WaylandSession:
-            m_dir = QDir(mainConfig.Wayland.SessionDir.get());
+            m_dir = QDir(mainConfig.WaylandDisplay.SessionDir.get());
             m_xdgSessionType = QStringLiteral("wayland");
             break;
         default:
diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp
index 2c9b0d3..7dd4c4d 100644
--- a/src/daemon/Display.cpp
+++ b/src/daemon/Display.cpp
@@ -110,9 +110,9 @@ namespace SDDM {
 
         // determine session type
         const QString &autologinSession = mainConfig.Autologin.Session.get();
-        if (findSessionEntry(mainConfig.X11.SessionDir.get(), autologinSession)) {
+        if (findSessionEntry(mainConfig.XDisplay.SessionDir.get(), autologinSession)) {
             sessionType = Session::X11Session;
-        } else if (findSessionEntry(mainConfig.Wayland.SessionDir.get(), autologinSession)) {
+        } else if (findSessionEntry(mainConfig.WaylandDisplay.SessionDir.get(), autologinSession)) {
             sessionType = Session::WaylandSession;
         } else {
             qCritical() << "Unable to find autologin session entry" << autologinSession;
diff --git a/src/daemon/Seat.cpp b/src/daemon/Seat.cpp
index 3ef1b2f..915d619 100644
--- a/src/daemon/Seat.cpp
+++ b/src/daemon/Seat.cpp
@@ -57,7 +57,7 @@ namespace SDDM {
         
         if (terminalId == -1) {
                 // find unused terminal
-            terminalId = findUnused(mainConfig.X11.MinimumVT.get(), [&](const int number) {
+            terminalId = findUnused(mainConfig.XDisplay.MinimumVT.get(), [&](const int number) {
                 return m_terminalIds.contains(number);
             });
         }
diff --git a/src/daemon/XorgDisplayServer.cpp b/src/daemon/XorgDisplayServer.cpp
index d06d89a..a7e8436 100644
--- a/src/daemon/XorgDisplayServer.cpp
+++ b/src/daemon/XorgDisplayServer.cpp
@@ -95,7 +95,7 @@ namespace SDDM {
         file_handler.open(QIODevice::WriteOnly);
         file_handler.close();
 
-        QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.X11.XauthPath.get()).arg(file);
+        QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.XDisplay.XauthPath.get()).arg(file);
 
         // execute xauth
         FILE *fp = popen(qPrintable(cmd), "w");
@@ -128,7 +128,7 @@ namespace SDDM {
         if (daemonApp->testing()) {
             QStringList args;
             args << m_display << QStringLiteral("-ac") << QStringLiteral("-br") << QStringLiteral("-noreset") << QStringLiteral("-screen") << QStringLiteral("800x600");
-            process->start(mainConfig.X11.XephyrPath.get(), args);
+            process->start(mainConfig.XDisplay.XephyrPath.get(), args);
 
 
             // wait for display server to start
@@ -154,16 +154,16 @@ namespace SDDM {
             }
 
             // start display server
-            QStringList args = mainConfig.X11.ServerArguments.get().split(QLatin1Char(' '), QString::SkipEmptyParts);
+            QStringList args = mainConfig.XDisplay.ServerArguments.get().split(QLatin1Char(' '), QString::SkipEmptyParts);
             args << QStringLiteral("-auth") << m_authPath
                  << QStringLiteral("-background") << QStringLiteral("none")
                  << QStringLiteral("-noreset")
                  << QStringLiteral("-displayfd") << QString::number(pipeFds[1])
                  << QStringLiteral("vt%1").arg(displayPtr()->terminalId());
             qDebug() << "Running:"
-                     << qPrintable(mainConfig.X11.ServerPath.get())
+                     << qPrintable(mainConfig.XDisplay.ServerPath.get())
                      << qPrintable(args.join(QLatin1Char(' ')));
-            process->start(mainConfig.X11.ServerPath.get(), args);
+            process->start(mainConfig.XDisplay.ServerPath.get(), args);
 
             // wait for display server to start
             if (!process->waitForStarted()) {
@@ -236,7 +236,7 @@ namespace SDDM {
         // log message
         qDebug() << "Display server stopped.";
 
-        QString displayStopCommand = mainConfig.X11.DisplayStopCommand.get();
+        QString displayStopCommand = mainConfig.XDisplay.DisplayStopCommand.get();
 
         // create display setup script process
         QProcess *displayStopScript = new QProcess();
@@ -273,7 +273,7 @@ namespace SDDM {
     }
 
     void XorgDisplayServer::setupDisplay() {
-        QString displayCommand = mainConfig.X11.DisplayCommand.get();
+        QString displayCommand = mainConfig.XDisplay.DisplayCommand.get();
 
         // create display setup script process
         QProcess *displayScript = new QProcess();
diff --git a/src/greeter/SessionModel.cpp b/src/greeter/SessionModel.cpp
index d3ace84..7d690fb 100644
--- a/src/greeter/SessionModel.cpp
+++ b/src/greeter/SessionModel.cpp
@@ -41,8 +41,8 @@ namespace SDDM {
     SessionModel::SessionModel(QObject *parent) : QAbstractListModel(parent), d(new SessionModelPrivate()) {
         // initial population
         beginResetModel();
-        populate(Session::X11Session, mainConfig.X11.SessionDir.get());
-        populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get());
+        populate(Session::X11Session, mainConfig.XDisplay.SessionDir.get());
+        populate(Session::WaylandSession, mainConfig.WaylandDisplay.SessionDir.get());
         endResetModel();
 
         // refresh everytime a file is changed, added or removed
@@ -50,12 +50,12 @@ namespace SDDM {
         connect(watcher, &QFileSystemWatcher::directoryChanged, [this](const QString &path) {
             beginResetModel();
             d->sessions.clear();
-            populate(Session::X11Session, mainConfig.X11.SessionDir.get());
-            populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get());
+            populate(Session::X11Session, mainConfig.XDisplay.SessionDir.get());
+            populate(Session::WaylandSession, mainConfig.WaylandDisplay.SessionDir.get());
             endResetModel();
         });
-        watcher->addPath(mainConfig.X11.SessionDir.get());
-        watcher->addPath(mainConfig.Wayland.SessionDir.get());
+        watcher->addPath(mainConfig.XDisplay.SessionDir.get());
+        watcher->addPath(mainConfig.WaylandDisplay.SessionDir.get());
     }
 
     SessionModel::~SessionModel() {
diff --git a/src/helper/Backend.cpp b/src/helper/Backend.cpp
index d6bb4d0..7195ddc 100644
--- a/src/helper/Backend.cpp
+++ b/src/helper/Backend.cpp
@@ -67,7 +67,7 @@ namespace SDDM {
                 // determine Xauthority path
                 QString value = QStringLiteral("%1/%2")
                         .arg(QString::fromLocal8Bit(pw->pw_dir))
-                        .arg(mainConfig.X11.UserAuthFile.get());
+                        .arg(mainConfig.XDisplay.UserAuthFile.get());
                 env.insert(QStringLiteral("XAUTHORITY"), value);
             }
             // TODO: I'm fairly sure this shouldn't be done for PAM sessions, investigate!
diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp
index fc10366..d7b93a8 100644
--- a/src/helper/UserSession.cpp
+++ b/src/helper/UserSession.cpp
@@ -46,11 +46,11 @@ namespace SDDM {
         if (env.value(QStringLiteral("XDG_SESSION_CLASS")) == QStringLiteral("greeter")) {
             QProcess::start(m_path);
         } else if (env.value(QStringLiteral("XDG_SESSION_TYPE")) == QStringLiteral("x11")) {
-            const QString cmd = QStringLiteral("%1 %2").arg(mainConfig.X11.SessionCommand.get()).arg(m_path);
+            const QString cmd = QStringLiteral("%1 %2").arg(mainConfig.XDisplay.SessionCommand.get()).arg(m_path);
             qInfo() << "Starting:" << cmd;
             QProcess::start(cmd);
         } else if (env.value(QStringLiteral("XDG_SESSION_TYPE")) == QStringLiteral("wayland")) {
-            const QString cmd = QStringLiteral("%1 %2").arg(mainConfig.Wayland.SessionCommand.get()).arg(m_path);
+            const QString cmd = QStringLiteral("%1 %2").arg(mainConfig.WaylandDisplay.SessionCommand.get()).arg(m_path);
             qInfo() << "Starting:" << cmd;
             QProcess::start(cmd);
         } else {
@@ -135,8 +135,8 @@ namespace SDDM {
         QString sessionLog = QStringLiteral("%1/%2")
                 .arg(QString::fromLocal8Bit(pw->pw_dir))
                 .arg(sessionType == QStringLiteral("x11")
-                     ? mainConfig.X11.SessionLogFile.get()
-                     : mainConfig.Wayland.SessionLogFile.get());
+                     ? mainConfig.XDisplay.SessionLogFile.get()
+                     : mainConfig.WaylandDisplay.SessionLogFile.get());
 
         // create the path
         QFileInfo finfo(sessionLog);
@@ -180,7 +180,7 @@ namespace SDDM {
             file_handler.open(QIODevice::WriteOnly);
             file_handler.close();
 
-            QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.X11.XauthPath.get()).arg(file);
+            QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.XDisplay.XauthPath.get()).arg(file);
 
             // execute xauth
             FILE *fp = popen(qPrintable(cmd), "w");
-- 
2.9.3

openSUSE Build Service is sponsored by