[effects] Introduce kcfg for FallApart effect

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3374
icc-effect-5.14.5
Martin Gräßlin 2016-11-16 08:13:38 +01:00
parent feac312ee0
commit 10f641d5d9
4 changed files with 24 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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>

View File

@ -0,0 +1,5 @@
File=fallapart.kcfg
ClassName=FallApartConfig
NameSpace=KWin
Singleton=true
Mutators=true