[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kmuddy] /: start kde5 migration
From: Tomas Mecir <null () kde ! org>
Date: 2018-03-31 19:47:15
Message-ID: E1f2MT5-0001ET-KK () code ! kde ! org
[Download RAW message or body]
Git commit 5a4c14c2b4892cc937610f2d14c909803f9080d5 by Tomas Mecir.
Committed on 31/03/2018 at 19:46.
Pushed by mecir into branch 'master'.
start kde5 migration
M +12 -4 CMakeLists.txt
M +2 -2 kmuddy/CMakeLists.txt
M +10 -1 kmuddy/main.cpp
M +0 -3 plugins/mapper/kmuddymapperpart.rc
https://commits.kde.org/kmuddy/5a4c14c2b4892cc937610f2d14c909803f9080d5
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d25d9f8..5d327aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,17 @@ project(kmuddy)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} )
-find_package(KDE4 REQUIRED)
+find_package(ECM REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
+
+find_package(Qt5 REQUIRED COMPONENTS Widgets)
+find_package(KF5 CONFIG REQUIRED KCoreAddons I18n KIOCore Phonon)
+
+include(KDEInstallDirs)
+include(KDECompilerSettings NO_POLICY_SCOPE))
+include(KDECMakeSettings)
+include(FeatureSummary)
+include(KDEFrameworkCompilerSettings)
macro_optional_find_package(MXP)
if (MXP_FOUND)
@@ -17,9 +27,7 @@ configure_file(config-mxp.h.cmake \
${CMAKE_CURRENT_BINARY_DIR}/config-mxp.h )
#set(CMAKE_VERBOSE_MAKEFILE ON)
-add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
-
-link_directories(${KDE4_LIB_DIR})
+add_definitions(${QT_DEFINITIONS})
#include(ConvenienceLibs.cmake)
diff --git a/kmuddy/CMakeLists.txt b/kmuddy/CMakeLists.txt
index 60c137e..d63d4c7 100644
--- a/kmuddy/CMakeLists.txt
+++ b/kmuddy/CMakeLists.txt
@@ -48,7 +48,7 @@ set(kmuddy_SRCS
cscriptapi.cpp
)
-kde4_add_executable(kmuddy ${kmuddy_SRCS})
+add_executable(kmuddy ${kmuddy_SRCS})
set (KMUDDY_LIBRARIES kmuddycore dialogs ${KDE4_KDECORE_LIBS} ${KDE4_KPARTS_LIBS} \
${KDE4_KUTILS_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_PHONON_LIBS} ${KDE4_KDE3SUPPORT_LIBS} z \
)
@@ -61,7 +61,7 @@ target_link_libraries(kmuddy ${KMUDDY_LIBRARIES} )
install(TARGETS kmuddy DESTINATION ${BIN_INSTALL_DIR})
# install the icons
-kde4_install_icons( ${ICON_INSTALL_DIR} )
+ecm_install_icons( ${ICON_INSTALL_DIR} )
install (FILES kmuddy.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
diff --git a/kmuddy/main.cpp b/kmuddy/main.cpp
index 281074d..9c9e1f8 100644
--- a/kmuddy/main.cpp
+++ b/kmuddy/main.cpp
@@ -20,6 +20,7 @@
#include <kaboutdata.h>
#include <klocale.h>
#include <kapplication.h>
+#include <Kdelibs4ConfigMigrator>
#include <signal.h>
@@ -77,7 +78,15 @@ int main(int argc, char *argv[])
//when switching tabs using Alt+number - ignoring the signal, hoping
//for the best...
signal (SIGALRM, SIG_IGN);
-
+
+ // migrate settings from kde4
+ Kdelibs4ConfigMigrator migrator(QStringLiteral("kmuddy")); // the same name \
defined in the aboutData + // all the config files of your application
+ migrator.setConfigFiles(QStringList() << QStringLiteral("kmuddyrc"));
+ // list of KXMLGUI files used by your application
+ migrator.setUiFiles(QStringList() << QStringLiteral("kmuddymapperpart.rc"));
+ migrator.migrate();
+
KApplication a;
a.setApplicationName ("KMuddy");
KMuddy *kmuddy = 0;
diff --git a/plugins/mapper/kmuddymapperpart.rc b/plugins/mapper/kmuddymapperpart.rc
index 8cf2d2b..375e7eb 100644
--- a/plugins/mapper/kmuddymapperpart.rc
+++ b/plugins/mapper/kmuddymapperpart.rc
@@ -5,9 +5,6 @@
<Action name = "viewUpperLevel"/>
<Action name = "viewLowerLevel"/>
</Menu>
- <Menu name="Window"><Text>&Window</Text>
- <Action name = "viewSpeedwalkList"/>
- </Menu>
</MenuBar>
<StatusBar/>
<ToolBar fullWidth="false" name="tools" position="left"><Text>Tools</Text>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic