summarylogtreecommitdiffstats
path: root/port_to_kf5.patch
diff options
context:
space:
mode:
Diffstat (limited to 'port_to_kf5.patch')
-rw-r--r--port_to_kf5.patch155
1 files changed, 155 insertions, 0 deletions
diff --git a/port_to_kf5.patch b/port_to_kf5.patch
new file mode 100644
index 000000000000..46675d9eab47
--- /dev/null
+++ b/port_to_kf5.patch
@@ -0,0 +1,155 @@
+diff -Naur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2011-11-13 21:55:57.000000000 +0800
++++ b/CMakeLists.txt 2015-12-03 08:51:27.892172082 +0800
+@@ -1,4 +1,4 @@
+-cmake_minimum_required (VERSION 2.6)
++cmake_minimum_required (VERSION 2.8)
+ project(kcm_imchooser)
+ set(MAJOR_VERSION "0")
+ set(MINOR_VERSION "1")
+@@ -12,8 +12,16 @@
+ set(VERSION_STRING_FULL "${VERSION_STRING}-${SUFFIX_VERSION}")
+ endif(NOT SUFFIX_VERSION)
+
+-find_package(KDE4 REQUIRED)
+-include(KDE4Defaults)
++find_package(ECM 0.0.11 REQUIRED NO_MODULE)
++set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
++
++include(KDEInstallDirs)
++include(KDECMakeSettings)
++include(KDECompilerSettings)
++include(FeatureSummary)
++
++find_package(Qt5 REQUIRED COMPONENTS Widgets)
++find_package(KF5 REQUIRED COMPONENTS KDELibs4Support KIO DBusAddons)
+
+ set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_C_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_CXX_FLAGS}")
+diff -Naur a/src/kcontrol/CMakeLists.txt b/src/kcontrol/CMakeLists.txt
+--- a/src/kcontrol/CMakeLists.txt 2011-11-13 21:55:57.000000000 +0800
++++ b/src/kcontrol/CMakeLists.txt 2015-12-03 08:51:27.895505493 +0800
+@@ -1,6 +1,3 @@
+-add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
+-include_directories(${KDE4_INCLUDES} ${QT_INCLUDES})
+-
+ set(kcm_SRCS
+ main.cpp
+ module.cpp
+@@ -11,13 +8,12 @@
+
+ find_package(Gettext REQUIRED)
+
+-kde4_add_ui_files(kcm_SRCS module.ui)
++ki18n_wrap_ui(kcm_SRCS module.ui)
+
+-kde4_add_plugin(kcm_imchooser ${kcm_SRCS})
++add_library(kcm_imchooser MODULE ${kcm_SRCS})
+
+ target_link_libraries(kcm_imchooser
+- ${KDE4_KDEUI_LIBRARY}
+- ${KDE4_KIO_LIBRARY}
++ KF5::KDELibs4Support
+ )
+
+ install(TARGETS kcm_imchooser DESTINATION ${PLUGIN_INSTALL_DIR})
+diff -Naur a/src/kcontrol/kcm_imchooser.desktop b/src/kcontrol/kcm_imchooser.desktop
+--- a/src/kcontrol/kcm_imchooser.desktop 2011-11-13 21:55:57.000000000 +0800
++++ b/src/kcontrol/kcm_imchooser.desktop 2015-12-03 08:51:27.895505493 +0800
+@@ -1,13 +1,15 @@
+ [Desktop Entry]
+-Exec=kcmshell4 kcm_imchooser
++Exec=kcmshell5 kcm_imchooser
+ Icon=draw-freehand
+ Type=Service
+ X-KDE-ServiceTypes=KCModule
+ X-KDE-Library=kcm_imchooser
+ X-KDE-ParentApp=kcontrol
+
+-X-KDE-System-Settings-Parent-Category=locale
++X-KDE-System-Settings-Parent-Category=regionalsettings
+ Name=Input Method Chooser
++Name[zh_CN]=输入法选择器
+ Comment=Choose your input method
++Comment[zh_CN]=选择你的输入法
+
+ Categories=Qt;KDE;X-KDE-settings-components;
+diff -Naur a/src/kcontrol/main.cpp b/src/kcontrol/main.cpp
+--- a/src/kcontrol/main.cpp 2011-11-13 21:55:57.000000000 +0800
++++ b/src/kcontrol/main.cpp 2015-12-03 09:06:36.926300550 +0800
+@@ -26,3 +26,4 @@
+ registerPlugin<IMChooser::Module>();)
+ K_EXPORT_PLUGIN(KcmIMChooserFactory("kcm_imchooser"))
+
++#include <main.moc>
+\ No newline at end of file
+diff -Naur a/src/kcontrol/module.cpp b/src/kcontrol/module.cpp
+--- a/src/kcontrol/module.cpp 2011-11-13 21:55:57.000000000 +0800
++++ b/src/kcontrol/module.cpp 2015-12-03 09:06:59.976677775 +0800
+@@ -29,6 +29,16 @@
+ #include <KMessageBox>
+ #include <KIconButton>
+ #include <KFileDialog>
++//kdelibs4support
++#include <KGlobal>
++#include <KIcon>
++#include <KDialog>
++#include <KUrl>
++
++#include <QStandardPaths>
++
++#define TRANSLATION_DOMAIN "kcm_imchooser"
++#include <klocalizedstring.h>
+
+ #include "ui_module.h"
+ #include "module.h"
+@@ -41,7 +51,7 @@
+ namespace IMChooser
+ {
+ Module::Module(QWidget *parent, const QVariantList &args) :
+- KCModule(KcmIMChooserFactory::componentData(), parent, args),
++ KCModule(parent, args),
+ ui(new Ui::Module),
+ m_model(new IMProfileModel(this)),
+ m_listView(0),
+@@ -111,11 +121,11 @@
+ saveProfile(profile);
+ }
+
+- QDir kdedir(KGlobal::mainComponent().dirs()->localkdedir());
++ QDir kdedir(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/plasma-workspace");
+ if (!kdedir.exists("env"))
+ kdedir.mkpath("env");
+
+- QFile envScript(KGlobal::mainComponent().dirs()->localkdedir() + "env/" + "imchooser-env.sh");
++ QFile envScript(kdedir.path() + "/env/imchooser-env.sh");
+ if (!envScript.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+
+diff -Naur a/src/kded/CMakeLists.txt b/src/kded/CMakeLists.txt
+--- a/src/kded/CMakeLists.txt 2011-11-13 21:55:57.000000000 +0800
++++ b/src/kded/CMakeLists.txt 2015-12-03 08:51:27.895505493 +0800
+@@ -3,9 +3,9 @@
+
+ set(kded_imchooserstarter_PART_SRCS imchooserstarter.cpp )
+
+-kde4_add_plugin(kded_imchooserstarter ${kded_imchooserstarter_PART_SRCS})
++add_library(kded_imchooserstarter MODULE ${kded_imchooserstarter_PART_SRCS})
+
+-target_link_libraries(kded_imchooserstarter ${KDE4_KIO_LIBS})
++target_link_libraries(kded_imchooserstarter KF5::KDELibs4Support KF5::DBusAddons)
+
+ install(TARGETS kded_imchooserstarter DESTINATION ${PLUGIN_INSTALL_DIR} )
+ install( FILES imchooserstarter.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded )
+\ No newline at end of file
+diff -Naur a/src/kded/imchooserstarter.cpp b/src/kded/imchooserstarter.cpp
+--- a/src/kded/imchooserstarter.cpp 2011-11-13 21:55:57.000000000 +0800
++++ b/src/kded/imchooserstarter.cpp 2015-12-03 08:51:27.895505493 +0800
+@@ -29,6 +29,7 @@
+ K_PLUGIN_FACTORY(IMChooserFactory, registerPlugin<IMChooserStarter>();)
+ K_EXPORT_PLUGIN(IMChooserFactory("kded_imchooserstarter"))
+
++#include "imchooserstarter.moc"
+
+ IMChooserStarter::IMChooserStarter(QObject *parent, const QList<QVariant> &)
+ : KDEDModule(parent)