Drop "kwin4_effect_" prefix for BuiltIn Effects
This removes all the hacks to add kwin4_effect_ to the name of the Effect and adjusts the desktop files of the effect configuration's parent component. Note: the scripted effects still start with kwin4_effect_ prefix. REVIEW: 117367
This commit is contained in:
parent
4a1bc2ec96
commit
7fcecc616c
55 changed files with 86 additions and 112 deletions
|
@ -65,7 +65,7 @@ void TestBuiltInEffectLoader::testHasEffect_data()
|
|||
QTest::addColumn<bool>("expected");
|
||||
|
||||
QTest::newRow("blur") << QStringLiteral("blur") << true;
|
||||
QTest::newRow("with kwin4_effect_ prefix") << QStringLiteral("kwin4_effect_blur") << true;
|
||||
QTest::newRow("with kwin4_effect_ prefix") << QStringLiteral("kwin4_effect_blur") << false;
|
||||
QTest::newRow("case sensitive") << QStringLiteral("BlUR") << true;
|
||||
QTest::newRow("Contrast") << QStringLiteral("contrast") << true;
|
||||
QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << true;
|
||||
|
@ -318,7 +318,7 @@ void TestBuiltInEffectLoader::testLoadEffect_data()
|
|||
// QTest::newRow("WindowGeometry") << QStringLiteral("windowgeometry") << true << xc;
|
||||
QTest::newRow("WobblyWindows") << QStringLiteral("wobblywindows") << false << xc;
|
||||
QTest::newRow("WobblyWindows-GL") << QStringLiteral("wobblywindows") << true << oc;
|
||||
QTest::newRow("Zoom") << QStringLiteral("kwin4_effect_zoom") << true << xc;
|
||||
QTest::newRow("Zoom") << QStringLiteral("zoom") << true << xc;
|
||||
QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false << xc;
|
||||
QTest::newRow("Fade - Scripted") << QStringLiteral("fade") << false << xc;
|
||||
QTest::newRow("Fade - Scripted + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << false << xc;
|
||||
|
@ -471,26 +471,23 @@ void TestBuiltInEffectLoader::testLoadAllEffects()
|
|||
|
||||
KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
|
||||
|
||||
// TODO: remove once the KCM doesn't use this prefix
|
||||
const QString kwin4 = QStringLiteral("kwin4_effect_");
|
||||
|
||||
// prepare the configuration to hard enable/disable the effects we want to load
|
||||
KConfigGroup plugins = config->group("Plugins");
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("dashboardEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("desktopgridEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("highlightwindowEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("kscreenEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("logoutEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("minimizeanimationEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("presentwindowsEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("screenedgeEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("screenshotEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("slideEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("slidingpopupsEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("startupfeedbackEnabled"), false);
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("zoomEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("dashboardEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("desktopgridEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("highlightwindowEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("kscreenEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("logoutEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("minimizeanimationEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("presentwindowsEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("screenedgeEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("screenshotEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("slideEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("slidingpopupsEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("startupfeedbackEnabled"), false);
|
||||
plugins.writeEntry(QStringLiteral("zoomEnabled"), false);
|
||||
// enable lookingglass as it's not supported
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("lookingglassEnabled"), true);
|
||||
plugins.writeEntry(QStringLiteral("lookingglassEnabled"), true);
|
||||
plugins.sync();
|
||||
|
||||
loader.setConfig(config);
|
||||
|
@ -511,7 +508,7 @@ void TestBuiltInEffectLoader::testLoadAllEffects()
|
|||
QVERIFY(!spy.wait(10));
|
||||
|
||||
// now let's prepare a config which has one effect explicitly enabled
|
||||
plugins.writeEntry(kwin4 + QStringLiteral("mouseclickEnabled"), true);
|
||||
plugins.writeEntry(QStringLiteral("mouseclickEnabled"), true);
|
||||
plugins.sync();
|
||||
|
||||
loader.queryAndLoadAll();
|
||||
|
@ -528,7 +525,7 @@ void TestBuiltInEffectLoader::testLoadAllEffects()
|
|||
spy.clear();
|
||||
|
||||
// let's delete one of the default entries
|
||||
plugins.deleteEntry(kwin4 + QStringLiteral("kscreenEnabled"));
|
||||
plugins.deleteEntry(QStringLiteral("kscreenEnabled"));
|
||||
plugins.sync();
|
||||
|
||||
QVERIFY(spy.isEmpty());
|
||||
|
|
|
@ -110,9 +110,7 @@ void BuiltInEffectLoader::queryAndLoadAll()
|
|||
if (m_loadedEffects.contains(effect)) {
|
||||
continue;
|
||||
}
|
||||
// as long as the KCM uses kwin4_effect_ we need to add it, TODO remove
|
||||
const QString key = QStringLiteral("kwin4_effect_") +
|
||||
BuiltInEffects::nameForEffect(effect);
|
||||
const QString key = BuiltInEffects::nameForEffect(effect);
|
||||
const LoadEffectFlags flags = readConfig(key, BuiltInEffects::enabledByDefault(effect));
|
||||
if (flags.testFlag(LoadEffectFlag::Load)) {
|
||||
m_queue->enqueue(qMakePair(effect, flags));
|
||||
|
@ -175,12 +173,7 @@ bool BuiltInEffectLoader::loadEffect(const QString &name, BuiltInEffect effect,
|
|||
|
||||
QString BuiltInEffectLoader::internalName(const QString& name) const
|
||||
{
|
||||
QString internalName = name.toLower();
|
||||
// as long as the KCM uses kwin4_effect_ we need to add it, TODO remove
|
||||
if (internalName.startsWith(QStringLiteral("kwin4_effect_"))) {
|
||||
internalName = internalName.mid(13);
|
||||
}
|
||||
return internalName;
|
||||
return name.toLower();
|
||||
}
|
||||
|
||||
static const QString s_nameProperty = QStringLiteral("X-KDE-PluginInfo-Name");
|
||||
|
|
|
@ -1484,7 +1484,7 @@ bool EffectsHandlerImpl::isScreenLocked() const
|
|||
|
||||
QString EffectsHandlerImpl::debug(const QString& name, const QString& parameter) const
|
||||
{
|
||||
QString internalName = name.startsWith(QStringLiteral("kwin4_effect_")) ? name : QStringLiteral("kwin4_effect_") + name;
|
||||
QString internalName = name.toLower();;
|
||||
for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) {
|
||||
if ((*it).first == internalName) {
|
||||
return it->second->debug(parameter);
|
||||
|
|
|
@ -52,7 +52,7 @@ void BlurEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_blur"));
|
||||
interface.reconfigureEffect(QStringLiteral("blur"));
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_blur_config
|
||||
X-KDE-ParentComponents=kwin4_effect_blur
|
||||
X-KDE-ParentComponents=blur
|
||||
|
||||
Name=Blur
|
||||
Name[uk]=Розмивання
|
||||
|
|
|
@ -57,7 +57,7 @@ void CoverSwitchEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_coverswitch"));
|
||||
interface.reconfigureEffect(QStringLiteral("coverswitch"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_coverswitch_config
|
||||
X-KDE-ParentComponents=kwin4_effect_coverswitch
|
||||
X-KDE-ParentComponents=coverswitch
|
||||
|
||||
Name=Cover Switch
|
||||
Name[uk]=Перемикач обкладинок
|
||||
|
|
|
@ -94,7 +94,7 @@ void CubeEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_cube"));
|
||||
interface.reconfigureEffect(QStringLiteral("cube"));
|
||||
}
|
||||
|
||||
void CubeEffectConfig::capsSelectionChanged()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_cube_config
|
||||
X-KDE-ParentComponents=kwin4_effect_cube
|
||||
X-KDE-ParentComponents=cube
|
||||
|
||||
Name=Desktop Cube
|
||||
Name[uk]=Куб стільниць
|
||||
|
|
|
@ -59,7 +59,7 @@ void CubeSlideEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_cubeslide"));
|
||||
interface.reconfigureEffect(QStringLiteral("cubeslide"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_cubeslide_config
|
||||
X-KDE-ParentComponents=kwin4_effect_cubeslide
|
||||
X-KDE-ParentComponents=cubeslide
|
||||
|
||||
Name=Desktop Cube Animation
|
||||
Name[uk]=Анімація куба стільниць
|
||||
|
|
|
@ -53,7 +53,7 @@ void DashboardEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_dashboard"));
|
||||
interface.reconfigureEffect(QStringLiteral("dashboard"));
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_dashboard_config
|
||||
X-KDE-ParentComponents=kwin4_effect_dashboard
|
||||
X-KDE-ParentComponents=dashboard
|
||||
|
||||
Name=Dashboard
|
||||
Name[uk]=Панель приладів
|
||||
|
|
|
@ -110,7 +110,7 @@ void DesktopGridEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_desktopgrid"));
|
||||
interface.reconfigureEffect(QStringLiteral("desktopgrid"));
|
||||
}
|
||||
|
||||
void DesktopGridEffectConfig::load()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_desktopgrid_config
|
||||
X-KDE-ParentComponents=kwin4_effect_desktopgrid
|
||||
X-KDE-ParentComponents=desktopgrid
|
||||
|
||||
Name=Desktop Grid
|
||||
Name[uk]=Таблиця стільниць
|
||||
|
|
|
@ -64,7 +64,7 @@ void DimInactiveEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_diminactive"));
|
||||
interface.reconfigureEffect(QStringLiteral("diminactive"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_diminactive_config
|
||||
X-KDE-ParentComponents=kwin4_effect_diminactive
|
||||
X-KDE-ParentComponents=diminactive
|
||||
|
||||
Name=Dim Inactive
|
||||
Name[uk]=Затемнення неактивних
|
||||
|
|
|
@ -85,7 +85,7 @@ void FlipSwitchEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_flipswitch"));
|
||||
interface.reconfigureEffect(QStringLiteral("flipswitch"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_flipswitch_config
|
||||
X-KDE-ParentComponents=kwin4_effect_flipswitch
|
||||
X-KDE-ParentComponents=flipswitch
|
||||
|
||||
Name=Flip Switch
|
||||
Name[uk]=Тасування карток
|
||||
|
|
|
@ -51,7 +51,7 @@ void GlideEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_glide"));
|
||||
interface.reconfigureEffect(QStringLiteral("glide"));
|
||||
}
|
||||
} // namespace KWin
|
||||
#include "glide_config.moc"
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_glide_config
|
||||
X-KDE-ParentComponents=kwin4_effect_glide
|
||||
X-KDE-ParentComponents=glide
|
||||
|
||||
Name=Glide
|
||||
Name[uk]=Плин
|
||||
|
|
|
@ -90,7 +90,7 @@ void InvertEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_invert"));
|
||||
interface.reconfigureEffect(QStringLiteral("invert"));
|
||||
}
|
||||
|
||||
void InvertEffectConfig::defaults()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_invert_config
|
||||
X-KDE-ParentComponents=kwin4_effect_invert
|
||||
X-KDE-ParentComponents=invert
|
||||
|
||||
Name=Invert
|
||||
Name[uk]=Інверсія
|
||||
|
|
|
@ -102,7 +102,7 @@ void LookingGlassEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_lookingglass"));
|
||||
interface.reconfigureEffect(QStringLiteral("lookingglass"));
|
||||
}
|
||||
|
||||
void LookingGlassEffectConfig::defaults()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_lookingglass_config
|
||||
X-KDE-ParentComponents=kwin4_effect_lookingglass
|
||||
X-KDE-ParentComponents=lookingglass
|
||||
|
||||
Name=Looking Glass
|
||||
Name[uk]=Збільшувальне скло
|
||||
|
|
|
@ -61,7 +61,7 @@ void MagicLampEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_magiclamp"));
|
||||
interface.reconfigureEffect(QStringLiteral("magiclamp"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_magiclamp_config
|
||||
X-KDE-ParentComponents=kwin4_effect_magiclamp
|
||||
X-KDE-ParentComponents=magiclamp
|
||||
|
||||
Name=Magic Lamp
|
||||
Name[uk]=Чарівна лампа
|
||||
|
|
|
@ -103,7 +103,7 @@ void MagnifierEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_magnifier"));
|
||||
interface.reconfigureEffect(QStringLiteral("magnifier"));
|
||||
}
|
||||
|
||||
void MagnifierEffectConfig::defaults()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_magnifier_config
|
||||
X-KDE-ParentComponents=kwin4_effect_magnifier
|
||||
X-KDE-ParentComponents=magnifier
|
||||
|
||||
Name=Magnifier
|
||||
Name[uk]=Лупа
|
||||
|
|
|
@ -83,7 +83,7 @@ void MouseClickEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_mouseclick"));
|
||||
interface.reconfigureEffect(QStringLiteral("mouseclick"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_mouseclick_config
|
||||
X-KDE-ParentComponents=kwin4_effect_mouseclick
|
||||
X-KDE-ParentComponents=mouseclick
|
||||
|
||||
Name=Mouse Click Animation
|
||||
Name[uk]=Анімація за клацанням миші
|
||||
|
|
|
@ -97,7 +97,7 @@ void MouseMarkEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_mousemark"));
|
||||
interface.reconfigureEffect(QStringLiteral("mousemark"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_mousemark_config
|
||||
X-KDE-ParentComponents=kwin4_effect_mousemark
|
||||
X-KDE-ParentComponents=mousemark
|
||||
|
||||
Name=Mouse Mark
|
||||
Name[uk]=Позначки мишкою
|
||||
|
|
|
@ -101,7 +101,7 @@ void PresentWindowsEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_presentwindows"));
|
||||
interface.reconfigureEffect(QStringLiteral("presentwindows"));
|
||||
}
|
||||
|
||||
void PresentWindowsEffectConfig::defaults()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_presentwindows_config
|
||||
X-KDE-ParentComponents=kwin4_effect_presentwindows
|
||||
X-KDE-ParentComponents=presentwindows
|
||||
|
||||
Name=Present Windows
|
||||
Name[uk]=Показ вікон
|
||||
|
|
|
@ -60,7 +60,7 @@ void ResizeEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_resize"));
|
||||
interface.reconfigureEffect(QStringLiteral("resize"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_resize_config
|
||||
X-KDE-ParentComponents=kwin4_effect_resize
|
||||
X-KDE-ParentComponents=resize
|
||||
|
||||
Name=Resize Window
|
||||
Name[uk]=Зміна розмірів вікон
|
||||
|
|
|
@ -57,7 +57,7 @@ void ShowFpsEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_showfps"));
|
||||
interface.reconfigureEffect(QStringLiteral("showfps"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_showfps_config
|
||||
X-KDE-ParentComponents=kwin4_effect_showfps
|
||||
X-KDE-ParentComponents=showfps
|
||||
|
||||
Name=Show FPS
|
||||
Name[uk]=Показ частоти кадрів
|
||||
|
|
|
@ -89,7 +89,7 @@ void ThumbnailAsideEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_thumbnailaside"));
|
||||
interface.reconfigureEffect(QStringLiteral("thumbnailaside"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_thumbnailaside_config
|
||||
X-KDE-ParentComponents=kwin4_effect_thumbnailaside
|
||||
X-KDE-ParentComponents=thumbnailaside
|
||||
|
||||
Name=Thumbnail Aside
|
||||
Name[uk]=Мініатюри збоку
|
||||
|
|
|
@ -102,7 +102,7 @@ void TrackMouseEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_trackmouse"));
|
||||
interface.reconfigureEffect(QStringLiteral("trackmouse"));
|
||||
}
|
||||
|
||||
void TrackMouseEffectConfig::defaults()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_trackmouse_config
|
||||
X-KDE-ParentComponents=kwin4_effect_trackmouse
|
||||
X-KDE-ParentComponents=trackmouse
|
||||
|
||||
Name=Track Mouse
|
||||
Name[uk]=Сліди мишки
|
||||
|
|
|
@ -79,7 +79,7 @@ void WindowGeometryConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_windowgeometry"));
|
||||
interface.reconfigureEffect(QStringLiteral("windowgeometry"));
|
||||
}
|
||||
|
||||
void WindowGeometryConfig::defaults()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_windowgeometry_config
|
||||
X-KDE-ParentComponents=kwin4_effect_windowgeometry
|
||||
X-KDE-ParentComponents=windowgeometry
|
||||
|
||||
Name=WindowGeometry
|
||||
Name[uk]=Розміри вікна
|
||||
|
|
|
@ -101,7 +101,7 @@ void WobblyWindowsEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_wobblywindows"));
|
||||
interface.reconfigureEffect(QStringLiteral("wobblywindows"));
|
||||
}
|
||||
|
||||
void WobblyWindowsEffectConfig::wobblinessChanged()
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_wobblywindows_config
|
||||
X-KDE-ParentComponents=kwin4_effect_wobblywindows
|
||||
X-KDE-ParentComponents=wobblywindows
|
||||
|
||||
Name=Wobbly Windows
|
||||
Name[uk]=Желейні вікна
|
||||
|
|
|
@ -139,7 +139,7 @@ void ZoomEffectConfig::save()
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("kwin4_effect_zoom"));
|
||||
interface.reconfigureEffect(QStringLiteral("zoom"));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -3,7 +3,7 @@ Type=Service
|
|||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_zoom_config
|
||||
X-KDE-ParentComponents=kwin4_effect_zoom
|
||||
X-KDE-ParentComponents=zoom
|
||||
|
||||
Name=Zoom
|
||||
Name[uk]=Масштабування
|
||||
|
|
|
@ -66,13 +66,6 @@ void EffectConfig::openConfig(const QString &serviceName, bool scripted)
|
|||
kcm = KPluginTrader::createInstanceFromQuery<KCModule>(s_pluginDir, QString(),
|
||||
QStringLiteral("[X-KDE-ParentComponents] == '%1'").arg(serviceName),
|
||||
&dialog);
|
||||
if (!kcm) {
|
||||
// HACK: try again with "kwin4_effect_"<serviceName>
|
||||
const QString name = QStringLiteral("kwin4_effect_") + serviceName;
|
||||
kcm = KPluginTrader::createInstanceFromQuery<KCModule>(s_pluginDir, QString(),
|
||||
QStringLiteral("[X-KDE-ParentComponents] == '%1'").arg(name),
|
||||
&dialog);
|
||||
}
|
||||
}
|
||||
if (!kcm) {
|
||||
return;
|
||||
|
|
|
@ -235,7 +235,7 @@ void EffectModel::loadEffects()
|
|||
effect.category = translatedCategory(data.category);
|
||||
effect.serviceName = data.name;
|
||||
effect.enabledByDefault = data.enabled;
|
||||
effect.effectStatus = kwinConfig.readEntry(QStringLiteral("kwin4_effect_") + effect.serviceName + "Enabled", effect.enabledByDefault);
|
||||
effect.effectStatus = kwinConfig.readEntry(effect.serviceName + "Enabled", effect.enabledByDefault);
|
||||
effect.video = data.video;
|
||||
effect.supported = true;
|
||||
effect.exclusiveGroup = data.exclusiveCategory;
|
||||
|
@ -243,7 +243,7 @@ void EffectModel::loadEffects()
|
|||
effect.scripted = false;
|
||||
|
||||
auto it = std::find_if(configs.begin(), configs.end(), [data](const KPluginInfo &info) {
|
||||
return info.property(QStringLiteral("X-KDE-ParentComponents")).toString() == QStringLiteral("kwin4_effect_") + data.name;
|
||||
return info.property(QStringLiteral("X-KDE-ParentComponents")).toString() == data.name;
|
||||
});
|
||||
effect.configurable = it != configs.end();
|
||||
|
||||
|
@ -382,11 +382,6 @@ void EffectModel::syncConfig()
|
|||
const EffectData &effect = *(it);
|
||||
|
||||
QString key = effect.serviceName + QStringLiteral("Enabled");
|
||||
// HACK: workaround for built-in effects, needs to be removed once everything is transited to new names
|
||||
if (!key.startsWith(QStringLiteral("kwin4_effect_"))) {
|
||||
key = QStringLiteral("kwin4_effect_") + key;
|
||||
}
|
||||
|
||||
const bool effectConfigStatus = kwinConfig.readEntry(key, effect.enabledByDefault);
|
||||
|
||||
if (effect.effectStatus != effectConfigStatus) {
|
||||
|
|
|
@ -266,7 +266,7 @@ void KWinDesktopConfig::load()
|
|||
// Set current option to "none" if no plugin is activated.
|
||||
m_ui->effectComboBox->setCurrentIndex(0);
|
||||
auto enableBuiltInEffect = [&effectconfig,this](BuiltInEffect effect, int index) {
|
||||
const QString key = QStringLiteral("kwin4_effect_") + BuiltInEffects::nameForEffect(effect) + QStringLiteral("Enabled");
|
||||
const QString key = BuiltInEffects::nameForEffect(effect) + QStringLiteral("Enabled");
|
||||
if (effectconfig.readEntry(key, BuiltInEffects::enabledByDefault(effect))) {
|
||||
m_ui->effectComboBox->setCurrentIndex(index);
|
||||
}
|
||||
|
@ -339,26 +339,26 @@ void KWinDesktopConfig::save()
|
|||
switch(desktopSwitcher) {
|
||||
case 0:
|
||||
// no effect
|
||||
effectconfig.writeEntry("kwin4_effect_slideEnabled", false);
|
||||
effectconfig.writeEntry("kwin4_effect_cubeslideEnabled", false);
|
||||
effectconfig.writeEntry("slideEnabled", false);
|
||||
effectconfig.writeEntry("cubeslideEnabled", false);
|
||||
effectconfig.writeEntry("kwin4_effect_fadedesktopEnabled", false);
|
||||
break;
|
||||
case 1:
|
||||
// slide
|
||||
effectconfig.writeEntry("kwin4_effect_slideEnabled", true);
|
||||
effectconfig.writeEntry("kwin4_effect_cubeslideEnabled", false);
|
||||
effectconfig.writeEntry("slideEnabled", true);
|
||||
effectconfig.writeEntry("cubeslideEnabled", false);
|
||||
effectconfig.writeEntry("kwin4_effect_fadedesktopEnabled", false);
|
||||
break;
|
||||
case 2:
|
||||
// cube
|
||||
effectconfig.writeEntry("kwin4_effect_slideEnabled", false);
|
||||
effectconfig.writeEntry("kwin4_effect_cubeslideEnabled", true);
|
||||
effectconfig.writeEntry("slideEnabled", false);
|
||||
effectconfig.writeEntry("cubeslideEnabled", true);
|
||||
effectconfig.writeEntry("kwin4_effect_fadedesktopEnabled", false);
|
||||
break;
|
||||
case 3:
|
||||
// fadedesktop
|
||||
effectconfig.writeEntry("kwin4_effect_slideEnabled", false);
|
||||
effectconfig.writeEntry("kwin4_effect_cubeslideEnabled", false);
|
||||
effectconfig.writeEntry("slideEnabled", false);
|
||||
effectconfig.writeEntry("cubeslideEnabled", false);
|
||||
effectconfig.writeEntry("kwin4_effect_fadedesktopEnabled", true);
|
||||
break;
|
||||
}
|
||||
|
@ -584,8 +584,7 @@ void KWinDesktopConfig::slotConfigureEffectClicked()
|
|||
QString effect;
|
||||
switch(m_ui->effectComboBox->currentIndex()) {
|
||||
case 2:
|
||||
// HACK: kwin4_effect_ needs to be removed
|
||||
effect = QStringLiteral("kwin4_effect_") + BuiltInEffects::nameForEffect(BuiltInEffect::CubeSlide);
|
||||
effect = BuiltInEffects::nameForEffect(BuiltInEffect::CubeSlide);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
|
|
|
@ -585,7 +585,7 @@ void KMovingConfig::save(void)
|
|||
cg.writeEntry(KWM_CNTR_SNAP_ZONE, getCenterSnapZone());
|
||||
cg.writeEntry("SnapOnlyWhenOverlapping", m_ui->OverlapSnap->isChecked());
|
||||
|
||||
KConfigGroup(config, "Plugins").writeEntry("kwin4_effect_windowgeometryEnabled", getGeometryTip());
|
||||
KConfigGroup(config, "Plugins").writeEntry("windowgeometryEnabled", getGeometryTip());
|
||||
|
||||
if (standAlone) {
|
||||
config->sync();
|
||||
|
|
|
@ -156,8 +156,7 @@ void KWinScreenEdgesConfig::sanitizeCooldown()
|
|||
// Copied from kcmkwin/kwincompositing/main.cpp
|
||||
bool KWinScreenEdgesConfig::effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const
|
||||
{
|
||||
// HACK: remove kwin4_effect_
|
||||
return cfg.readEntry("kwin4_effect_" + BuiltInEffects::nameForEffect(effect) + "Enabled", BuiltInEffects::enabledByDefault(effect));
|
||||
return cfg.readEntry(BuiltInEffects::nameForEffect(effect) + "Enabled", BuiltInEffects::enabledByDefault(effect));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -313,11 +313,11 @@ void KWinTabBoxConfig::save()
|
|||
// activate effects if not active
|
||||
KConfigGroup effectconfig(m_config, "Plugins");
|
||||
if (coverSwitch || coverSwitchAlternative)
|
||||
effectconfig.writeEntry("kwin4_effect_coverswitchEnabled", true);
|
||||
effectconfig.writeEntry("coverswitchEnabled", true);
|
||||
if (flipSwitch || flipSwitchAlternative)
|
||||
effectconfig.writeEntry("kwin4_effect_flipswitchEnabled", true);
|
||||
effectconfig.writeEntry("flipswitchEnabled", true);
|
||||
if (highlightWindows)
|
||||
effectconfig.writeEntry("kwin4_effect_highlightwindowEnabled", true);
|
||||
effectconfig.writeEntry("highlightwindowEnabled", true);
|
||||
effectconfig.sync();
|
||||
KConfigGroup coverswitchconfig(m_config, "Effect-CoverSwitch");
|
||||
coverswitchconfig.writeEntry("TabBox", coverSwitch);
|
||||
|
@ -387,8 +387,7 @@ void KWinTabBoxConfig::defaults()
|
|||
|
||||
bool KWinTabBoxConfig::effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const
|
||||
{
|
||||
// HACK: remove kwin4_effect_
|
||||
return cfg.readEntry("kwin4_effect_" + BuiltInEffects::nameForEffect(effect) + "Enabled", BuiltInEffects::enabledByDefault(effect));
|
||||
return cfg.readEntry(BuiltInEffects::nameForEffect(effect) + "Enabled", BuiltInEffects::enabledByDefault(effect));
|
||||
}
|
||||
|
||||
void KWinTabBoxConfig::updateUiFromConfig(KWinTabBoxConfigForm* ui, const KWin::TabBox::TabBoxConfig& config)
|
||||
|
@ -488,8 +487,7 @@ void KWinTabBoxConfig::configureEffectClicked()
|
|||
connect(buttonBox, SIGNAL(accepted()), configDialog, SLOT(accept()));
|
||||
connect(buttonBox, SIGNAL(rejected()), configDialog, SLOT(reject()));
|
||||
|
||||
// HACK: kwin4_effect_ needs to be removed
|
||||
const QString name = QStringLiteral("kwin4_effect_") + BuiltInEffects::nameForEffect(effect == CoverSwitch ? BuiltInEffect::CoverSwitch : BuiltInEffect::FlipSwitch);
|
||||
const QString name = BuiltInEffects::nameForEffect(effect == CoverSwitch ? BuiltInEffect::CoverSwitch : BuiltInEffect::FlipSwitch);
|
||||
|
||||
KCModule *kcm = KPluginTrader::createInstanceFromQuery<KCModule>(QStringLiteral("kf5/kwin/effects/configs/"), QString(),
|
||||
QStringLiteral("[X-KDE-ParentComponents] == '%1'").arg(name),
|
||||
|
|
Loading…
Reference in a new issue