Commit 62925937 authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Remove KDE5 migration script

parent 7f5339cb
set(krunnerplugins_SRCS
krunnerplugins.cpp
)
add_executable(krunnerplugins ${krunnerplugins_SRCS})
target_link_libraries(krunnerplugins KF5::CoreAddons KF5::Service KF5::Runner KF5::ConfigCore)
install(TARGETS krunnerplugins DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/)
install(FILES krunnerplugins.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
set(krunnerglobalshortcuts_SRCS
krunnerglobalshortcuts.cpp
)
......
/***************************************************************************
* Copyright (C) 2016 by Marco Martin <mart@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include <QCoreApplication>
#include <KSharedConfig>
#include <KConfigGroup>
#include <KRunner/RunnerManager>
void migrateEnabledPlugins()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig("krunnerrc");
KConfigGroup runnerManagerGroup(config, "PlasmaRunnerManager");
KConfigGroup pluginsGroup(config, "Plugins");
QStringList enabledCategories = runnerManagerGroup.readEntry("enabledCategories", QStringList());
if (enabledCategories.isEmpty()) {
return;
}
Plasma::RunnerManager *manager = new Plasma::RunnerManager();
manager->reloadConfiguration();
for (Plasma::AbstractRunner *runner : manager->runners()) {
pluginsGroup.writeEntry(runner->metadata().pluginName() + QStringLiteral("Enabled"), false);
for (auto category : runner->categories()) {
if (enabledCategories.contains(category)) {
pluginsGroup.writeEntry(runner->metadata().pluginName() + QStringLiteral("Enabled"), true);
break;
}
}
}
runnerManagerGroup.deleteEntry("enabledCategories");
}
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
migrateEnabledPlugins();
return 0;
}
Version=5
Id=5.9KRunnerPlugins
Script=krunnerplugins
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment