summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-20 00:44:56 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-20 00:44:56 (GMT)
commit97c3db1dc58460573fa9aa9e71c7a7f7e45e0f7b (patch)
treed53e85d3cd6db7f47aaade98bb385a853e6c1f2a
parent1e919a19aca1728f8c5c36b1f61545cee99c4003 (diff)
more porting
-rw-r--r--addons/kate/katesql/CMakeLists.txt7
-rw-r--r--addons/kate/katesql/katesqlconfigpage.h2
-rw-r--r--addons/kate/katesql/katesqlplugin.cpp25
-rw-r--r--addons/kate/katesql/katesqlplugin.h4
4 files changed, 20 insertions, 18 deletions
diff --git a/addons/kate/katesql/CMakeLists.txt b/addons/kate/katesql/CMakeLists.txt
index 0408db6..a861dfe 100644
--- a/addons/kate/katesql/CMakeLists.txt
+++ b/addons/kate/katesql/CMakeLists.txt
@@ -1,5 +1,8 @@
project(katesqlplugin)
+# Load the frameworks we need
+find_package(KF5 CONFIG REQUIRED COMPONENTS Wallet)
+
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
set(katesql_SRCS
@@ -28,8 +31,8 @@ add_subdirectory(pics)
target_link_libraries(katesqlplugin
KF5::TextEditor
- KF5::Parts KF5::I18n
- Qt5::Script KF5::ItemViews KF5::IconThemes)
+ KF5::Parts KF5::I18n KF5::Wallet
+ Qt5::Script Qt5::Sql KF5::ItemViews KF5::IconThemes)
install(TARGETS katesqlplugin DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/addons/kate/katesql/katesqlconfigpage.h b/addons/kate/katesql/katesqlconfigpage.h
index aa33661..b774733 100644
--- a/addons/kate/katesql/katesqlconfigpage.h
+++ b/addons/kate/katesql/katesqlconfigpage.h
@@ -24,7 +24,7 @@ class QCheckBox;
#include "katesqlplugin.h"
-#include <ktexteditor/configpageinterface.h>
+#include <ktexteditor/configpage.h>
/// TODO: add options to change datetime and numbers format
diff --git a/addons/kate/katesql/katesqlplugin.cpp b/addons/kate/katesql/katesqlplugin.cpp
index 729b940..404dea4 100644
--- a/addons/kate/katesql/katesqlplugin.cpp
+++ b/addons/kate/katesql/katesqlplugin.cpp
@@ -26,13 +26,13 @@
#include <kaboutdata.h>
#include <klocalizedstring.h>
-K_PLUGIN_FACTORY_DEFINITION(KateSQLFactory, registerPlugin<KateSQLPlugin>();)
-K_EXPORT_PLUGIN(KateSQLFactory(KAboutData("katesql", "katesql",
- ki18n("SQL Plugin"), "0.3", ki18n("Execute query on SQL databases"), KAboutData::License_LGPL_V2)))
+#include <QIcon>
+
+K_PLUGIN_FACTORY_WITH_JSON(KateSQLFactory, "katesql.json", registerPlugin<KateSQLPlugin>();)
//BEGIN KateSQLPLugin
KateSQLPlugin::KateSQLPlugin(QObject *parent, const QList<QVariant>&)
-: Kate::Plugin ((Kate::Application*)parent, "katesql")
+ : KTextEditor::Plugin (parent)
{
}
@@ -42,7 +42,7 @@ KateSQLPlugin::~KateSQLPlugin()
}
-Kate::PluginView *KateSQLPlugin::createView (Kate::MainWindow *mainWindow)
+QObject *KateSQLPlugin::createView (KTextEditor::MainWindow *mainWindow)
{
KateSQLView *view = new KateSQLView(mainWindow);
@@ -52,10 +52,8 @@ Kate::PluginView *KateSQLPlugin::createView (Kate::MainWindow *mainWindow)
}
-KTextEditor::ConfigPage* KateSQLPlugin::configPage(uint number, QWidget *parent, const char *name)
+KTextEditor::ConfigPage* KateSQLPlugin::configPage(int number, QWidget *parent)
{
- Q_UNUSED(name)
-
if (number != 0)
return 0;
@@ -67,25 +65,26 @@ KTextEditor::ConfigPage* KateSQLPlugin::configPage(uint number, QWidget *parent,
}
-QString KateSQLPlugin::configPageName (uint number) const
+QString KateSQLPlugin::configPageName (int number) const
{
if (number != 0) return QString();
return i18nc("@title", "SQL");
}
-QString KateSQLPlugin::configPageFullName (uint number) const
+QString KateSQLPlugin::configPageFullName (int number) const
{
if (number != 0) return QString();
return i18nc("@title:window", "SQL Plugin Settings");
}
-KIcon KateSQLPlugin::configPageIcon (uint number) const
+QIcon KateSQLPlugin::configPageIcon (int number) const
{
- if (number != 0) return KIcon();
- return KIcon("server-database");
+ if (number != 0) return QIcon();
+ return QIcon::fromTheme(QLatin1String ("server-database"));
}
//END KateSQLPlugin
+#include "katesqlplugin.moc"
diff --git a/addons/kate/katesql/katesqlplugin.h b/addons/kate/katesql/katesqlplugin.h
index 2756b8d..0b4bcdc 100644
--- a/addons/kate/katesql/katesqlplugin.h
+++ b/addons/kate/katesql/katesqlplugin.h
@@ -42,10 +42,10 @@ class KateSQLPlugin : public KTextEditor::Plugin, public KTextEditor::ConfigPage
// PluginConfigPageInterface
int configPages() const { return 1; };
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0, const char *name = 0);
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0);
QString configPageName (int number = 0) const;
QString configPageFullName (int number = 0) const;
- KIcon configPageIcon (int number = 0) const;
+ QIcon configPageIcon (int number = 0) const;
Q_SIGNALS:
void globalSettingsChanged();