aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-20 01:20:34 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-20 01:20:34 (GMT)
commit6c9dd0ba59c8c0182d3a1666a38074516c87431e (patch)
tree4b462d0dc5e161b34e59f5feb9f6c1afea8f6646
parentb1d9bea7951ee8373580e6c18e3379fa6ee5c49c (diff)
more ported
-rw-r--r--addons/kate/katesql/katesqlplugin.cpp2
-rw-r--r--addons/kate/katesql/katesqlview.cpp42
-rw-r--r--addons/kate/katesql/katesqlview.h2
3 files changed, 24 insertions, 22 deletions
diff --git a/addons/kate/katesql/katesqlplugin.cpp b/addons/kate/katesql/katesqlplugin.cpp
index 404dea4..299485a 100644
--- a/addons/kate/katesql/katesqlplugin.cpp
+++ b/addons/kate/katesql/katesqlplugin.cpp
@@ -44,7 +44,7 @@ KateSQLPlugin::~KateSQLPlugin()
QObject *KateSQLPlugin::createView (KTextEditor::MainWindow *mainWindow)
{
- KateSQLView *view = new KateSQLView(mainWindow);
+ KateSQLView *view = new KateSQLView(this, mainWindow);
connect(this, SIGNAL(globalSettingsChanged()), view, SLOT(slotGlobalSettingsChanged()));
diff --git a/addons/kate/katesql/katesqlview.cpp b/addons/kate/katesql/katesqlview.cpp
index bb06dff..4860f58 100644
--- a/addons/kate/katesql/katesqlview.cpp
+++ b/addons/kate/katesql/katesqlview.cpp
@@ -42,6 +42,8 @@
#include <kconfiggroup.h>
#include <kcombobox.h>
#include <kconfig.h>
+#include <KSharedConfig>
+#include <KXMLGUIFactory>
#include <qmenu.h>
#include <qstring.h>
@@ -49,22 +51,22 @@
#include <QVBoxLayout>
#include <QApplication>
-KateSQLView::KateSQLView(KTextEditor::MainWindow *mw)
+KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mw)
: QObject (mw)
, KXMLGUIClient()
, m_manager (new SQLManager(this))
, m_mainWindow (mw)
{
- m_outputToolView = mw->createToolView(QLatin1String ("kate_private_plugin_katesql_output"),
+ m_outputToolView = mw->createToolView(plugin, QLatin1String ("kate_private_plugin_katesql_output"),
KTextEditor::MainWindow::Bottom,
- QIcon::fromTheme ("view-form-table"),
+ QIcon::fromTheme (QLatin1String ("view-form-table")),
i18nc("@title:window", "SQL Results")
);
- m_schemaBrowserToolView = mw->createToolView(QLatin1String ("kate_private_plugin_katesql_schemabrowser"),
+ m_schemaBrowserToolView = mw->createToolView(plugin, QLatin1String ("kate_private_plugin_katesql_schemabrowser"),
KTextEditor::MainWindow::Left,
- QIcon::fromTheme ("view-list-tree"),
+ QIcon::fromTheme (QLatin1String ("view-list-tree")),
i18nc("@title:window", "SQL Schema Browser")
);
@@ -82,7 +84,7 @@ KateSQLView::KateSQLView(KTextEditor::MainWindow *mw)
m_mainWindow->guiFactory()->addClient(this);
- QMenu *sqlMenu = (QMenu*)factory()->container("SQL", this);
+ QMenu *sqlMenu = (QMenu*)factory()->container(QLatin1String ("SQL"), this);
m_connectionsGroup = new QActionGroup(sqlMenu);
m_connectionsGroup->setExclusive(true);
@@ -97,7 +99,7 @@ KateSQLView::KateSQLView(KTextEditor::MainWindow *mw)
connect(m_manager, SIGNAL(connectionAboutToBeClosed(QString)), this, SLOT(slotConnectionAboutToBeClosed(QString)));
connect(m_connectionsComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotConnectionChanged(QString)));
- stateChanged("has_connection_selected", KXMLGUIClient::StateReverse);
+ stateChanged(QLatin1String ("has_connection_selected"), KXMLGUIClient::StateReverse);
}
@@ -114,36 +116,36 @@ KateSQLView::~KateSQLView()
void KateSQLView::setupActions()
{
- KAction* action;
+ QAction* action;
KActionCollection* collection = actionCollection();
- action = collection->addAction("connection_create");
+ action = collection->addAction(QLatin1String ("connection_create"));
action->setText( i18nc("@action:inmenu", "Add connection...") );
- action->setIcon( KIcon("list-add") );
+ action->setIcon( QIcon::fromTheme (QLatin1String ("list-add")) );
connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionCreate()) );
- action = collection->addAction("connection_remove");
+ action = collection->addAction(QLatin1String ("connection_remove"));
action->setText( i18nc("@action:inmenu", "Remove connection") );
- action->setIcon( KIcon("list-remove") );
+ action->setIcon( QIcon::fromTheme (QLatin1String ("list-remove")) );
connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionRemove()) );
- action = collection->addAction("connection_edit");
+ action = collection->addAction(QLatin1String ("connection_edit"));
action->setText( i18nc("@action:inmenu", "Edit connection...") );
- action->setIcon( KIcon("configure") );
+ action->setIcon( QIcon::fromTheme (QLatin1String ("configure")) );
connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionEdit()) );
- action = collection->addAction("connection_reconnect");
+ action = collection->addAction(QLatin1String ("connection_reconnect"));
action->setText( i18nc("@action:inmenu", "Reconnect") );
- action->setIcon( KIcon("view-refresh") );
+ action->setIcon( QIcon::fromTheme (QLatin1String ("view-refresh")) );
connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionReconnect()) );
- action = collection->addAction("connection_chooser");
+ action = collection->addAction(QLatin1String ("connection_chooser"));
action->setText( i18nc("@action:intoolbar", "Connection") );
action->setDefaultWidget(m_connectionsComboBox);
- action = collection->addAction("query_run");
+ action = collection->addAction(QLatin1String ("query_run"));
action->setText( i18nc("@action:inmenu", "Run query") );
- action->setIcon( KIcon("quickopen") );
+ action->setIcon( QIcon::fromTheme (QLatin1String ("quickopen")) );
action->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_E) );
connect( action , SIGNAL(triggered()) , this , SLOT(slotRunQuery()));
@@ -233,7 +235,7 @@ void KateSQLView::writeSessionConfig (KConfigBase* config, const QString& groupP
group.deleteGroup();
- KConfigGroup globalConfig(KGlobal::config(), "KateSQLPlugin");
+ KConfigGroup globalConfig(KSharedConfig::openConfig(), "KateSQLPlugin");
bool saveConnections = globalConfig.readEntry("SaveConnections", true);
if (saveConnections)
diff --git a/addons/kate/katesql/katesqlview.h b/addons/kate/katesql/katesqlview.h
index eece81f..d4745d4 100644
--- a/addons/kate/katesql/katesqlview.h
+++ b/addons/kate/katesql/katesqlview.h
@@ -38,7 +38,7 @@ class KateSQLView : public QObject, public KXMLGUIClient
Q_OBJECT
public:
- explicit KateSQLView(KTextEditor::MainWindow *mw);
+ KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mw);
~KateSQLView();
void readSessionConfig (KConfigBase* config, const QString& groupPrefix);