Commit a2083bb2 authored by Fabian Vogt's avatar Fabian Vogt

Merge branch 'Plasma/5.12'

parents a6163b57 c879e4fa
set(SDDM_CONFIG_FILE "/etc/sddm.conf" CACHE PATH "Path of the sddm config file")
set(SDDM_CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf" CACHE PATH "Path of the sddm config file")
set(SDDM_CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf.d" CACHE PATH "Path of the sddm config directory")
set(SDDM_SYSTEM_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d" CACHE PATH "Path of the system sddm config directory")
configure_file(config.h.in config.h IMMEDIATE @ONLY)
# add_subdirectory(configwidgets)
......
......@@ -33,11 +33,10 @@
const int MIN_UID = 1000;
const int MAX_UID = 65000;
AdvanceConfig::AdvanceConfig(QWidget *parent) :
QWidget(parent)
AdvanceConfig::AdvanceConfig(const KSharedConfigPtr &config, QWidget *parent) :
QWidget(parent),
mConfig(config)
{
mConfig = KSharedConfig::openConfig(SDDM_CONFIG_FILE, KConfig::SimpleConfig);
configUi = new Ui::AdvanceConfig();
configUi->setupUi(this);
......
......@@ -34,7 +34,7 @@ class AdvanceConfig : public QWidget
{
Q_OBJECT
public:
explicit AdvanceConfig(QWidget *parent = 0);
explicit AdvanceConfig(const KSharedConfigPtr &config, QWidget *parent = 0);
~AdvanceConfig();
QVariantMap save();
......
......@@ -2,5 +2,7 @@
#define CONFIG_H
#define SDDM_CONFIG_FILE "@SDDM_CONFIG_FILE@"
#define SDDM_CONFIG_DIR "@SDDM_CONFIG_DIR@"
#define SDDM_SYSTEM_CONFIG_DIR "@SDDM_SYSTEM_CONFIG_DIR@"
#endif //CONFIG_H
......@@ -306,11 +306,6 @@ void CursorThemeModel::processThemeDir(const QDir &themeDir)
if (!themeDir.exists("index.theme") && !haveCursors)
return;
static bool isX11 = QX11Info::isPlatformX11();
if (!isX11) {
// TODO: implement Wayland Cursor Theme support
return;
}
// Create a cursor theme object for the theme dir
XCursorTheme *theme = new XCursorTheme(themeDir);
......
......@@ -158,6 +158,9 @@ int XCursorTheme::autodetectCursorSize() const
int size = 0;
int dpi = 0;
Display *dpy = QX11Info::display();
// Fallback on wayland
if (!dpy)
return 24;
// The string "v" is owned and will be destroyed by Xlib
char *v = XGetDefault(dpy, "Xft", "dpi");
if (v)
......
......@@ -16,6 +16,9 @@
*/
#include "sddmkcm.h"
#include <algorithm>
#include <QDir>
#include <QHBoxLayout>
#include <QTabWidget>
......@@ -55,6 +58,18 @@ SddmKcm::SddmKcm(QWidget *parent, const QVariantList &args) :
setAboutData(aboutData);
setNeedsAuthorization(true);
mSddmConfig = KSharedConfig::openConfig(SDDM_CONFIG_FILE, KConfig::CascadeConfig);
// This does not listen for new config files in the directory.
QStringList configFiles = QDir(SDDM_CONFIG_DIR).entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware),
systemConfigFiles = QDir(SDDM_SYSTEM_CONFIG_DIR).entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware);
std::transform(systemConfigFiles.begin(), systemConfigFiles.end(), systemConfigFiles.begin(),
[](const QString &filename) { return QStringLiteral(SDDM_SYSTEM_CONFIG_DIR "/") + filename; });
std::transform(configFiles.begin(), configFiles.end(), configFiles.begin(),
[](const QString &filename) { return QStringLiteral(SDDM_CONFIG_DIR "/") + filename; });
mSddmConfig->addConfigSources(systemConfigFiles + configFiles);
prepareUi();
}
......@@ -101,12 +116,12 @@ void SddmKcm::prepareUi()
QTabWidget* tabHolder = new QTabWidget(this);
layout->addWidget(tabHolder);
mThemeConfig = new ThemeConfig(this);
mThemeConfig = new ThemeConfig(mSddmConfig, this);
connect(mThemeConfig, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
tabHolder->addTab(mThemeConfig, i18n("Theme"));
mAdvanceConfig = new AdvanceConfig(this);
mAdvanceConfig = new AdvanceConfig(mSddmConfig, this);
connect(mAdvanceConfig, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
tabHolder->addTab(mAdvanceConfig, i18n("Advanced"));
......
......@@ -18,6 +18,7 @@
#define SDDMKCM_H
#include <KCModule>
#include <KSharedConfig>
class ThemeConfig;
class AdvanceConfig;
......@@ -36,6 +37,7 @@ private:
void prepareUi();
private:
KSharedConfigPtr mSddmConfig;
ThemeConfig *mThemeConfig;
AdvanceConfig *mAdvanceConfig;
};
......
......@@ -37,11 +37,10 @@
#include "config.h"
ThemeConfig::ThemeConfig(QWidget *parent) :
QWidget(parent)
ThemeConfig::ThemeConfig(const KSharedConfigPtr &config, QWidget *parent) :
QWidget(parent),
mConfig(config)
{
mConfig = KSharedConfig::openConfig(SDDM_CONFIG_FILE, KConfig::SimpleConfig);
configUi = new Ui::ThemeConfig();
configUi->setupUi(this);
configUi->messageWidget->setVisible(false);
......
......@@ -31,7 +31,7 @@ class ThemeConfig : public QWidget
{
Q_OBJECT
public:
explicit ThemeConfig(QWidget *parent = 0);
explicit ThemeConfig(const KSharedConfigPtr &config, QWidget *parent = 0);
~ThemeConfig();
QVariantMap save();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment