Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KScreenLocker
Commits
3a480556
Commit
3a480556
authored
Dec 26, 2021
by
Alexander Lohnau
💬
Browse files
Port from KDeclarative::ConfigPropertyMap to KConfigPropertyMap
parent
a63c673e
Pipeline
#139150
passed with stage
in 4 minutes and 38 seconds
Changes
11
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
3a480556
...
...
@@ -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.8
6
"
)
set
(
KF5_MIN_VERSION
"5.8
9
"
)
set
(
KDE_COMPILERSETTINGS_LEVEL
"5.82"
)
set
(
CMAKE_CXX_STANDARD 17
)
...
...
greeter/greeterapp.cpp
View file @
3a480556
...
...
@@ -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>
...
...
kcm/kcm.cpp
View file @
3a480556
...
...
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include
<KAboutData>
#include
<KConfigLoader>
#include
<K
Declarative/
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
<
K
Declarative
::
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
();
}
K
Declarative
::
ConfigPropertyMap
*
ScreenLockerKcm
::
wallpaperConfiguration
()
const
KConfigPropertyMap
*
ScreenLockerKcm
::
wallpaperConfiguration
()
const
{
return
m_appearanceSettings
->
wallpaperConfiguration
();
}
K
Declarative
::
ConfigPropertyMap
*
ScreenLockerKcm
::
lnfConfiguration
()
const
KConfigPropertyMap
*
ScreenLockerKcm
::
lnfConfiguration
()
const
{
return
m_appearanceSettings
->
lnfConfiguration
();
}
...
...
kcm/kcm.h
View file @
3a480556
...
...
@@ -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
(
K
Declarative
::
ConfigPropertyMap
*
wallpaperConfiguration
READ
wallpaperConfiguration
NOTIFY
currentWallpaperChanged
)
Q_PROPERTY
(
K
Declarative
::
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
;
K
Declarative
::
ConfigPropertyMap
*
wallpaperConfiguration
()
const
;
K
Declarative
::
ConfigPropertyMap
*
lnfConfiguration
()
const
;
KConfigPropertyMap
*
wallpaperConfiguration
()
const
;
KConfigPropertyMap
*
lnfConfiguration
()
const
;
AppearanceSettings
*
m_appearanceSettings
;
QString
m_currentWallpaper
;
...
...
settings/CMakeLists.txt
View file @
3a480556
...
...
@@ -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
...
...
settings/appearancesettings.cpp
View file @
3a480556
...
...
@@ -41,7 +41,7 @@ QUrl AppearanceSettings::wallpaperConfigFile() const
return
m_wallpaperConfigFile
;
}
K
Declarative
::
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
();
}
K
Declarative
::
ConfigPropertyMap
*
AppearanceSettings
::
lnfConfiguration
()
const
KConfigPropertyMap
*
AppearanceSettings
::
lnfConfiguration
()
const
{
if
(
!
m_lnfIntegration
)
{
return
nullptr
;
...
...
settings/appearancesettings.h
View file @
3a480556
...
...
@@ -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
;
K
Declarative
::
ConfigPropertyMap
*
wallpaperConfiguration
()
const
;
K
Declarative
::
ConfigPropertyMap
*
lnfConfiguration
()
const
;
KConfigPropertyMap
*
wallpaperConfiguration
()
const
;
KConfigPropertyMap
*
lnfConfiguration
()
const
;
ScreenLocker
::
WallpaperIntegration
*
wallpaperIntegration
()
const
;
...
...
settings/lnf_integration.cpp
View file @
3a480556
...
...
@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include
<KConfig>
#include
<KConfigGroup>
#include
<KConfigLoader>
#include
<K
Declarative/
ConfigPropertyMap>
#include
<KConfigPropertyMap>
#include
<QFile>
...
...
@@ -35,7 +35,7 @@ namespace ScreenLocker
LnFIntegration
::
LnFIntegration
(
QObject
*
parent
)
:
QObject
(
parent
)
{
qRegisterMetaType
<
K
Declarative
::
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
);
}
}
...
...
settings/lnf_integration.h
View file @
3a480556
...
...
@@ -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
(
K
Declarative
::
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
;
}
K
Declarative
::
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
;
K
Declarative
::
ConfigPropertyMap
*
m_configuration
=
nullptr
;
KConfigPropertyMap
*
m_configuration
=
nullptr
;
};
}
...
...
settings/wallpaper_integration.cpp
View file @
3a480556
...
...
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include
<KConfig>
#include
<KConfigGroup>
#include
<KConfigLoader>
#include
<K
Declarative/
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
<
K
Declarative
::
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
);
...
...
settings/wallpaper_integration.h
View file @
3a480556
...
...
@@ -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
(
K
Declarative
::
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
;
}
K
Declarative
::
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
;
K
Declarative
::
ConfigPropertyMap
*
m_configuration
=
nullptr
;
KConfigPropertyMap
*
m_configuration
=
nullptr
;
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment