[plasma/systemsettings] /: Create versionless systemsettings executable & install symlink to old name
Alexander Lohnau
null at kde.org
Thu Oct 14 10:43:12 BST 2021
Git commit 4b2370f35534441a393297c57627eefc6edef293 by Alexander Lohnau.
Committed on 13/10/2021 at 18:36.
Pushed by alex into branch 'master'.
Create versionless systemsettings executable & install symlink to old name
This way consumers will be able to call "systemsettings" as the executable name
and don't have to worry about the major version. Considering the systemsettings is part of Plasma
and Plasma 5/6 are not going to be co-installable there is no point in having a versioned executable.
In KF6 the symlink to systemsettings5 can be removed.
Task: https://phabricator.kde.org/T14763
M +10 -4 app/CMakeLists.txt
M +1 -1 app/main.cpp
M +6 -6 app/systemsettings.desktop
M +2 -2 doc/index.docbook
M +1 -1 runner/systemsettingsrunner.cpp
https://invent.kde.org/plasma/systemsettings/commit/4b2370f35534441a393297c57627eefc6edef293
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 5fb0510a..c0cdae0d 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -12,10 +12,10 @@ ecm_qt_declare_logging_category(systemsettings_SRCS HEADER systemsettings_app_de
# kde4_add_app_icon( systemsettings_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/categories/preferences-system.png" )
kconfig_add_kcfg_files( systemsettings_SRCS BaseConfig.kcfgc )
-add_executable( systemsettings5 ${systemsettings_SRCS})
-target_compile_definitions(systemsettings5 PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
+add_executable(systemsettings ${systemsettings_SRCS})
+target_compile_definitions(systemsettings PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
-target_link_libraries( systemsettings5 systemsettingsview
+target_link_libraries( systemsettings systemsettingsview
KF5::Crash
KF5::ItemViews
KF5::KCMUtils
@@ -32,7 +32,13 @@ target_link_libraries( systemsettings5 systemsettingsview
PW::KWorkspace
)
-install( TARGETS systemsettings5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
+
+add_custom_command(TARGET systemsettings POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/systemsettings systemsettings5)
+
+install( FILES ${CMAKE_CURRENT_BINARY_DIR}/systemsettings5 DESTINATION ${KDE_INSTALL_FULL_BINDIR}/ )
+
+install( TARGETS systemsettings ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
install( FILES systemsettings.kcfg DESTINATION ${KDE_INSTALL_DATADIR}/systemsettings )
install( FILES systemsettingsui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/systemsettings )
install( PROGRAMS kdesystemsettings.desktop systemsettings.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
diff --git a/app/main.cpp b/app/main.cpp
index 0dea0c86..48ae913f 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
mode = BaseMode::InfoCenter;
}
- // exec is systemsettings5, but we need the QPT to use the right config from the qApp constructor
+ // exec is systemsettings, but we need the QPT to use the right config from the qApp constructor
// which is before KAboutData::setApplicationData
QCoreApplication::setApplicationName(binaryName);
diff --git a/app/systemsettings.desktop b/app/systemsettings.desktop
index 2dcd3c10..6d3510f8 100755
--- a/app/systemsettings.desktop
+++ b/app/systemsettings.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Exec=systemsettings5
+Exec=systemsettings
Icon=preferences-system
Type=Application
X-DocPath=systemsettings/index.html
@@ -278,7 +278,7 @@ Name[x-test]=xxGlobal Themexx
Name[zh_CN]=全局主题
Name[zh_TW]=全域主題
Icon=preferences-desktop-theme-global
-Exec=systemsettings5 kcm_lookandfeel
+Exec=systemsettings kcm_lookandfeel
[Desktop Action kcm-users]
Name=Users
@@ -324,7 +324,7 @@ Name[x-test]=xxUsersxx
Name[zh_CN]=用户
Name[zh_TW]=使用者
Icon=preferences-system-users
-Exec=systemsettings5 kcm_users
+Exec=systemsettings kcm_users
[Desktop Action screenlocker]
Name=Screen Locking
@@ -369,7 +369,7 @@ Name[x-test]=xxScreen Lockingxx
Name[zh_CN]=锁屏
Name[zh_TW]=螢幕鎖定
Icon=preferences-desktop-user-password
-Exec=systemsettings5 screenlocker
+Exec=systemsettings screenlocker
[Desktop Action powerdevilprofilesconfig]
Name=Energy Saving
@@ -414,7 +414,7 @@ Name[x-test]=xxEnergy Savingxx
Name[zh_CN]=节能
Name[zh_TW]=節能選項
Icon=preferences-system-power-management
-Exec=systemsettings5 powerdevilprofilesconfig
+Exec=systemsettings powerdevilprofilesconfig
[Desktop Action kcm-kscreen]
Name=Display Configuration
@@ -457,4 +457,4 @@ Name[x-test]=xxDisplay Configurationxx
Name[zh_CN]=显示器配置
Name[zh_TW]=顯示設定
Icon=preferences-desktop-display-randr
-Exec=systemsettings5 kcm_kscreen
+Exec=systemsettings kcm_kscreen
diff --git a/doc/index.docbook b/doc/index.docbook
index 5e8d8ccc..facfc7c8 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -104,12 +104,12 @@ By selecting <menuchoice><guimenu>Settings</guimenu><guimenuitem>System Settings
</listitem>
<listitem>
<para>
- By pressing <keycombo>&Alt;<keycap>F2</keycap></keycombo> or <keycombo>&Alt;<keycap>Space</keycap></keycombo>. This will bring up the &krunner; dialog. Type <command>systemsettings5</command>, and press &Enter;.
+ By pressing <keycombo>&Alt;<keycap>F2</keycap></keycombo> or <keycombo>&Alt;<keycap>Space</keycap></keycombo>. This will bring up the &krunner; dialog. Type <command>systemsettings</command>, and press &Enter;.
</para>
</listitem>
<listitem>
<para>
-Type <command>systemsettings5 &</command> at any command prompt.
+Type <command>systemsettings &</command> at any command prompt.
</para>
</listitem>
</orderedlist>
diff --git a/runner/systemsettingsrunner.cpp b/runner/systemsettingsrunner.cpp
index 5c0ad559..6b4ee46b 100644
--- a/runner/systemsettingsrunner.cpp
+++ b/runner/systemsettingsrunner.cpp
@@ -68,7 +68,7 @@ void SystemsettingsRunner::run(const Plasma::RunnerContext &context, const Plasm
job = new KIO::CommandLauncherJob(QStringLiteral("kinfocenter"), {data.pluginId()});
job->setDesktopName(QStringLiteral("org.kde.kinfocenter"));
} else if (!data.value(QStringLiteral("X-KDE-System-Settings-Parent-Category")).isEmpty()) {
- job = new KIO::CommandLauncherJob(QStringLiteral("systemsettings5"), {data.pluginId()});
+ job = new KIO::CommandLauncherJob(QStringLiteral("systemsettings"), {data.pluginId()});
job->setDesktopName(QStringLiteral("org.kde.systemsettings"));
} else {
// If we have created the KPluginMetaData from a desktop file KCMShell needs the pluginId, otherwise we can give
More information about the kde-doc-english
mailing list