Commit 3a480556 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port from KDeclarative::ConfigPropertyMap to KConfigPropertyMap

parent a63c673e
Pipeline #139150 passed with stage
in 4 minutes and 38 seconds
......@@ -6,7 +6,7 @@ set(PROJECT_VERSION "5.24.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.86")
set(KF5_MIN_VERSION "5.89")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
set(CMAKE_CXX_STANDARD 17)
......
......@@ -33,8 +33,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// KDE
#include <KAuthorized>
#include <KConfigPropertyMap>
#include <KCrash>
#include <KDeclarative/ConfigPropertyMap>
#include <KDeclarative/KQuickAddons/QuickViewSharedEngine>
#include <KDeclarative/QmlObjectSharedEngine>
#include <KWindowSystem>
......
......@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KAboutData>
#include <KConfigLoader>
#include <KDeclarative/ConfigPropertyMap>
#include <KConfigPropertyMap>
#include <KGlobalAccel>
#include <KLocalizedString>
#include <KPluginFactory>
......@@ -50,7 +50,7 @@ ScreenLockerKcm::ScreenLockerKcm(QObject *parent, const QVariantList &args)
qmlRegisterAnonymousType<KScreenSaverSettings>(url, 1);
qmlRegisterAnonymousType<WallpaperInfo>(url, 1);
qmlRegisterAnonymousType<ScreenLocker::WallpaperIntegration>(url, 1);
qmlRegisterAnonymousType<KDeclarative::ConfigPropertyMap>(url, 1);
qmlRegisterAnonymousType<KConfigPropertyMap>(url, 1);
qmlProtectModule(url, 1);
KAboutData *about = new KAboutData(QStringLiteral("kcm_screenlocker"), i18n("Screen Locking"), QStringLiteral("1.0"), QString(), KAboutLicense::GPL);
about->addAuthor(i18n("Martin Gräßlin"), QString(), QStringLiteral("mgraesslin@kde.org"));
......@@ -108,12 +108,12 @@ bool ScreenLockerKcm::isDefaults() const
return m_appearanceSettings->isDefaults();
}
KDeclarative::ConfigPropertyMap *ScreenLockerKcm::wallpaperConfiguration() const
KConfigPropertyMap *ScreenLockerKcm::wallpaperConfiguration() const
{
return m_appearanceSettings->wallpaperConfiguration();
}
KDeclarative::ConfigPropertyMap *ScreenLockerKcm::lnfConfiguration() const
KConfigPropertyMap *ScreenLockerKcm::lnfConfiguration() const
{
return m_appearanceSettings->lnfConfiguration();
}
......
......@@ -35,10 +35,7 @@ class WallpaperIntegration;
class LnFIntegration;
}
namespace KDeclarative
{
class ConfigPropertyMap;
}
class KConfigPropertyMap;
class ScreenLockerKcm : public KQuickAddons::ManagedConfigModule
{
......@@ -47,8 +44,8 @@ public:
explicit ScreenLockerKcm(QObject *parent = nullptr, const QVariantList &args = QVariantList());
Q_PROPERTY(KScreenSaverSettings *settings READ settings CONSTANT)
Q_PROPERTY(KDeclarative::ConfigPropertyMap *wallpaperConfiguration READ wallpaperConfiguration NOTIFY currentWallpaperChanged)
Q_PROPERTY(KDeclarative::ConfigPropertyMap *lnfConfiguration READ lnfConfiguration CONSTANT)
Q_PROPERTY(KConfigPropertyMap *wallpaperConfiguration READ wallpaperConfiguration NOTIFY currentWallpaperChanged)
Q_PROPERTY(KConfigPropertyMap *lnfConfiguration READ lnfConfiguration CONSTANT)
Q_PROPERTY(QUrl lnfConfigFile READ lnfConfigFile CONSTANT)
Q_PROPERTY(QUrl wallpaperConfigFile READ wallpaperConfigFile NOTIFY currentWallpaperChanged)
Q_PROPERTY(ScreenLocker::WallpaperIntegration *wallpaperIntegration READ wallpaperIntegration NOTIFY currentWallpaperChanged)
......@@ -81,8 +78,8 @@ private:
bool isSaveNeeded() const override;
bool isDefaults() const override;
KDeclarative::ConfigPropertyMap *wallpaperConfiguration() const;
KDeclarative::ConfigPropertyMap *lnfConfiguration() const;
KConfigPropertyMap *wallpaperConfiguration() const;
KConfigPropertyMap *lnfConfiguration() const;
AppearanceSettings *m_appearanceSettings;
QString m_currentWallpaper;
......
......@@ -7,7 +7,7 @@ add_library(settings STATIC
kconfig_add_kcfg_files(settings GENERATE_MOC kscreensaversettingsbase.kcfgc)
target_link_libraries(settings
KF5::ConfigWidgets
KF5::Declarative
KF5::ConfigQml
KF5::GlobalAccel
KF5::I18n
KF5::Package
......
......@@ -41,7 +41,7 @@ QUrl AppearanceSettings::wallpaperConfigFile() const
return m_wallpaperConfigFile;
}
KDeclarative::ConfigPropertyMap *AppearanceSettings::wallpaperConfiguration() const
KConfigPropertyMap *AppearanceSettings::wallpaperConfiguration() const
{
if (!m_wallpaperIntegration) {
return nullptr;
......@@ -49,7 +49,7 @@ KDeclarative::ConfigPropertyMap *AppearanceSettings::wallpaperConfiguration() co
return m_wallpaperIntegration->configuration();
}
KDeclarative::ConfigPropertyMap *AppearanceSettings::lnfConfiguration() const
KConfigPropertyMap *AppearanceSettings::lnfConfiguration() const
{
if (!m_lnfIntegration) {
return nullptr;
......
......@@ -31,10 +31,7 @@ class WallpaperIntegration;
class LnFIntegration;
}
namespace KDeclarative
{
class ConfigPropertyMap;
}
class KConfigPropertyMap;
class AppearanceSettings : public QObject
{
......@@ -46,8 +43,8 @@ public:
QUrl lnfConfigFile() const;
QUrl wallpaperConfigFile() const;
KDeclarative::ConfigPropertyMap *wallpaperConfiguration() const;
KDeclarative::ConfigPropertyMap *lnfConfiguration() const;
KConfigPropertyMap *wallpaperConfiguration() const;
KConfigPropertyMap *lnfConfiguration() const;
ScreenLocker::WallpaperIntegration *wallpaperIntegration() const;
......
......@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KConfig>
#include <KConfigGroup>
#include <KConfigLoader>
#include <KDeclarative/ConfigPropertyMap>
#include <KConfigPropertyMap>
#include <QFile>
......@@ -35,7 +35,7 @@ namespace ScreenLocker
LnFIntegration::LnFIntegration(QObject *parent)
: QObject(parent)
{
qRegisterMetaType<KDeclarative::ConfigPropertyMap *>();
qRegisterMetaType<KConfigPropertyMap *>();
}
LnFIntegration::~LnFIntegration() = default;
......@@ -46,8 +46,7 @@ void LnFIntegration::init()
return;
}
if (auto config = configScheme()) {
m_configuration = new KDeclarative::ConfigPropertyMap(config, this);
m_configuration->setAutosave(false);
m_configuration = new KConfigPropertyMap(config, this);
}
}
......
......@@ -28,11 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KSharedConfig>
class KConfigLoader;
namespace KDeclarative
{
class ConfigPropertyMap;
}
class KConfigPropertyMap;
namespace ScreenLocker
{
......@@ -40,7 +36,7 @@ class LnFIntegration : public QObject
{
Q_OBJECT
Q_PROPERTY(KDeclarative::ConfigPropertyMap *configuration READ configuration NOTIFY configurationChanged)
Q_PROPERTY(KConfigPropertyMap *configuration READ configuration NOTIFY configurationChanged)
public:
explicit LnFIntegration(QObject *parent);
......@@ -63,7 +59,7 @@ public:
return m_package;
}
KDeclarative::ConfigPropertyMap *configuration() const
KConfigPropertyMap *configuration() const
{
return m_configuration;
}
......@@ -78,7 +74,7 @@ private:
KPackage::Package m_package;
KSharedConfig::Ptr m_config;
KConfigLoader *m_configLoader = nullptr;
KDeclarative::ConfigPropertyMap *m_configuration = nullptr;
KConfigPropertyMap *m_configuration = nullptr;
};
}
......
......@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KConfig>
#include <KConfigGroup>
#include <KConfigLoader>
#include <KDeclarative/ConfigPropertyMap>
#include <KConfigPropertyMap>
#include <KPackage/PackageLoader>
#include <QFile>
......@@ -36,7 +36,7 @@ WallpaperIntegration::WallpaperIntegration(QObject *parent)
: QObject(parent)
, m_package(KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/Wallpaper")))
{
qRegisterMetaType<KDeclarative::ConfigPropertyMap *>();
qRegisterMetaType<KConfigPropertyMap *>();
}
WallpaperIntegration::~WallpaperIntegration() = default;
......@@ -47,8 +47,7 @@ void WallpaperIntegration::init()
return;
}
if (auto config = configScheme()) {
m_configuration = new KDeclarative::ConfigPropertyMap(config, this);
m_configuration->setAutosave(false);
m_configuration = new KConfigPropertyMap(config, this);
// potd (picture of the day) is using a kded to monitor changes and
// cache data for the lockscreen. Let's notify it.
m_configuration->setNotify(true);
......
......@@ -23,16 +23,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KSCREENLOCKER_WALLPAPER_INTEGRATION_H
#define KSCREENLOCKER_WALLPAPER_INTEGRATION_H
#include <KConfigPropertyMap>
#include <KPackage/Package>
#include <KSharedConfig>
class KConfigLoader;
namespace KDeclarative
{
class ConfigPropertyMap;
}
namespace ScreenLocker
{
class WallpaperIntegration : public QObject
......@@ -40,7 +36,7 @@ class WallpaperIntegration : public QObject
Q_OBJECT
Q_PROPERTY(QString pluginName READ pluginName NOTIFY packageChanged)
Q_PROPERTY(KDeclarative::ConfigPropertyMap *configuration READ configuration NOTIFY configurationChanged)
Q_PROPERTY(KConfigPropertyMap *configuration READ configuration NOTIFY configurationChanged)
public:
explicit WallpaperIntegration(QObject *parent);
......@@ -63,7 +59,7 @@ public:
return m_package;
}
KDeclarative::ConfigPropertyMap *configuration() const
KConfigPropertyMap *configuration() const
{
return m_configuration;
}
......@@ -79,7 +75,7 @@ private:
KPackage::Package m_package;
KSharedConfig::Ptr m_config;
KConfigLoader *m_configLoader = nullptr;
KDeclarative::ConfigPropertyMap *m_configuration = nullptr;
KConfigPropertyMap *m_configuration = nullptr;
};
}
......
Supports Markdown
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