aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-20 11:50:01 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-20 11:50:01 (GMT)
commit654f8da8260c078ff7773e8af11643b72081995d (patch)
tree67dc92e164a963dfafedb5b83d1b2efca1bd9571
parentf2f646040f5cfe63f80c81465454f63b96158615 (diff)
kate sql is back
-rw-r--r--CMakeLists.txt2
-rw-r--r--addons/kate/CMakeLists.txt2
-rw-r--r--addons/kate/katesql/exportwizard.cpp30
-rw-r--r--addons/kate/katesql/katesql.desktop3
-rw-r--r--addons/kate/katesql/katesqlconfigpage.cpp7
-rw-r--r--addons/kate/katesql/outputstylewidget.cpp31
-rw-r--r--addons/kate/katesql/outputwidget.cpp4
7 files changed, 40 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3f87ed..eabfe70 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,7 +34,7 @@ include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
-find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Widgets Script Test)
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Widgets Script Sql Test)
# Load the frameworks we need
find_package(KF5 CONFIG REQUIRED COMPONENTS
diff --git a/addons/kate/CMakeLists.txt b/addons/kate/CMakeLists.txt
index 1272410..21a555e 100644
--- a/addons/kate/CMakeLists.txt
+++ b/addons/kate/CMakeLists.txt
@@ -43,7 +43,7 @@ add_subdirectory( kate-ctags )
#add_subdirectory( tabify )
-#add_subdirectory( katesql )
+ecm_optional_add_subdirectory ( katesql )
#add_subdirectory( close-except-like )
diff --git a/addons/kate/katesql/exportwizard.cpp b/addons/kate/katesql/exportwizard.cpp
index 09aeb13..600bb88 100644
--- a/addons/kate/katesql/exportwizard.cpp
+++ b/addons/kate/katesql/exportwizard.cpp
@@ -66,7 +66,7 @@ ExportOutputPage::ExportOutputPage(QWidget *parent)
fileUrl = new KUrlRequester(this);
fileUrl->setMode(KFile::File);
- fileUrl->setFilter("*.csv|Comma Separated Values\n*|All files");
+ fileUrl->setFilter(i18n("*.csv|Comma Separated Values\n*|All files"));
fileLayout->addWidget(fileUrl);
@@ -77,10 +77,10 @@ ExportOutputPage::ExportOutputPage(QWidget *parent)
setLayout(layout);
- registerField("outDocument", documentRadioButton);
- registerField("outClipboard", clipboardRadioButton);
- registerField("outFile", fileRadioButton);
- registerField("outFileUrl", fileUrl, "text");
+ registerField(QLatin1String("outDocument"), documentRadioButton);
+ registerField(QLatin1String("outClipboard"), clipboardRadioButton);
+ registerField(QLatin1String("outFile"), fileRadioButton);
+ registerField(QLatin1String("outFileUrl"), fileUrl, "text");
connect(fileRadioButton, SIGNAL(toggled(bool)), fileUrl, SLOT(setEnabled(bool)));
}
@@ -165,13 +165,13 @@ ExportFormatPage::ExportFormatPage(QWidget *parent)
setLayout(layout);
- registerField("exportColumnNames", exportColumnNamesCheckBox);
- registerField("exportLineNumbers", exportLineNumbersCheckBox);
- registerField("checkQuoteStrings", quoteStringsCheckBox);
- registerField("checkQuoteNumbers", quoteNumbersCheckBox);
- registerField("quoteStringsChar", quoteStringsLine);
- registerField("quoteNumbersChar", quoteNumbersLine);
- registerField("fieldDelimiter*", fieldDelimiterLine);
+ registerField(QLatin1String("exportColumnNames"), exportColumnNamesCheckBox);
+ registerField(QLatin1String("exportLineNumbers"), exportLineNumbersCheckBox);
+ registerField(QLatin1String("checkQuoteStrings"), quoteStringsCheckBox);
+ registerField(QLatin1String("checkQuoteNumbers"), quoteNumbersCheckBox);
+ registerField(QLatin1String("quoteStringsChar"), quoteStringsLine);
+ registerField(QLatin1String("quoteNumbersChar"), quoteNumbersLine);
+ registerField(QLatin1String("fieldDelimiter*"), fieldDelimiterLine);
connect(quoteStringsCheckBox, SIGNAL(toggled(bool)), quoteStringsLine, SLOT(setEnabled(bool)));
connect(quoteNumbersCheckBox, SIGNAL(toggled(bool)), quoteNumbersLine, SLOT(setEnabled(bool)));
@@ -187,9 +187,9 @@ void ExportFormatPage::initializePage()
quoteStringsLine->setEnabled(false);
quoteNumbersLine->setEnabled(false);
- quoteStringsLine->setText("\"");
- quoteNumbersLine->setText("\"");
- fieldDelimiterLine->setText("\\t");
+ quoteStringsLine->setText(QLatin1String("\""));
+ quoteNumbersLine->setText(QLatin1String("\""));
+ fieldDelimiterLine->setText(QLatin1String("\\t"));
}
diff --git a/addons/kate/katesql/katesql.desktop b/addons/kate/katesql/katesql.desktop
index 652a4da..b7cb49b 100644
--- a/addons/kate/katesql/katesql.desktop
+++ b/addons/kate/katesql/katesql.desktop
@@ -1,8 +1,7 @@
[Desktop Entry]
Type=Service
-ServiceTypes=Kate/Plugin
+ServiceTypes=KTextEditor/Plugin
X-KDE-Library=katesqlplugin
-X-Kate-Version=3.0
Name=SQL Plugin
Name[ast]=Complementu SQL
Name[bg]=Приставка за SQL
diff --git a/addons/kate/katesql/katesqlconfigpage.cpp b/addons/kate/katesql/katesqlconfigpage.cpp
index 041a9d3..e7491ea 100644
--- a/addons/kate/katesql/katesqlconfigpage.cpp
+++ b/addons/kate/katesql/katesqlconfigpage.cpp
@@ -21,6 +21,7 @@
#include <kconfiggroup.h>
#include <klocalizedstring.h>
+#include <KSharedConfig>
#include <qboxlayout.h>
#include <qgroupbox.h>
@@ -59,7 +60,7 @@ KateSQLConfigPage::~KateSQLConfigPage()
void KateSQLConfigPage::apply()
{
- KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
+ KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
config.writeEntry("SaveConnections", m_box->isChecked());
@@ -73,7 +74,7 @@ void KateSQLConfigPage::apply()
void KateSQLConfigPage::reset()
{
- KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
+ KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
m_box->setChecked(config.readEntry("SaveConnections", true));
@@ -83,7 +84,7 @@ void KateSQLConfigPage::reset()
void KateSQLConfigPage::defaults()
{
- KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
+ KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
config.revertToDefault("SaveConnections");
config.revertToDefault("OutputCustomization");
diff --git a/addons/kate/katesql/outputstylewidget.cpp b/addons/kate/katesql/outputstylewidget.cpp
index 321da17..2774b1d 100644
--- a/addons/kate/katesql/outputstylewidget.cpp
+++ b/addons/kate/katesql/outputstylewidget.cpp
@@ -22,13 +22,14 @@
#include <qfont.h>
#include <qbrush.h>
#include <qvariant.h>
+#include <QIcon>
+#include <QFontDatabase>
+#include <KSharedConfig>
#include <kcolorbutton.h>
-#include <kicon.h>
#include <klocalizedstring.h>
#include <kconfig.h>
#include <kconfiggroup.h>
-#include <kglobalsettings.h>
#include <kcolorscheme.h>
OutputStyleWidget::OutputStyleWidget(QWidget *parent)
@@ -45,17 +46,17 @@ OutputStyleWidget::OutputStyleWidget(QWidget *parent)
setHeaderLabels(headerLabels);
- headerItem()->setIcon(1, KIcon("format-text-bold"));
- headerItem()->setIcon(2, KIcon("format-text-italic"));
- headerItem()->setIcon(3, KIcon("format-text-underline"));
- headerItem()->setIcon(4, KIcon("format-text-strikethrough"));
+ headerItem()->setIcon(1, QIcon::fromTheme(QLatin1String("format-text-bold")));
+ headerItem()->setIcon(2, QIcon::fromTheme(QLatin1String("format-text-italic")));
+ headerItem()->setIcon(3, QIcon::fromTheme(QLatin1String("format-text-underline")));
+ headerItem()->setIcon(4, QIcon::fromTheme(QLatin1String("format-text-strikethrough")));
- addContext("text", i18nc("@item:intable", "Text"));
- addContext("number", i18nc("@item:intable", "Number"));
- addContext("bool", i18nc("@item:intable", "Bool"));
- addContext("datetime", i18nc("@item:intable", "Date & Time"));
- addContext("null", i18nc("@item:intable", "NULL"));
- addContext("blob", i18nc("@item:intable", "BLOB"));
+ addContext(QLatin1String("text"), i18nc("@item:intable", "Text"));
+ addContext(QLatin1String("number"), i18nc("@item:intable", "Number"));
+ addContext(QLatin1String("bool"), i18nc("@item:intable", "Bool"));
+ addContext(QLatin1String("datetime"), i18nc("@item:intable", "Date & Time"));
+ addContext(QLatin1String("null"), i18nc("@item:intable", "NULL"));
+ addContext(QLatin1String("blob"), i18nc("@item:intable", "BLOB"));
for (int i = 0; i < columnCount(); ++i)
resizeColumnToContents(i);
@@ -110,7 +111,7 @@ QTreeWidgetItem* OutputStyleWidget::addContext(const QString &key, const QString
void OutputStyleWidget::readConfig(QTreeWidgetItem *item)
{
- KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
+ KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
KConfigGroup g = config.group("OutputCustomization").group(item->data(0, Qt::UserRole).toString());
QCheckBox *boldCheckBox = static_cast<QCheckBox*>(itemWidget(item, 1));
@@ -134,7 +135,7 @@ void OutputStyleWidget::readConfig(QTreeWidgetItem *item)
void OutputStyleWidget::writeConfig(QTreeWidgetItem *item)
{
- KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
+ KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
KConfigGroup g = config.group("OutputCustomization").group(item->data(0, Qt::UserRole).toString());
@@ -169,7 +170,7 @@ void OutputStyleWidget::readConfig()
void OutputStyleWidget::writeConfig()
{
- KConfigGroup config(KGlobal::config(), "KateSQLPlugin");
+ KConfigGroup config(KSharedConfig::openConfig(), "KateSQLPlugin");
config.deleteGroup("OutputCustomization");
QTreeWidgetItem *root = invisibleRootItem();
diff --git a/addons/kate/katesql/outputwidget.cpp b/addons/kate/katesql/outputwidget.cpp
index d2b5a4d..bb047b7 100644
--- a/addons/kate/katesql/outputwidget.cpp
+++ b/addons/kate/katesql/outputwidget.cpp
@@ -29,9 +29,9 @@ KateSQLOutputWidget::KateSQLOutputWidget (QWidget *parent)
{
addTab (m_textOutputWidget=new TextOutputWidget (this),
- SmallIcon("view-list-text"), i18nc("@title:window", "SQL Text Output"));
+ QIcon::fromTheme(QLatin1String("view-list-text")), i18nc("@title:window", "SQL Text Output"));
addTab (m_dataOutputWidget=new DataOutputWidget(this),
- SmallIcon("view-form-table"),i18nc("@title:window", "SQL Data Output"));
+ QIcon::fromTheme(QLatin1String("view-form-table")),i18nc("@title:window", "SQL Data Output"));
}