aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <[email protected]>2016-11-16 08:13:38 +0100
committerMartin Gräßlin <[email protected]>2016-11-16 13:04:44 +0100
commit10f641d5d969136c5adcf73eda36795661ce7247 (patch)
tree31e14dbb269be834a06d352f5b4dde4bf14a920f
parentfeac312ee02039de2fa5f372d595612a3d17600d (diff)
[effects] Introduce kcfg for FallApart effect
Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3374
-rw-r--r--effects/CMakeLists.txt1
-rw-r--r--effects/fallapart/fallapart.cpp7
-rw-r--r--effects/fallapart/fallapart.kcfg14
-rw-r--r--effects/fallapart/fallapartconfig.kcfgc5
4 files changed, 24 insertions, 3 deletions
diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt
index f67d776..263d77a 100644
--- a/effects/CMakeLists.txt
+++ b/effects/CMakeLists.txt
@@ -106,6 +106,7 @@ kconfig_add_kcfg_files(kwin4_effect_builtins_sources
coverswitch/coverswitchconfig.kcfgc
desktopgrid/desktopgridconfig.kcfgc
diminactive/diminactiveconfig.kcfgc
+ fallapart/fallapartconfig.kcfgc
flipswitch/flipswitchconfig.kcfgc
glide/glideconfig.kcfgc
lookingglass/lookingglassconfig.kcfgc
diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp
index 260a32b..011b131 100644
--- a/effects/fallapart/fallapart.cpp
+++ b/effects/fallapart/fallapart.cpp
@@ -19,9 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "fallapart.h"
+// KConfigSkeleton
+#include "fallapartconfig.h"
#include <assert.h>
#include <math.h>
-#include <KConfigGroup>
namespace KWin
{
@@ -40,8 +41,8 @@ FallApartEffect::FallApartEffect()
void FallApartEffect::reconfigure(ReconfigureFlags)
{
- KConfigGroup conf = effects->effectConfig(QStringLiteral("FallApart"));
- blockSize = qBound(1, conf.readEntry("BlockSize", 40), 100000);
+ FallApartConfig::self()->read();
+ blockSize = FallApartConfig::blockSize();
}
void FallApartEffect::prePaintScreen(ScreenPrePaintData& data, int time)
diff --git a/effects/fallapart/fallapart.kcfg b/effects/fallapart/fallapart.kcfg
new file mode 100644
index 0000000..5f53185
--- /dev/null
+++ b/effects/fallapart/fallapart.kcfg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="kwinrc"/>
+ <group name="Effect-FallApart">
+ <entry name="BlockSize" type="Int">
+ <default>40</default>
+ <min>1</min>
+ <max>100000</max>
+ </entry>
+ </group>
+</kcfg>
diff --git a/effects/fallapart/fallapartconfig.kcfgc b/effects/fallapart/fallapartconfig.kcfgc
new file mode 100644
index 0000000..1735fb7
--- /dev/null
+++ b/effects/fallapart/fallapartconfig.kcfgc
@@ -0,0 +1,5 @@
+File=fallapart.kcfg
+ClassName=FallApartConfig
+NameSpace=KWin
+Singleton=true
+Mutators=true