[rkward/frameworks] rkward: Further KF5 porting:

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


Git commit f2d8365671e26232ecce2c90a2fa7cd8d2a045e5 by Thomas Friedrichsmeier.
Committed on 27/01/2016 at 10:05.
Pushed by tfry into branch 'frameworks'.

Further KF5 porting:
Slowly trying to get rid of kdelibs4support classes.

M  +1    -1    rkward/CMakeLists.txt
M  +1    -0    rkward/dataeditor/twintable.cpp
M  +20   -10   rkward/dialogs/startupdialog.cpp
M  +2    -2    rkward/dialogs/startupdialog.h
M  +3    -2    rkward/main.cpp
M  +1    -0    rkward/plugin/rkcomponentmap.cpp
M  +1    -0    rkward/rkward.cpp
M  +0    -1    rkward/rkward.h
M  +1    -1    rkward/settings/CMakeLists.txt
M  +0    -2    rkward/settings/rksettings.cpp
M  +2    -0    rkward/settings/rksettingsmodule.h
M  +3    -2    rkward/windows/rkhtmlwindow.cpp
M  +1    -1    rkward/windows/rktoplevelwindowgui.cpp
M  +1    -0    rkward/windows/rkworkplace.cpp

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

diff --git a/rkward/CMakeLists.txt b/rkward/CMakeLists.txt
index 70c50f5..a3b8408 100644
--- a/rkward/CMakeLists.txt
+++ b/rkward/CMakeLists.txt
@@ -59,7 +59,7 @@ IF(Q_WS_MAC)
 		@ONLY)
 ENDIF(Q_WS_MAC)
 
-TARGET_LINK_LIBRARIES(rkward.frontend  windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc KF5::KDELibs4Support KF5::WindowSystem Qt5::Widgets KF5::XmlGui ${GETTEXT_LIBRARIES})
+TARGET_LINK_LIBRARIES(rkward.frontend  windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc KF5::WindowSystem Qt5::Widgets KF5::XmlGui ${GETTEXT_LIBRARIES})
 
 # wrapper executable
 GET_DIRECTORY_PROPERTY(R_EXECUTABLE DIRECTORY rbackend DEFINITION R_EXECUTABLE)
diff --git a/rkward/dataeditor/twintable.cpp b/rkward/dataeditor/twintable.cpp
index 99a504e..b64849b 100644
--- a/rkward/dataeditor/twintable.cpp
+++ b/rkward/dataeditor/twintable.cpp
@@ -30,6 +30,7 @@
 #include <QMenu>
 #include <QVBoxLayout>
 #include <QHeaderView>
+#include <QApplication>
 
 #include "twintablemember.h"
 #include "rkvareditmodel.h"
diff --git a/rkward/dialogs/startupdialog.cpp b/rkward/dialogs/startupdialog.cpp
index 3e1747d6..33c05e3 100644
--- a/rkward/dialogs/startupdialog.cpp
+++ b/rkward/dialogs/startupdialog.cpp
@@ -29,31 +29,33 @@
 #include <QFileInfo>
 
 #include <klocale.h>
-#include <kvbox.h>
 #include <krecentfilesaction.h>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
 
 #include "../settings/rksettingsmodulegeneral.h"
 #include "../misc/rkcommonfunctions.h"
 #include "../debug.h"
 
-StartupDialog::StartupDialog (QWidget *parent, StartupDialogResult *result, KRecentFilesAction *recent_files) : KDialog (parent) {
+StartupDialog::StartupDialog (QWidget *parent, StartupDialogResult *result, KRecentFilesAction *recent_files) : QDialog (parent) {
 	RK_TRACE (DIALOGS);
 
 	setModal (true);
-	setButtons (KDialog::Ok | KDialog::Cancel);
-
 	StartupDialog::result = result;
 
-	setCaption (i18n ("What would you like to do?"));
+	setWindowTitle (i18n ("What would you like to do?"));
 
-	KVBox *vbox = new KVBox (this);
-	setMainWidget (vbox);
+	QVBoxLayout *vbox = new QVBoxLayout ();
+	setLayout (vbox);
 	
-	QLabel *pic = new QLabel (vbox);
+	QLabel *pic = new QLabel (this);
+	vbox->addWidget (pic);
 	pic->setPixmap (QPixmap (RKCommonFunctions::getRKWardDataDir () + "icons/rkward_logo.png"));
 
 	choser = new QButtonGroup (this);
-	QGroupBox* choser_box = new QGroupBox (vbox);
+	QGroupBox* choser_box = new QGroupBox (this);
+	vbox->addWidget (choser_box);
 	QVBoxLayout* choser_layout = new QVBoxLayout(choser_box);
 
 	choser_layout->addWidget (empty_workspace_button = new QRadioButton (i18n ("Start with an empty workspace"), choser_box));
@@ -86,6 +88,14 @@ StartupDialog::StartupDialog (QWidget *parent, StartupDialogResult *result, KRec
 	connect (file_list, &QListWidget::itemDoubleClicked, this, &StartupDialog::listDoubleClicked);
 	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);
+	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()));
+	vbox->addWidget (buttonBox);
 }
 
 StartupDialog::~StartupDialog() {
@@ -168,7 +178,7 @@ void StartupDialog::showEvent (QShowEvent *event) {
 
 	// somehow, trying to achieve this in the ctor leads to the dialog never actually being shown (KDE4.0 beta)
 	setFixedWidth (width ());
-	KDialog::showEvent (event);
+	QDialog::showEvent (event);
 }
 
 // static
diff --git a/rkward/dialogs/startupdialog.h b/rkward/dialogs/startupdialog.h
index 9722e70..883305b 100644
--- a/rkward/dialogs/startupdialog.h
+++ b/rkward/dialogs/startupdialog.h
@@ -17,7 +17,7 @@
 #ifndef STARTUPDIALOG_H
 #define STARTUPDIALOG_H
 
-#include <kdialog.h>
+#include <QDialog>
 #include <QUrl>
 
 class QCheckBox;
@@ -33,7 +33,7 @@ This class represents the startup dialog asking you whether to open a recent fil
 @author Thomas Friedrichsmeier
 */
 /// the startup dialog
-class StartupDialog : public KDialog {
+class StartupDialog : public QDialog {
 Q_OBJECT
 public:
 	/** enum to hold result of StartupDialog. WARNING: do not change the numeric values! They are saved as user settings in the config (@see RKSettingsModuleGeneral). */
diff --git a/rkward/main.cpp b/rkward/main.cpp
index 1d97161..75d37cb 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -56,17 +56,18 @@
 #include <kstandarddirs.h>
 #include <kglobal.h>
 #include <KUrlAuthorized>
-#include <QUrl>
 
 #include <qstring.h>
 #include <QMutex>
 #include <QTemporaryFile>
 #include <QDir>
 #include <QThread>
+#include <QApplication>
+#include <QUrl>
+#include <QCommandLineParser>
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <QCommandLineParser>
 
 #include "rkward.h"
 #include "rkglobals.h"
diff --git a/rkward/plugin/rkcomponentmap.cpp b/rkward/plugin/rkcomponentmap.cpp
index 09160bc..f046e82 100644
--- a/rkward/plugin/rkcomponentmap.cpp
+++ b/rkward/plugin/rkcomponentmap.cpp
@@ -22,6 +22,7 @@
 #include <QTime>
 #include <QObjectCleanupHandler>
 #include <QSet>
+#include <QGuiApplication>
 
 #include <klocale.h>
 #include <kactioncollection.h>
diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 9cc2616..03f800b 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -20,6 +20,7 @@
 #include <QDesktopWidget>
 #include <QCloseEvent>
 #include <QPointer>
+#include <QApplication>
 
 // include files for KDE
 #include <kmessagebox.h>
diff --git a/rkward/rkward.h b/rkward/rkward.h
index 80edeff..7a7da48 100644
--- a/rkward/rkward.h
+++ b/rkward/rkward.h
@@ -18,7 +18,6 @@
 #ifndef RKWARD_H
 #define RKWARD_H
 
-#include <kapplication.h>
 #include <QAction>
 #include <QUrl>
 #include <kparts/mainwindow.h>
diff --git a/rkward/settings/CMakeLists.txt b/rkward/settings/CMakeLists.txt
index f587a68..e07df94 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::KDELibs4Support)
\ No newline at end of file
+TARGET_LINK_LIBRARIES(settings Qt5::Widgets KF5::WidgetsAddons Qt5::Xml KF5::KDELibs4Support)
\ No newline at end of file
diff --git a/rkward/settings/rksettings.cpp b/rkward/settings/rksettings.cpp
index 76f1002..872ec97 100644
--- a/rkward/settings/rksettings.cpp
+++ b/rkward/settings/rksettings.cpp
@@ -19,9 +19,7 @@
 #include <QPushButton>
 
 #include <klocale.h>
-#include <kapplication.h>
 #include <kglobal.h>
-#include <kvbox.h>
 
 #include "../windows/rkworkplace.h"
 
diff --git a/rkward/settings/rksettingsmodule.h b/rkward/settings/rksettingsmodule.h
index 1cd28d6..9bbb199 100644
--- a/rkward/settings/rksettingsmodule.h
+++ b/rkward/settings/rksettingsmodule.h
@@ -17,6 +17,8 @@
 #ifndef RKSETTINGSMODULE_H
 #define RKSETTINGSMODULE_H
 
+#include <KConfigGroup>
+
 #include <qstring.h>
 #include <qwidget.h>
 #include <QUrl>
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index 4ef4fee..f15ecb0 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -18,7 +18,6 @@
 
 #include <klibloader.h>
 #include <klocale.h>
-#include <QIcon>
 #include <kmessagebox.h>
 #include <kparts/plugin.h>
 #include <kactioncollection.h>
@@ -26,7 +25,6 @@
 #include <kmimetype.h>
 #include <kio/job.h>
 #include <kservice.h>
-#include <QTemporaryFile>
 #include <kwebview.h>
 #include <kcodecaction.h>
 #include <kglobalsettings.h>
@@ -44,6 +42,9 @@
 #include <QMenu>
 #include <QTextCodec>
 #include <QFontDatabase>
+#include <QTemporaryFile>
+#include <QGuiApplication>
+#include <QIcon>
 
 #include "../rkglobals.h"
 #include "../rbackend/rinterface.h"
diff --git a/rkward/windows/rktoplevelwindowgui.cpp b/rkward/windows/rktoplevelwindowgui.cpp
index f93af4f..33b3672 100644
--- a/rkward/windows/rktoplevelwindowgui.cpp
+++ b/rkward/windows/rktoplevelwindowgui.cpp
@@ -19,8 +19,8 @@
 
 #include <klocale.h>
 #include <kmessagebox.h>
+#include <KAboutData>
 #include <kaboutapplicationdialog.h>
-#include <kcmdlineargs.h>
 #include <kactioncollection.h>
 #include <kxmlguifactory.h>
 #include <kshortcutsdialog.h>
diff --git a/rkward/windows/rkworkplace.cpp b/rkward/windows/rkworkplace.cpp
index 8c3a4f5..6e29fc3 100644
--- a/rkward/windows/rkworkplace.cpp
+++ b/rkward/windows/rkworkplace.cpp
@@ -34,6 +34,7 @@
 #include <QCryptographicHash>
 #include <QKeyEvent>
 #include <QDir>
+#include <QApplication>
 
 #include "detachedwindowcontainer.h"
 #include "rkcommandeditorwindow.h"



More information about the rkward-tracker mailing list