[rkward/frameworks] rkward: More KDELibs4Support code removals
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Feb 12 13:17:27 UTC 2016
Git commit c7cd36327f2c887a831cc8306dc3cd55ba43703a by Thomas Friedrichsmeier.
Committed on 12/02/2016 at 13:17.
Pushed by tfry into branch 'frameworks'.
More KDELibs4Support code removals
M +1 -1 rkward/misc/rkaccordiontable.cpp
M +1 -1 rkward/misc/rkmessagecatalog.cpp
M +0 -1 rkward/misc/rkxmlguipreviewarea.cpp
M +0 -24 rkward/plugin/CMakeLists.txt
M +1 -1 rkward/rbackend/CMakeLists.txt
M +1 -4 rkward/rbackend/rinterface.cpp
M +9 -3 rkward/rbackend/rkfrontendtransmitter.cpp
M +2 -2 rkward/rbackend/rkwarddevice/CMakeLists.txt
M +19 -8 rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
M +2 -2 rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
M +1 -1 rkward/scriptbackends/CMakeLists.txt
M +1 -1 rkward/settings/CMakeLists.txt
http://commits.kde.org/rkward/c7cd36327f2c887a831cc8306dc3cd55ba43703a
diff --git a/rkward/misc/rkaccordiontable.cpp b/rkward/misc/rkaccordiontable.cpp
index 0bb1807..663dfc5 100644
--- a/rkward/misc/rkaccordiontable.cpp
+++ b/rkward/misc/rkaccordiontable.cpp
@@ -25,7 +25,6 @@
#include <QHBoxLayout>
#include <QLabel>
-#include <kvbox.h>
#include <klocale.h>
#include "rkcommonfunctions.h"
@@ -250,6 +249,7 @@ public:
#include <QPainter>
#include <QScrollBar>
#include <QHeaderView>
+#include <kvbox.h>
RKAccordionTable::RKAccordionTable (QWidget* parent) : QTreeView (parent) {
RK_TRACE (MISC);
diff --git a/rkward/misc/rkmessagecatalog.cpp b/rkward/misc/rkmessagecatalog.cpp
index 4f96c04..2cb269e 100644
--- a/rkward/misc/rkmessagecatalog.cpp
+++ b/rkward/misc/rkmessagecatalog.cpp
@@ -19,7 +19,7 @@
#include <libintl.h>
#include <QFile>
-#include <kglobal.h>
+#include <QLocale>
#include <klocale.h>
#include "../debug.h"
diff --git a/rkward/misc/rkxmlguipreviewarea.cpp b/rkward/misc/rkxmlguipreviewarea.cpp
index aaa45c1..b997bc7 100644
--- a/rkward/misc/rkxmlguipreviewarea.cpp
+++ b/rkward/misc/rkxmlguipreviewarea.cpp
@@ -26,7 +26,6 @@
#include <kxmlguifactory.h>
#include <ktoolbar.h>
-#include <kmenubar.h>
#include <klocale.h>
#include "../windows/rkmdiwindow.h"
diff --git a/rkward/plugin/CMakeLists.txt b/rkward/plugin/CMakeLists.txt
index 57bc817..a0bfaf8 100644
--- a/rkward/plugin/CMakeLists.txt
+++ b/rkward/plugin/CMakeLists.txt
@@ -33,27 +33,3 @@ SET(plugin_STAT_SRCS
ADD_LIBRARY(plugin STATIC ${plugin_STAT_SRCS})
TARGET_LINK_LIBRARIES(plugin Qt5::Widgets Qt5::Script KF5::TextEditor KF5::KDELibs4Support)
-
-########### install files ###############
-
-
-
-
-#original Makefile.am contents follow:
-
-#INCLUDES = $(all_includes)
-#METASOURCES = AUTO
-#noinst_LIBRARIES = libplugin.a
-#libplugin_a_SOURCES = rkcomponentmap.cpp rkcomponentproperties.cpp rkcomponent.cpp \
-# rkstandardcomponent.cpp rkvarselector.cpp rkvarslot.cpp rkformula.cpp rkradio.cpp \
-# rkcheckbox.cpp rkpluginspinbox.cpp rkinput.cpp rkpluginbrowser.cpp rktext.cpp \
-# rktabpage.cpp rkstandardcomponentgui.cpp rkdropdown.cpp rkcomponentcontext.cpp \
-# rkpreviewbox.cpp rkpluginsaveobject.cpp rkabstractoptionselector.cpp
-#
-#noinst_HEADERS = rkcomponentmap.h rkcomponentproperties.h rkcomponent.h \
-# rkstandardcomponent.h rkvarselector.h rkvarslot.h rkformula.h rkradio.h \
-# rkcheckbox.h rkpluginspinbox.h rkinput.h rkpluginbrowser.h rktext.h \
-# rktabpage.h rkstandardcomponentgui.h rkdropdown.h rkcomponentcontext.h \
-# rkpreviewbox.h rkpluginsaveobject.h rkabstractoptionselector.h
-#
-#
diff --git a/rkward/rbackend/CMakeLists.txt b/rkward/rbackend/CMakeLists.txt
index cc59049..56b5b34 100644
--- a/rkward/rbackend/CMakeLists.txt
+++ b/rkward/rbackend/CMakeLists.txt
@@ -44,7 +44,7 @@ SET (
rktransmitter.cpp
)
ADD_LIBRARY(rbackend STATIC ${rbackend_FRONTEND_SRCS})
-TARGET_LINK_LIBRARIES(rbackend rkgraphicsdevice.frontend Qt5::Widgets KF5::TextEditor KF5::WebKit KF5::KDELibs4Support)
+TARGET_LINK_LIBRARIES(rbackend rkgraphicsdevice.frontend Qt5::Widgets KF5::TextEditor KF5::WebKit KF5::WindowSystem)
SET (
rbackend_BACKEND_SRCS
diff --git a/rkward/rbackend/rinterface.cpp b/rkward/rbackend/rinterface.cpp
index 4334cb7..2761c9d 100644
--- a/rkward/rbackend/rinterface.cpp
+++ b/rkward/rbackend/rinterface.cpp
@@ -58,10 +58,7 @@ RKWindowCatcher *window_catcher;
#include "../debug.h"
#include <kmessagebox.h>
-#include <kfiledialog.h>
#include <klocale.h>
-#include <kstandarddirs.h>
-#include <kdialog.h>
#include <qdir.h>
#include <qvalidator.h>
@@ -813,7 +810,7 @@ void RInterface::processRBackendRequest (RBackendRequest *request) {
if (button_no.isEmpty () && button_cancel.isEmpty ()) {
dialog_type = KMessageBox::Information;
if (!request->synchronous) { // non-modal dialogs are not supported out of the box by KMessageBox;
- KDialog* dialog = new KDialog ();
+ QDialog* dialog = new QDialog ();
QDialogButtonBox *buttonBox = new QDialogButtonBox (dialog);
buttonBox->setStandardButtons (QDialogButtonBox::Ok);
KMessageBox::createKMessageBox (dialog, buttonBox, QMessageBox::Information, message, QStringList (), QString (), 0, KMessageBox::Notify | KMessageBox::NoExec);
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index b58a730..4e3f7c4 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -24,9 +24,7 @@
#include "../rkglobals.h"
#include <klocale.h>
-#include <kglobal.h>
#include <krandom.h>
-#include <kstandarddirs.h>
#include <QCoreApplication>
#include <QProcess>
#include <QLocalServer>
@@ -64,6 +62,14 @@ RKFrontendTransmitter::~RKFrontendTransmitter () {
RK_ASSERT (!server->isListening ());
}
+QString localeDir () {
+ // adapted from KCatalog::catalogLocaleDir()
+ QString relpath = QStringLiteral ("%1/LC_MESSAGES/rkward.mo").arg (QLocale ().name ().section ('_', 0, 0));
+ QString file = QStandardPaths::locate (QStandardPaths::GenericDataLocation, QStringLiteral ("locale/") + relpath);
+ if (file.isEmpty ()) return QString ();
+ return QFileInfo (file.left (file.size() - relpath.size ())).absolutePath ();
+}
+
void RKFrontendTransmitter::run () {
RK_TRACE (RBACKEND);
@@ -89,7 +95,7 @@ void RKFrontendTransmitter::run () {
args.append ("--server-name=" + server->fullServerName ());
args.append ("--rkd-server-name=" + rkd_transmitter->serverName ());
args.append ("--data-dir=" + RKSettingsModuleGeneral::filesPath ());
- args.append ("--locale-dir=" + KGlobal::dirs()->findResourceDir ("locale", QLocale ().name ().section ('_', 0, 0) + "/LC_MESSAGES/rkward.mo"));
+ args.append ("--locale-dir=" + localeDir ());
connect (backend, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &RKFrontendTransmitter::backendExit);
QString backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath ());
if (backend_executable.isEmpty ()) backend_executable = findBackendAtPath (QCoreApplication::applicationDirPath () + "/rbackend"); // for running directly from the build-dir
diff --git a/rkward/rbackend/rkwarddevice/CMakeLists.txt b/rkward/rbackend/rkwarddevice/CMakeLists.txt
index e3099f9..0eb58c4 100644
--- a/rkward/rbackend/rkwarddevice/CMakeLists.txt
+++ b/rkward/rbackend/rkwarddevice/CMakeLists.txt
@@ -14,7 +14,7 @@ SET (
)
ADD_LIBRARY(rkgraphicsdevice.frontend STATIC ${rkgraphicsdevice_frontend_SRCS})
-TARGET_LINK_LIBRARIES(rkgraphicsdevice.frontend Qt5::Widgets Qt5::Core Qt5::Network KF5::WidgetsAddons KF5::KDELibs4Support)
+TARGET_LINK_LIBRARIES(rkgraphicsdevice.frontend Qt5::Widgets Qt5::Core Qt5::Network KF5::WidgetsAddons KF5::I18n)
ADD_LIBRARY(rkgraphicsdevice.backend STATIC ${rkgraphicsdevice_backend_SRCS})
-TARGET_LINK_LIBRARIES(rkgraphicsdevice.backend Qt5::Core Qt5::Network)
\ No newline at end of file
+TARGET_LINK_LIBRARIES(rkgraphicsdevice.backend Qt5::Core Qt5::Network)
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
index 253b083..9fc80e7 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
@@ -23,9 +23,11 @@
#include <QPushButton>
#include <QHBoxLayout>
#include <QMouseEvent>
+#include <QDialog>
+#include <QDialogButtonBox>
+
#include <klocale.h>
#include <sys/stat.h>
-#include <kdialog.h>
#include "rkgraphicsdevice_protocol_shared.h"
#include "../rinterface.h"
@@ -312,10 +314,19 @@ void RKGraphicsDevice::confirmNewPage () {
QString msg = i18n ("<p>Press Enter to see next plot, or click 'Cancel' to abort.</p>");
goInteractive (msg);
- dialog = new KDialog (view);
- dialog->setCaption (i18n ("Ok to show next plot?"));
- dialog->setButtons (KDialog::Ok | KDialog::Cancel);
- dialog->setMainWidget (new QLabel (msg, dialog));
+
+ dialog = new QDialog (view);
+ dialog->setWindowTitle (i18n ("Ok to show next plot?"));
+
+ QVBoxLayout *layout = new QVBoxLayout (dialog);
+ layout->addWidget (new QLabel (msg, dialog));
+
+ QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ connect (buttons->button (QDialogButtonBox::Ok), &QPushButton::clicked, dialog, &QDialog::accept);
+ buttons->button (QDialogButtonBox::Ok)->setShortcut (Qt::CTRL | Qt::Key_Return);
+ connect (buttons->button (QDialogButtonBox::Cancel), &QPushButton::clicked, dialog, &QDialog::reject);
+ layout->addWidget (buttons);
+
// dialog->setWindowModality (Qt::WindowModal); // not good: Grays out the plot window
connect (dialog, &QDialog::finished, this, &RKGraphicsDevice::newPageDialogDone);
dialog->show ();
@@ -325,7 +336,7 @@ void RKGraphicsDevice::newPageDialogDone (int result) {
RK_TRACE (GRAPHICS_DEVICE);
RK_ASSERT (dialog);
- emit (newPageConfirmDone (result == KDialog::Accepted));
+ emit (newPageConfirmDone (result == QDialog::Accepted));
interaction_opcode = -1;
stopInteraction ();
}
@@ -414,10 +425,10 @@ bool RKGraphicsDevice::eventFilter (QObject *watched, QEvent *event) {
if (event->type () == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent*> (event);
if ((ke->key () == Qt::Key_Return) || (ke->key () == Qt::Key_Enter)) {
- newPageDialogDone (KDialog::Accepted);
+ newPageDialogDone (QDialog::Accepted);
return true;
} else if (ke->key () == Qt::Key_Escape) {
- newPageDialogDone (KDialog::Rejected);
+ newPageDialogDone (QDialog::Rejected);
return true;
}
}
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
index 83f7f84..8880571 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
@@ -42,7 +42,7 @@
# include <QPixmap>
#endif
-class KDialog;
+class QDialog;
/** This is the class that actually does all the drawing for the RKGraphicsDevice */
class RKGraphicsDevice : public QObject {
@@ -117,7 +117,7 @@ private:
QPainter painter;
QLabel *view;
QString base_title;
- KDialog *dialog;
+ QDialog *dialog;
int interaction_opcode; /**< Current interactive operation (from RKDOpcodes enum), or -1 is there is no current interactive operation */
diff --git a/rkward/scriptbackends/CMakeLists.txt b/rkward/scriptbackends/CMakeLists.txt
index 2c4f3bf..3ce6672 100644
--- a/rkward/scriptbackends/CMakeLists.txt
+++ b/rkward/scriptbackends/CMakeLists.txt
@@ -12,7 +12,7 @@ SET(scriptbackends_STAT_SRCS
)
ADD_LIBRARY(scriptbackends STATIC ${scriptbackends_STAT_SRCS})
-TARGET_LINK_LIBRARIES(scriptbackends Qt5::Script Qt5::Widgets Qt5::Xml KF5::KDELibs4Support)
+TARGET_LINK_LIBRARIES(scriptbackends Qt5::Script Qt5::Widgets Qt5::Xml KF5::WidgetsAddons)
########### install files ###############
diff --git a/rkward/settings/CMakeLists.txt b/rkward/settings/CMakeLists.txt
index b5e464f..c091e63 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::ConfigCore KF5::Parts)
\ No newline at end of file
+TARGET_LINK_LIBRARIES(settings Qt5::Widgets KF5::WidgetsAddons Qt5::Xml KF5::ConfigCore KF5::Parts)
More information about the rkward-tracker
mailing list