Port Sheet effect to KConfigXT

REVIEW: 109220
This commit is contained in:
Martin Gräßlin 2013-03-01 11:00:11 +01:00
parent 7588890bca
commit b4c8311ace
4 changed files with 21 additions and 3 deletions

View file

@ -5,6 +5,7 @@
set( kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources}
sheet/sheet.cpp
)
kde4_add_kcfg_files(kwin4_effect_builtins_sources sheet/sheetconfig.kcfgc)
# .desktop files
install( FILES

View file

@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "sheet.h"
#include "sheetconfig.h"
#include <kconfiggroup.h>
#include <QTimeLine>
#include <QGraphicsRotation>
#include <QVector3D>
@ -51,8 +51,8 @@ bool SheetEffect::supported()
void SheetEffect::reconfigure(ReconfigureFlags)
{
KConfigGroup conf = effects->effectConfig("Sheet");
duration = animationTime(conf, "AnimationTime", 500);
SheetConfig::self()->readConfig();
duration = animationTime(SheetConfig::animationTime() != 0 ? SheetConfig::animationTime() : 500);
}
void SheetEffect::prePaintScreen(ScreenPrePaintData& data, int time)

12
effects/sheet/sheet.kcfg Normal file
View file

@ -0,0 +1,12 @@
<?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-Sheet">
<entry name="AnimationTime" type="Int">
<default>0</default>
</entry>
</group>
</kcfg>

View file

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