Commit 97c3db1d authored by Christoph Cullmann's avatar Christoph Cullmann

more porting

parent 1e919a19
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} )
......
......@@ -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
......
......@@ -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"
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment