diff --git a/autotests/test_builtin_effectloader.cpp b/autotests/test_builtin_effectloader.cpp index cf6a1219a5..ce5e3079f4 100644 --- a/autotests/test_builtin_effectloader.cpp +++ b/autotests/test_builtin_effectloader.cpp @@ -28,6 +28,7 @@ along with this program. If not, see . // Qt #include #include +#include Q_DECLARE_METATYPE(KWin::CompositingType) Q_DECLARE_METATYPE(KWin::LoadEffectFlag) Q_DECLARE_METATYPE(KWin::LoadEffectFlags) @@ -362,7 +363,7 @@ void TestBuiltInEffectLoader::testLoadEffect() QFETCH(bool, expected); QFETCH(KWin::CompositingType, type); - MockEffectsHandler mockHandler(type); + QScopedPointer mockHandler(new MockEffectsHandler(type)); KWin::BuiltInEffectLoader loader; KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); loader.setConfig(config); @@ -451,7 +452,7 @@ void TestBuiltInEffectLoader::testLoadBuiltInEffect() QFETCH(KWin::CompositingType, type); QFETCH(KWin::LoadEffectFlags, loadFlags); - MockEffectsHandler mockHandler(type); + QScopedPointer mockHandler(new MockEffectsHandler(type)); KWin::BuiltInEffectLoader loader; KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); loader.setConfig(config); @@ -498,7 +499,7 @@ void TestBuiltInEffectLoader::testLoadBuiltInEffect() void TestBuiltInEffectLoader::testLoadAllEffects() { - MockEffectsHandler mockHandler(KWin::XRenderCompositing); + QScopedPointermockHandler(new MockEffectsHandler(KWin::XRenderCompositing)); KWin::BuiltInEffectLoader loader; KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/test_plugin_effectloader.cpp b/autotests/test_plugin_effectloader.cpp index 841c9bf5cd..05752449a5 100644 --- a/autotests/test_plugin_effectloader.cpp +++ b/autotests/test_plugin_effectloader.cpp @@ -201,7 +201,7 @@ void TestPluginEffectLoader::testLoadEffect() QFETCH(bool, expected); QFETCH(KWin::CompositingType, type); - MockEffectsHandler mockHandler(type); + QScopedPointer mockHandler(new MockEffectsHandler(type)); KWin::PluginEffectLoader loader; loader.setPluginSubDirectory(QString()); KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); @@ -285,8 +285,8 @@ void TestPluginEffectLoader::testLoadPluginEffect() QFETCH(KWin::LoadEffectFlags, loadFlags); QFETCH(bool, enabledByDefault); - MockEffectsHandler mockHandler(type); - mockHandler.setProperty("testEnabledByDefault", enabledByDefault); + QScopedPointer mockHandler(new MockEffectsHandler(type)); + mockHandler->setProperty("testEnabledByDefault", enabledByDefault); KWin::PluginEffectLoader loader; loader.setPluginSubDirectory(QString()); KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); @@ -341,8 +341,8 @@ void TestPluginEffectLoader::testLoadPluginEffect() void TestPluginEffectLoader::testLoadAllEffects() { - MockEffectsHandler mockHandler(KWin::OpenGL2Compositing); - mockHandler.setProperty("testEnabledByDefault", true); + QScopedPointer mockHandler(new MockEffectsHandler(KWin::OpenGL2Compositing)); + mockHandler->setProperty("testEnabledByDefault", true); KWin::PluginEffectLoader loader; loader.setPluginSubDirectory(QString()); diff --git a/autotests/test_scripted_effectloader.cpp b/autotests/test_scripted_effectloader.cpp index c7aef31c7a..f1a729d98b 100644 --- a/autotests/test_scripted_effectloader.cpp +++ b/autotests/test_scripted_effectloader.cpp @@ -159,7 +159,7 @@ void TestScriptedEffectLoader::testHasEffect() QFETCH(QString, name); QFETCH(bool, expected); - MockEffectsHandler mockHandler(KWin::XRenderCompositing); + QScopedPointer mockHandler(new MockEffectsHandler(KWin::XRenderCompositing)); KWin::ScriptedEffectLoader loader; QCOMPARE(loader.hasEffect(name), expected); @@ -167,7 +167,7 @@ void TestScriptedEffectLoader::testHasEffect() QCOMPARE(loader.isEffectSupported(name), expected); if (expected) { - mockHandler.setAnimationsSupported(false); + mockHandler->setAnimationsSupported(false); QVERIFY(!loader.isEffectSupported(name)); } } @@ -216,7 +216,7 @@ void TestScriptedEffectLoader::testLoadEffect() QFETCH(QString, name); QFETCH(bool, expected); - MockEffectsHandler mockHandler(KWin::XRenderCompositing); + QScopedPointer mockHandler(new MockEffectsHandler(KWin::XRenderCompositing)); KWin::ScriptedEffectLoader loader; KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); loader.setConfig(config); @@ -289,7 +289,7 @@ void TestScriptedEffectLoader::testLoadScriptedEffect() QFETCH(bool, expected); QFETCH(KWin::LoadEffectFlags, loadFlags); - MockEffectsHandler mockHandler(KWin::XRenderCompositing); + QScopedPointer mockHandler(new MockEffectsHandler(KWin::XRenderCompositing)); KWin::ScriptedEffectLoader loader; KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); loader.setConfig(config); @@ -343,7 +343,7 @@ void TestScriptedEffectLoader::testLoadScriptedEffect() void TestScriptedEffectLoader::testLoadAllEffects() { - MockEffectsHandler mockHandler(KWin::XRenderCompositing); + QScopedPointer mockHandler(new MockEffectsHandler(KWin::XRenderCompositing)); KWin::ScriptedEffectLoader loader; KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);