summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-20 00:59:41 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-20 00:59:41 (GMT)
commitab4e7210cce190515e14c77696882dcf4b4715d7 (patch)
tree738762b4151db748ea2a5442bff1c3a83fc6e19c
parent97c3db1dc58460573fa9aa9e71c7a7f7e45e0f7b (diff)
more ported
-rw-r--r--addons/kate/katesql/connectionmodel.h5
-rw-r--r--addons/kate/katesql/dataoutputwidget.h6
-rw-r--r--addons/kate/katesql/katesqlview.cpp40
-rw-r--r--addons/kate/katesql/katesqlview.h4
-rw-r--r--addons/kate/katesql/schemabrowserwidget.h4
5 files changed, 29 insertions, 30 deletions
diff --git a/addons/kate/katesql/connectionmodel.h b/addons/kate/katesql/connectionmodel.h
index dd656c0..07d2877 100644
--- a/addons/kate/katesql/connectionmodel.h
+++ b/addons/kate/katesql/connectionmodel.h
@@ -21,8 +21,7 @@
#include "connection.h"
-#include <kicon.h>
-
+#include <QIcon>
#include <QAbstractListModel>
#include <qstring.h>
#include <qhash.h>
@@ -53,7 +52,7 @@ class ConnectionModel : public QAbstractListModel
private:
QHash<QString, Connection> m_connections;
- QHash<Connection::Status, KIcon> m_icons;
+ QHash<Connection::Status, QIcon> m_icons;
};
#endif // CONNECTIONMODEL_H
diff --git a/addons/kate/katesql/dataoutputwidget.h b/addons/kate/katesql/dataoutputwidget.h
index 92d4e06..eb57265 100644
--- a/addons/kate/katesql/dataoutputwidget.h
+++ b/addons/kate/katesql/dataoutputwidget.h
@@ -44,9 +44,9 @@ class DataOutputWidget : public QWidget
~DataOutputWidget();
void exportData(QTextStream &stream,
- const QChar stringsQuoteChar = '\0',
- const QChar numbersQuoteChar = '\0',
- const QString fieldDelimiter = "\t",
+ const QChar stringsQuoteChar = QLatin1Char ('\0'),
+ const QChar numbersQuoteChar = QLatin1Char ('\0'),
+ const QString fieldDelimiter = QLatin1String ("\t"),
const Options opt = NoOptions);
DataOutputModel *model() const { return m_model; }
diff --git a/addons/kate/katesql/katesqlview.cpp b/addons/kate/katesql/katesqlview.cpp
index 060232d..56d2181 100644
--- a/addons/kate/katesql/katesqlview.cpp
+++ b/addons/kate/katesql/katesqlview.cpp
@@ -29,9 +29,9 @@
#include "connectionwizard.h"
#include "outputwidget.h"
-#include <kate/plugin.h>
-#include <kate/mainwindow.h>
-#include <kate/documentmanager.h>
+#include <ktexteditor/plugin.h>
+#include <ktexteditor/mainwindow.h>
+#include <ktexteditor/application.h>
#include <ktexteditor/document.h>
#include <ktexteditor/view.h>
@@ -49,21 +49,22 @@
#include <QVBoxLayout>
#include <QApplication>
-KateSQLView::KateSQLView(Kate::MainWindow *mw)
-: Kate::PluginView (mw)
-, Kate::XMLGUIClient(KateSQLFactory::componentData())
+KateSQLView::KateSQLView(KTextEditor::MainWindow *mw)
+: QObject (mw)
+, KXMLGUIClient()
, m_manager (new SQLManager(this))
+, m_mainWindow (mw)
{
- m_outputToolView = mw->createToolView("kate_private_plugin_katesql_output",
- Kate::MainWindow::Bottom,
- SmallIcon("view-form-table"),
+ m_outputToolView = mw->createToolView(QLatin1String ("kate_private_plugin_katesql_output"),
+ KTextEditor::MainWindow::Bottom,
+ QIcon::fromTheme ("view-form-table"),
i18nc("@title:window", "SQL Results")
);
- m_schemaBrowserToolView = mw->createToolView("kate_private_plugin_katesql_schemabrowser",
- Kate::MainWindow::Left,
- SmallIcon("view-list-tree"),
+ m_schemaBrowserToolView = mw->createToolView(QLatin1String ("kate_private_plugin_katesql_schemabrowser"),
+ KTextEditor::MainWindow::Left,
+ QIcon::fromTheme ("view-list-tree"),
i18nc("@title:window", "SQL Schema Browser")
);
@@ -79,7 +80,7 @@ KateSQLView::KateSQLView(Kate::MainWindow *mw)
setupActions();
- mainWindow()->guiFactory()->addClient(this);
+ m_mainWindow->guiFactory()->addClient(this);
QMenu *sqlMenu = (QMenu*)factory()->container("SQL", this);
@@ -102,7 +103,7 @@ KateSQLView::KateSQLView(Kate::MainWindow *mw)
KateSQLView::~KateSQLView()
{
- mainWindow()->guiFactory()->removeClient( this );
+ m_mainWindow->guiFactory()->removeClient( this );
delete m_outputToolView;
delete m_schemaBrowserToolView;
@@ -330,10 +331,7 @@ void KateSQLView::slotRunQuery()
return;
}
- if (!mainWindow())
- return;
-
- KTextEditor::View *view = mainWindow()->activeView();
+ KTextEditor::View *view = m_mainWindow->activeView();
if (!view)
return;
@@ -352,7 +350,7 @@ void KateSQLView::slotError(const QString &message)
{
m_outputWidget->textOutputWidget()->showErrorMessage(message);
m_outputWidget->setCurrentWidget(m_outputWidget->textOutputWidget());
- mainWindow()->showToolView(m_outputToolView);
+ m_mainWindow->showToolView(m_outputToolView);
}
@@ -361,7 +359,7 @@ void KateSQLView::slotSuccess(const QString &message)
{
m_outputWidget->textOutputWidget()->showSuccessMessage(message);
m_outputWidget->setCurrentWidget(m_outputWidget->textOutputWidget());
- mainWindow()->showToolView(m_outputToolView);
+ m_mainWindow->showToolView(m_outputToolView);
}
@@ -374,7 +372,7 @@ void KateSQLView::slotQueryActivated(QSqlQuery &query, const QString &connection
m_outputWidget->dataOutputWidget()->showQueryResultSets(query);
m_outputWidget->setCurrentWidget(m_outputWidget->dataOutputWidget());
- mainWindow()->showToolView(m_outputToolView);
+ m_mainWindow->showToolView(m_outputToolView);
}
}
diff --git a/addons/kate/katesql/katesqlview.h b/addons/kate/katesql/katesqlview.h
index 532dd69..eece81f 100644
--- a/addons/kate/katesql/katesqlview.h
+++ b/addons/kate/katesql/katesqlview.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ Boston, MA 02110-1301, USA
*/
#ifndef KATESQLVIEW_H
@@ -80,6 +80,8 @@ class KateSQLView : public QObject, public KXMLGUIClient
SQLManager *m_manager;
QString m_currentResultsetConnection;
+
+ KTextEditor::MainWindow *m_mainWindow;
};
#endif // KATESQLVIEW_H
diff --git a/addons/kate/katesql/schemabrowserwidget.h b/addons/kate/katesql/schemabrowserwidget.h
index 808e8bc..58c937f 100644
--- a/addons/kate/katesql/schemabrowserwidget.h
+++ b/addons/kate/katesql/schemabrowserwidget.h
@@ -22,9 +22,9 @@
class SQLManager;
class SchemaWidget;
-#include <kvbox.h>
+#include <QWidget>
-class SchemaBrowserWidget : public KVBox
+class SchemaBrowserWidget : public QWidget
{
Q_OBJECT