aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-20 00:29:44 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-20 00:29:44 (GMT)
commit1e919a19aca1728f8c5c36b1f61545cee99c4003 (patch)
tree306e65e35ede0b7509b9a0be9f41d5a8d9d25f82
parent475185fe8c6c5ed8c1254b0a4ec0746bb8b1f83b (diff)
start to port sql plugin
-rw-r--r--addons/kate/katesql/CMakeLists.txt17
-rw-r--r--addons/kate/katesql/katesqlplugin.cpp3
-rw-r--r--addons/kate/katesql/katesqlplugin.h24
-rw-r--r--addons/kate/katesql/katesqlview.h9
-rw-r--r--addons/kate/katesql/pics/CMakeLists.txt2
5 files changed, 26 insertions, 29 deletions
diff --git a/addons/kate/katesql/CMakeLists.txt b/addons/kate/katesql/CMakeLists.txt
index 70223b6..0408db6 100644
--- a/addons/kate/katesql/CMakeLists.txt
+++ b/addons/kate/katesql/CMakeLists.txt
@@ -1,7 +1,4 @@
-if(NOT KDE4_FOUND)
- find_package(KDE4 REQUIRED)
- include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
-endif(NOT KDE4_FOUND)
+project(katesqlplugin)
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
@@ -24,15 +21,21 @@ set(katesql_SRCS
outputwidget.cpp
)
-kde4_add_plugin(katesqlplugin ${katesql_SRCS})
+add_library (katesqlplugin MODULE ${katesql_SRCS})
add_subdirectory(pics)
-target_link_libraries(katesqlplugin ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${QT_QTSQL_LIBRARY} kateinterfaces ktexteditor )
+
+target_link_libraries(katesqlplugin
+ KF5::TextEditor
+ KF5::Parts KF5::I18n
+ Qt5::Script KF5::ItemViews KF5::IconThemes)
install(TARGETS katesqlplugin DESTINATION ${PLUGIN_INSTALL_DIR} )
########### install files ###############
-install( FILES ui.rc DESTINATION ${DATA_INSTALL_DIR}/kate/plugins/katesql )
+install( FILES ui.rc DESTINATION ${DATA_INSTALL_DIR}/katesql )
+
+kservice_desktop_to_json (katesql.desktop)
install( FILES katesql.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/addons/kate/katesql/katesqlplugin.cpp b/addons/kate/katesql/katesqlplugin.cpp
index 019c47c..729b940 100644
--- a/addons/kate/katesql/katesqlplugin.cpp
+++ b/addons/kate/katesql/katesqlplugin.cpp
@@ -20,9 +20,6 @@
#include "katesqlconfigpage.h"
#include "katesqlview.h"
-#include <kate/plugin.h>
-#include <kate/mainwindow.h>
-#include <kate/documentmanager.h>
#include <ktexteditor/document.h>
#include <kpluginloader.h>
diff --git a/addons/kate/katesql/katesqlplugin.h b/addons/kate/katesql/katesqlplugin.h
index 1ac226b..2756b8d 100644
--- a/addons/kate/katesql/katesqlplugin.h
+++ b/addons/kate/katesql/katesqlplugin.h
@@ -19,17 +19,15 @@
#ifndef KATESQLPLUGIN_H
#define KATESQLPLUGIN_H
-
-
#include <ktexteditor/view.h>
-#include <kate/plugin.h>
-#include <kate/application.h>
-#include <kate/mainwindow.h>
+#include <ktexteditor/plugin.h>
+#include <ktexteditor/application.h>
+#include <ktexteditor/mainwindow.h>
#include <ktexteditor/configpageinterface.h>
#include <kpluginfactory.h>
-class KateSQLPlugin : public Kate::Plugin, public KTextEditor::ConfigPageInterface
+class KateSQLPlugin : public KTextEditor::Plugin, public KTextEditor::ConfigPageInterface
{
Q_OBJECT
Q_INTERFACES(KTextEditor::ConfigPageInterface)
@@ -39,21 +37,19 @@ class KateSQLPlugin : public Kate::Plugin, public KTextEditor::ConfigPageInterfa
virtual ~KateSQLPlugin();
- Kate::PluginView *createView(Kate::MainWindow *mainWindow);
+ QObject *createView(KTextEditor::MainWindow *mainWindow);
// PluginConfigPageInterface
- uint configPages() const { return 1; };
- KTextEditor::ConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name = 0);
- QString configPageName (uint number = 0) const;
- QString configPageFullName (uint number = 0) const;
- KIcon configPageIcon (uint number = 0) const;
+ int configPages() const { return 1; };
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0, const char *name = 0);
+ QString configPageName (int number = 0) const;
+ QString configPageFullName (int number = 0) const;
+ KIcon configPageIcon (int number = 0) const;
Q_SIGNALS:
void globalSettingsChanged();
};
-K_PLUGIN_FACTORY_DECLARATION(KateSQLFactory)
-
#endif // KATESQLPLUGIN_H
diff --git a/addons/kate/katesql/katesqlview.h b/addons/kate/katesql/katesqlview.h
index 54518ea..532dd69 100644
--- a/addons/kate/katesql/katesqlview.h
+++ b/addons/kate/katesql/katesqlview.h
@@ -29,15 +29,16 @@ class KComboBox;
class QSqlQuery;
class QActionGroup;
-#include <kate/plugin.h>
-#include <kate/mainwindow.h>
+#include <KXMLGUIClient>
-class KateSQLView : public Kate::PluginView, public Kate::XMLGUIClient
+#include <ktexteditor/mainwindow.h>
+
+class KateSQLView : public QObject, public KXMLGUIClient
{
Q_OBJECT
public:
- explicit KateSQLView(Kate::MainWindow *mw);
+ explicit KateSQLView(KTextEditor::MainWindow *mw);
~KateSQLView();
void readSessionConfig (KConfigBase* config, const QString& groupPrefix);
diff --git a/addons/kate/katesql/pics/CMakeLists.txt b/addons/kate/katesql/pics/CMakeLists.txt
index dc648d1..ab2fdfd 100644
--- a/addons/kate/katesql/pics/CMakeLists.txt
+++ b/addons/kate/katesql/pics/CMakeLists.txt
@@ -1 +1 @@
-kde4_install_icons( ${DATA_INSTALL_DIR}/kate/icons )
+ecm_install_icons ( ${ICON_INSTALL_DIR} )