[rkward/frameworks] /: Remove more kdelibs4support classes and includes.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Jan 27 14:21:47 UTC 2016


Git commit d9cfd8fe7d516fc4fdd276b710f1bab6d7c56b3e by Thomas Friedrichsmeier.
Committed on 27/01/2016 at 14:21.
Pushed by tfry into branch 'frameworks'.

Remove more kdelibs4support classes and includes.

M  +1    -1    CMakeLists.txt
M  +3    -3    rkward/dialogs/startupdialog.cpp
M  +28   -0    rkward/misc/rkprogresscontrol.cpp
M  +0    -28   rkward/misc/rkprogresscontrol.h
M  +1    -1    rkward/rkconsole.cpp
M  +1    -1    rkward/rkward.cpp
M  +1    -1    rkward/settings/CMakeLists.txt
M  +1    -2    rkward/settings/rksettings.cpp
M  +0    -2    rkward/settings/rksettingsmodule.h
M  +3    -6    rkward/settings/rksettingsmoduleconsole.cpp
M  +1    -3    rkward/settings/rksettingsmodulegeneral.cpp
M  +1    -1    rkward/settings/rksettingsmodulegraphics.cpp
M  +1    -1    rkward/settings/rksettingsmoduleoutput.cpp
M  +3    -4    rkward/settings/rksettingsmoduleplugins.cpp
M  +2    -3    rkward/settings/rksettingsmoduler.cpp
M  +1    -1    rkward/settings/rksettingsmodulewatch.cpp

http://commits.kde.org/rkward/d9cfd8fe7d516fc4fdd276b710f1bab6d7c56b3e

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0605db..998e015 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ INCLUDE(ECMInstallIcons)
 INCLUDE(FeatureSummary)
 
 FIND_PACKAGE(Qt5 5.2 CONFIG REQUIRED COMPONENTS Widgets Core Xml Network WebKit Script)
-FIND_PACKAGE(KF5 5.0 REQUIRED COMPONENTS CoreAddons DocTools I18n XmlGui TextEditor WidgetsAddons KDELibs4Support WebKit Parts)
+FIND_PACKAGE(KF5 5.0 REQUIRED COMPONENTS CoreAddons DocTools I18n XmlGui TextEditor WidgetsAddons KDELibs4Support WebKit Parts Config)
 
 IF(FORCE_PRETTY_MAKEFILE)
 	SET(CMAKE_VERBOSE_MAKEFILE OFF)
diff --git a/rkward/dialogs/startupdialog.cpp b/rkward/dialogs/startupdialog.cpp
index 33c05e3..efa1f1d 100644
--- a/rkward/dialogs/startupdialog.cpp
+++ b/rkward/dialogs/startupdialog.cpp
@@ -89,12 +89,12 @@ StartupDialog::StartupDialog (QWidget *parent, StartupDialogResult *result, KRec
 	choser_layout->addWidget (file_list);
 	choser_layout->addWidget (remember_box = new QCheckBox (i18n ("Always do this on startup"), choser_box));
 
-	QDialogButtonBox *buttonBox = new QDialogButtonBox (QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+	QDialogButtonBox *buttonBox = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
 	QPushButton *okButton = buttonBox->button (QDialogButtonBox::Ok);
 	okButton->setDefault (true);
 	okButton->setShortcut (Qt::CTRL | Qt::Key_Return);
-	connect (buttonBox, SIGNAL (accepted()), this, SLOT (accept()));
-	connect (buttonBox, SIGNAL (rejected()), this, SLOT (reject()));
+	connect (buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+	connect (buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
 	vbox->addWidget (buttonBox);
 }
 
diff --git a/rkward/misc/rkprogresscontrol.cpp b/rkward/misc/rkprogresscontrol.cpp
index 0812e1f..955579f 100644
--- a/rkward/misc/rkprogresscontrol.cpp
+++ b/rkward/misc/rkprogresscontrol.cpp
@@ -24,6 +24,7 @@
 #include <QTimer>
 
 #include <klocale.h>
+#include <kdialog.h>
 
 #include "../rkglobals.h"
 #include "../rbackend/rinterface.h"
@@ -31,6 +32,33 @@
 
 #include "../debug.h"
 
+
+/** This class provides the dialog shown as part of an RKProgressControl. Generally you should not use this class directly, but rather use RKProgressControl. */
+class RKProgressControlDialog : public KDialog {
+public:
+/** constructor. */
+	RKProgressControlDialog (const QString &text, const QString &caption, int mode_flags, bool modal);
+/** destructor. */
+	~RKProgressControlDialog ();
+public:
+	void addOutput (const ROutput *output);
+	void setCloseTextToClose ();
+	void finished ();
+protected:
+	void closeEvent (QCloseEvent *e) override;
+	void scrollDown ();
+private:
+	QLabel *error_indicator;
+	QTextEdit *output_text;
+
+	QString output_button_text;
+
+	ROutput::ROutputType last_output_type;
+	bool prevent_close;
+	bool is_done;
+};
+
+
 RKProgressControl::RKProgressControl (QObject *parent, const QString &text, const QString &caption, int mode_flags) : QObject (parent) {
 	RK_TRACE (MISC);
 
diff --git a/rkward/misc/rkprogresscontrol.h b/rkward/misc/rkprogresscontrol.h
index bde318c..c3ee0bc 100644
--- a/rkward/misc/rkprogresscontrol.h
+++ b/rkward/misc/rkprogresscontrol.h
@@ -20,7 +20,6 @@
 #include <qobject.h>
 #include <QList>
 #include <qstring.h>
-#include <kdialog.h>
 
 #include "../rbackend/rcommandreceiver.h"
 
@@ -110,31 +109,4 @@ protected:
 	void rCommandDone (RCommand *command) override;
 };
 
-/** This class provides the dialog shown as part of an RKProgressControl. Generally you should not use this class directly, but rather use RKProgressControl. */
-class RKProgressControlDialog : public KDialog {
-	Q_OBJECT
-public:
-/** constructor. */
-	RKProgressControlDialog (const QString &text, const QString &caption, int mode_flags, bool modal);
-/** destructor. */
-	~RKProgressControlDialog ();
-public:
-	void addOutput (const ROutput *output);
-	void setCloseTextToClose ();
-	void finished ();
-protected:
-	void closeEvent (QCloseEvent *e) override;
-private slots:
-	void scrollDown ();
-private:
-	QLabel *error_indicator;
-	QTextEdit *output_text;
-
-	QString output_button_text;
-
-	ROutput::ROutputType last_output_type;
-	bool prevent_close;
-	bool is_done;
-};
-
 #endif
diff --git a/rkward/rkconsole.cpp b/rkward/rkconsole.cpp
index 38f6972..71e8137 100644
--- a/rkward/rkconsole.cpp
+++ b/rkward/rkconsole.cpp
@@ -814,7 +814,7 @@ void RKConsole::userLoadHistory (const QUrl &_url) {
 
 	QUrl url = _url;
 	if (url.isEmpty ()) {
-		url = QFileDialog::getOpenFileUrl (this, i18n ("Select command history file to load"), RKSettingsModuleGeneral::lastUsedUrlFor ("rscripts"), i18n ("R history files (*.Rhistory);;All files (*)"));
+		url = QFileDialog::getOpenFileUrl (this, i18n ("Select command history file to load"), RKSettingsModuleGeneral::lastUsedUrlFor ("rscripts"), i18n ("R history files [*.Rhistory](*.Rhistory);;All files [*](*)"));
 		if (url.isEmpty ()) return;
 		RKSettingsModuleGeneral::updateLastUsedUrl ("rscripts", url.adjusted (QUrl::RemoveFilename));
 	}
diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 03f800b..58614cf 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -801,7 +801,7 @@ void RKWardMainWindow::askOpenWorkspace (const QUrl &url) {
 	slotSetStatusBarText(i18n("Opening workspace..."));
 	QUrl lurl = url;
 	if (lurl.isEmpty ()) {
-		lurl = QFileDialog::getOpenFileUrl (this, i18n("Select workspace to open..."), RKSettingsModuleGeneral::lastUsedUrlFor ("workspaces"), i18n ("R Workspace Files (%1);;All files (*)", RKSettingsModuleGeneral::workspaceFilenameFilter ()));
+		lurl = QFileDialog::getOpenFileUrl (this, i18n("Select workspace to open..."), RKSettingsModuleGeneral::lastUsedUrlFor ("workspaces"), i18n ("R Workspace Files [%1](%1);;All files [*](*)", RKSettingsModuleGeneral::workspaceFilenameFilter ()));
 	}
 	if (!lurl.isEmpty ()) {
 		RKSettingsModuleGeneral::updateLastUsedUrl ("workspaces", lurl.adjusted (QUrl::RemoveFilename));
diff --git a/rkward/settings/CMakeLists.txt b/rkward/settings/CMakeLists.txt
index e07df94..b5e464f 100644
--- a/rkward/settings/CMakeLists.txt
+++ b/rkward/settings/CMakeLists.txt
@@ -28,4 +28,4 @@ IF (WIN32 OR USE_BINARY_PACKAGES)
 ENDIF (WIN32 OR USE_BINARY_PACKAGES)
 
 ADD_LIBRARY(settings STATIC ${settings_STAT_SRCS})
-TARGET_LINK_LIBRARIES(settings Qt5::Widgets KF5::WidgetsAddons Qt5::Xml KF5::KDELibs4Support)
\ No newline at end of file
+TARGET_LINK_LIBRARIES(settings Qt5::Widgets KF5::WidgetsAddons Qt5::Xml KF5::ConfigCore KF5::Parts)
\ No newline at end of file
diff --git a/rkward/settings/rksettings.cpp b/rkward/settings/rksettings.cpp
index 872ec97..c40d588 100644
--- a/rkward/settings/rksettings.cpp
+++ b/rkward/settings/rksettings.cpp
@@ -19,7 +19,6 @@
 #include <QPushButton>
 
 #include <klocale.h>
-#include <kglobal.h>
 
 #include "../windows/rkworkplace.h"
 
@@ -163,7 +162,7 @@ void RKSettings::applyAll () {
 		if (it.value ()->hasChanges ()) {
 			it.value ()->applyChanges ();
 			it.value ()->changed = false;
-			it.value ()->save (KGlobal::config ().data ());
+			it.value ()->save (KSharedConfig::openConfig ().data ());
 			tracker ()->signalSettingsChange (it.key ());
 		}
 	}
diff --git a/rkward/settings/rksettingsmodule.h b/rkward/settings/rksettingsmodule.h
index 9bbb199..1cd28d6 100644
--- a/rkward/settings/rksettingsmodule.h
+++ b/rkward/settings/rksettingsmodule.h
@@ -17,8 +17,6 @@
 #ifndef RKSETTINGSMODULE_H
 #define RKSETTINGSMODULE_H
 
-#include <KConfigGroup>
-
 #include <qstring.h>
 #include <qwidget.h>
 #include <QUrl>
diff --git a/rkward/settings/rksettingsmoduleconsole.cpp b/rkward/settings/rksettingsmoduleconsole.cpp
index 6ed55fb..6744f2a 100644
--- a/rkward/settings/rksettingsmoduleconsole.cpp
+++ b/rkward/settings/rksettingsmoduleconsole.cpp
@@ -17,17 +17,14 @@
 #include "rksettingsmoduleconsole.h"
 
 #include <klocale.h>
-#include <kconfig.h>
 #include <kconfiggroup.h>
-#include <knuminput.h>
-#include <kapplication.h>
-#include <kglobal.h>
 
 #include <qlayout.h>
 #include <qcheckbox.h>
 #include <qlabel.h>
 #include <QVBoxLayout>
 #include <QComboBox>
+#include <QSpinBox>
 
 #include "../rbackend/rcommand.h"
 #include "../rkglobals.h"
@@ -148,7 +145,7 @@ void RKSettingsModuleConsole::loadSettings (KConfig *config) {
 QStringList RKSettingsModuleConsole::loadCommandHistory () {
 	RK_TRACE (SETTINGS);
 
-	KConfigGroup cg = KGlobal::config ()->group ("Console Settings");
+	KConfigGroup cg = KSharedConfig::openConfig ()->group ("Console Settings");
 	return cg.readEntry ("history", QStringList ());
 }
 
@@ -156,7 +153,7 @@ QStringList RKSettingsModuleConsole::loadCommandHistory () {
 void RKSettingsModuleConsole::saveCommandHistory (const QStringList &list) {
 	RK_TRACE (SETTINGS);
 
-	KConfigGroup cg = KGlobal::config ()->group ("Console Settings");
+	KConfigGroup cg = KSharedConfig::openConfig ()->group ("Console Settings");
 	if (save_history) {
 		cg.writeEntry ("history", list);
 	}
diff --git a/rkward/settings/rksettingsmodulegeneral.cpp b/rkward/settings/rksettingsmodulegeneral.cpp
index 75ff1fd..1ec650c 100644
--- a/rkward/settings/rksettingsmodulegeneral.cpp
+++ b/rkward/settings/rksettingsmodulegeneral.cpp
@@ -17,9 +17,7 @@
 #include "rksettingsmodulegeneral.h"
 
 #include <klocale.h>
-#include <kconfig.h>
-#include <kglobal.h>
-#include <kstandarddirs.h>
+#include <KConfigGroup>
 
 #include <qlayout.h>
 #include <qlabel.h>
diff --git a/rkward/settings/rksettingsmodulegraphics.cpp b/rkward/settings/rksettingsmodulegraphics.cpp
index 4059b0c..cc204d4 100644
--- a/rkward/settings/rksettingsmodulegraphics.cpp
+++ b/rkward/settings/rksettingsmodulegraphics.cpp
@@ -19,7 +19,6 @@
 #include <klocale.h>
 #include <kconfig.h>
 #include <kconfiggroup.h>
-#include <knuminput.h>
 
 #include <qlayout.h>
 #include <qlabel.h>
@@ -29,6 +28,7 @@
 #include <QButtonGroup>
 #include <QLineEdit>
 #include <QRadioButton>
+#include <QSpinBox>
 
 #include "../rkglobals.h"
 #include "../rbackend/rinterface.h"
diff --git a/rkward/settings/rksettingsmoduleoutput.cpp b/rkward/settings/rksettingsmoduleoutput.cpp
index 5997840..0939972 100644
--- a/rkward/settings/rksettingsmoduleoutput.cpp
+++ b/rkward/settings/rksettingsmoduleoutput.cpp
@@ -19,7 +19,6 @@
 #include <klocale.h>
 #include <kconfig.h>
 #include <kconfiggroup.h>
-#include <knuminput.h>
 
 #include <qlayout.h>
 #include <qlabel.h>
@@ -27,6 +26,7 @@
 #include <qcheckbox.h>
 #include <QVBoxLayout>
 #include <QComboBox>
+#include <QSpinBox>
 
 #include "../rkglobals.h"
 #include "../rbackend/rinterface.h"
diff --git a/rkward/settings/rksettingsmoduleplugins.cpp b/rkward/settings/rksettingsmoduleplugins.cpp
index c9e2a77..f4097bd 100644
--- a/rkward/settings/rksettingsmoduleplugins.cpp
+++ b/rkward/settings/rksettingsmoduleplugins.cpp
@@ -17,11 +17,9 @@
 #include "rksettingsmoduleplugins.h"
 
 #include <klocale.h>
-#include <kconfig.h>
-#include <kfiledialog.h>
 #include <kmessagebox.h>
-#include <khbox.h>
 #include <kdeversion.h>
+#include <KConfigGroup>
 
 #include <qlayout.h>
 #include <qlabel.h>
@@ -31,6 +29,7 @@
 #include <qcheckbox.h>
 #include <QVBoxLayout>
 #include <QPushButton>
+#include <QFileDialog>
 
 #include "../rkward.h"
 #include "../rkglobals.h"
@@ -499,7 +498,7 @@ bool RKSettingsModulePluginsModel::setData (const QModelIndex& index, const QVar
 void RKSettingsModulePluginsModel::insertNewStrings (int above_row) {
 	RK_TRACE (SETTINGS);
 
-	QStringList files = KFileDialog::getOpenFileNames (QUrl::fromLocalFile (RKCommonFunctions::getRKWardDataDir ()), "*.pluginmap", static_cast<QWidget*> (QObject::parent ()), i18n ("Select .pluginmap-file"));
+	QStringList files = QFileDialog::getOpenFileNames (static_cast<QWidget*> (QObject::parent ()), i18n ("Select .pluginmap-file"), RKCommonFunctions::getRKWardDataDir (), "RKWard pluginmap files [*.pluginmap](*.pluginmap)");
 
 	// already known files are activated, but not added
 	for (int i = files.size () -1; i >= 0; --i) {
diff --git a/rkward/settings/rksettingsmoduler.cpp b/rkward/settings/rksettingsmoduler.cpp
index d2ff5a0..34d24c8 100644
--- a/rkward/settings/rksettingsmoduler.cpp
+++ b/rkward/settings/rksettingsmoduler.cpp
@@ -17,10 +17,8 @@
 #include "rksettingsmoduler.h"
 
 #include <klocale.h>
-#include <kconfig.h>
-#include <kstandarddirs.h>
 #include <kinputdialog.h>
-#include <knuminput.h>
+#include <KConfigGroup>
 
 #include <qlabel.h>
 #include <qcheckbox.h>
@@ -31,6 +29,7 @@
 #include <QPushButton>
 #include <QTextEdit>
 #include <QFileDialog>
+#include <QSpinBox>
 
 #include "rksettingsmodulegeneral.h"
 #include "../core/robject.h"
diff --git a/rkward/settings/rksettingsmodulewatch.cpp b/rkward/settings/rksettingsmodulewatch.cpp
index 6757409..6900e04 100644
--- a/rkward/settings/rksettingsmodulewatch.cpp
+++ b/rkward/settings/rksettingsmodulewatch.cpp
@@ -19,12 +19,12 @@
 #include <klocale.h>
 #include <kconfig.h>
 #include <kconfiggroup.h>
-#include <knuminput.h>
 
 #include <qcheckbox.h>
 #include <qlabel.h>
 #include <QGridLayout>
 #include <QVBoxLayout>
+#include <QSpinBox>
 
 #include "../rbackend/rcommand.h"
 #include "rksettings.h"



More information about the rkward-tracker mailing list