[rkward/frameworks] rkward: KDElibs4support removal. Next round.
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Sat Feb 13 17:07:22 UTC 2016
Git commit 12370d516f76196a1762a5806496f562b882704b by Thomas Friedrichsmeier.
Committed on 13/02/2016 at 17:07.
Pushed by tfry into branch 'frameworks'.
KDElibs4support removal. Next round.
M +1 -1 rkward/CMakeLists.txt
M +1 -1 rkward/misc/CMakeLists.txt
M +2 -2 rkward/misc/rkaccordiontable.cpp
M +1 -0 rkward/plugin/rkoptionset.cpp
M +1 -0 rkward/plugin/rkpluginframe.cpp
M +4 -2 rkward/plugin/rkstandardcomponent.cpp
M +1 -1 rkward/plugin/rktabpage.cpp
M +1 -2 rkward/plugin/rktabpage.h
M +1 -1 rkward/plugin/rkvarselector.cpp
M +1 -1 rkward/windows/CMakeLists.txt
M +1 -1 rkward/windows/detachedwindowcontainer.cpp
M +4 -2 rkward/windows/rkcallstackviewer.cpp
M +4 -8 rkward/windows/rkcommandeditorwindow.cpp
M +4 -2 rkward/windows/rkdebugmessagewindow.cpp
M +11 -3 rkward/windows/rkfilebrowser.cpp
M +2 -4 rkward/windows/rkfilebrowser.h
M +4 -5 rkward/windows/rkhtmlwindow.cpp
M +4 -4 rkward/windows/rktoolwindowbar.cpp
M +1 -1 rkward/windows/rktoolwindowbar.h
M +41 -27 rkward/windows/rkwindowcatcher.cpp
M +1 -3 rkward/windows/rkwindowcatcher.h
M +37 -36 rkward/windows/rkworkplace.cpp
M +5 -5 rkward/windows/rkworkplaceview.cpp
M +5 -2 rkward/windows/robjectbrowser.cpp
M +1 -2 rkward/windows/robjectbrowser.h
http://commits.kde.org/rkward/12370d516f76196a1762a5806496f562b882704b
diff --git a/rkward/CMakeLists.txt b/rkward/CMakeLists.txt
index a3b8408..e981fce 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::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} KF5::KDELibs4Support)
# wrapper executable
GET_DIRECTORY_PROPERTY(R_EXECUTABLE DIRECTORY rbackend DEFINITION R_EXECUTABLE)
diff --git a/rkward/misc/CMakeLists.txt b/rkward/misc/CMakeLists.txt
index 2bd092d..6ac43a2 100644
--- a/rkward/misc/CMakeLists.txt
+++ b/rkward/misc/CMakeLists.txt
@@ -29,7 +29,7 @@ SET(misc_STAT_SRCS
)
ADD_LIBRARY(misc STATIC ${misc_STAT_SRCS})
-TARGET_LINK_LIBRARIES(misc Qt5::Widgets KF5::WidgetsAddons KF5::KIOWidgets Qt5::Xml KF5::ConfigCore KF5::Parts KF5::KDELibs4Support)
+TARGET_LINK_LIBRARIES(misc Qt5::Widgets KF5::WidgetsAddons KF5::KIOWidgets Qt5::Xml KF5::ConfigCore KF5::Parts)
########### install files ###############
diff --git a/rkward/misc/rkaccordiontable.cpp b/rkward/misc/rkaccordiontable.cpp
index 663dfc5..8cd2f14 100644
--- a/rkward/misc/rkaccordiontable.cpp
+++ b/rkward/misc/rkaccordiontable.cpp
@@ -249,7 +249,6 @@ public:
#include <QPainter>
#include <QScrollBar>
#include <QHeaderView>
-#include <kvbox.h>
RKAccordionTable::RKAccordionTable (QWidget* parent) : QTreeView (parent) {
RK_TRACE (MISC);
@@ -261,7 +260,8 @@ RKAccordionTable::RKAccordionTable (QWidget* parent) : QTreeView (parent) {
editor_widget_container = new QWidget ();
QHBoxLayout *layout = new QHBoxLayout (editor_widget_container);
layout->setContentsMargins (0, 0, 0, 0);
- editor_widget = new KVBox (editor_widget_container);
+ editor_widget = new QWidget (editor_widget_container);
+ new QVBoxLayout (editor_widget);
layout->addWidget (editor_widget);
setSelectionMode (SingleSelection);
diff --git a/rkward/plugin/rkoptionset.cpp b/rkward/plugin/rkoptionset.cpp
index 8f88cf6..eed5be9 100644
--- a/rkward/plugin/rkoptionset.cpp
+++ b/rkward/plugin/rkoptionset.cpp
@@ -84,6 +84,7 @@ RKOptionSet::RKOptionSet (const QDomElement &element, RKComponent *parent_compon
// first build the contents, as we will need to refer to the elements inside, later
model = new RKOptionSetDisplayModel (this);
contents_container = new RKComponent (this, accordion->editorWidget ());
+ accordion->editorWidget ()->layout ()->addWidget (contents_container);
QDomElement content_element = xml->getChildElement (element, "content", DL_ERROR);
RKComponentBuilder *builder = new RKComponentBuilder (contents_container, content_element);
builder->buildElement (content_element, *xml, accordion->editorWidget (), false); // NOTE that parent widget != parent component, here, by intention. The point is that the display should not be disabled along with the contents
diff --git a/rkward/plugin/rkpluginframe.cpp b/rkward/plugin/rkpluginframe.cpp
index bc5a79d..f5cd135 100644
--- a/rkward/plugin/rkpluginframe.cpp
+++ b/rkward/plugin/rkpluginframe.cpp
@@ -36,6 +36,7 @@ RKPluginFrame::RKPluginFrame (const QDomElement &element, RKComponent *parent_co
layout = new QVBoxLayout (frame);
page = new QWidget (frame);
QVBoxLayout *pagelayout = new QVBoxLayout (page);
+ pagelayout->setContentsMargins (0, 0, 0, 0);
pagelayout->setSpacing (RKGlobals::spacingHint ());
layout->addWidget (page);
diff --git a/rkward/plugin/rkstandardcomponent.cpp b/rkward/plugin/rkstandardcomponent.cpp
index 58488be..446af76 100644
--- a/rkward/plugin/rkstandardcomponent.cpp
+++ b/rkward/plugin/rkstandardcomponent.cpp
@@ -149,7 +149,8 @@ RKStandardComponent::RKStandardComponent (RKComponent *parent_component, QWidget
build_wizard = false;
QWidget *fake_page = parent_component->addPage ();
- new QVBoxLayout (fake_page);
+ QVBoxLayout *l = new QVBoxLayout (fake_page);
+ l->setContentsMargins (0, 0, 0, 0);
parent_widget = fake_page;
}
} else {
@@ -584,7 +585,8 @@ void RKComponentBuilder::buildElement (const QDomElement &element, XMLHelper &xm
if (allow_pages && (e.tagName () == QLatin1String ("page"))) {
widget = component ()->addPage ();
add_to_layout = false; // For wizards, that's done inside addPage()
- new QVBoxLayout (widget);
+ QVBoxLayout *l = new QVBoxLayout (widget);
+ l->setContentsMargins (0, 0, 0, 0);
buildElement (e, xml, widget, false);
} else if (e.tagName () == QLatin1String ("row")) {
widget = new RKComponent (component (), parent_widget); // wrapping this (and column, below) inside an RKComponent has the benefit, that it can have an id, and hence can be set to visibile/hidden, enabled/disabled
diff --git a/rkward/plugin/rktabpage.cpp b/rkward/plugin/rktabpage.cpp
index cdd2583..0cb463d 100644
--- a/rkward/plugin/rktabpage.cpp
+++ b/rkward/plugin/rktabpage.cpp
@@ -32,7 +32,7 @@ RKTabPage::RKTabPage (const QDomElement &element, RKComponent *parent_component,
label = xml->i18nStringAttribute (element, "label", QString (), DL_WARNING);
QVBoxLayout *layout = new QVBoxLayout (this);
- page = this;
+ layout->setContentsMargins (0, 0, 0, 0);
tabbook = parent_widget;
tabbook->addTab (this, label);
diff --git a/rkward/plugin/rktabpage.h b/rkward/plugin/rktabpage.h
index 7ba8676..469bb93 100644
--- a/rkward/plugin/rktabpage.h
+++ b/rkward/plugin/rktabpage.h
@@ -37,7 +37,7 @@ public:
~RKTabPage ();
/** @returns the page child elements should be drawn in */
- QWidget *getPage () { return page; };
+ QWidget *getPage () { return this; };
int type () { return ComponentTab; };
@@ -45,7 +45,6 @@ public slots:
/** called when visibile or enabled properties change */
void visibleEnabledChanged (RKComponentPropertyBase *property);
private:
- QWidget *page;
QTabWidget *tabbook;
int index;
QString label;
diff --git a/rkward/plugin/rkvarselector.cpp b/rkward/plugin/rkvarselector.cpp
index 6377f3b..6a7a84f 100644
--- a/rkward/plugin/rkvarselector.cpp
+++ b/rkward/plugin/rkvarselector.cpp
@@ -68,7 +68,7 @@ RKVarSelector::RKVarSelector (const QDomElement &element, RKComponent *parent_co
connect (show_all_envs_action, &QAction::toggled, this, &RKVarSelector::rootChanged);
filter_widget = 0;
- filter_widget_placeholder = new QVBoxLayout (this);
+ filter_widget_placeholder = new QVBoxLayout ();
filter_widget_placeholder->setContentsMargins (0, 0, 0, 0);
vbox->addLayout (filter_widget_placeholder);
show_filter_action = new QAction (i18n ("Show filter options"), this);
diff --git a/rkward/windows/CMakeLists.txt b/rkward/windows/CMakeLists.txt
index 2d9b5a6..45767cd 100644
--- a/rkward/windows/CMakeLists.txt
+++ b/rkward/windows/CMakeLists.txt
@@ -24,7 +24,7 @@ SET(windows_STAT_SRCS
)
ADD_LIBRARY(windows STATIC ${windows_STAT_SRCS})
-TARGET_LINK_LIBRARIES(windows Qt5::Widgets Qt5::Xml KF5::TextEditor KF5::WebKit KF5::KDELibs4Support)
+TARGET_LINK_LIBRARIES(windows Qt5::Widgets Qt5::Xml Qt5::PrintSupport KF5::TextEditor KF5::WebKit KF5::Notifications KF5::WindowSystem KF5::KIOFileWidgets)
########### install files ###############
diff --git a/rkward/windows/detachedwindowcontainer.cpp b/rkward/windows/detachedwindowcontainer.cpp
index 1e4e2ac..32f8f07 100644
--- a/rkward/windows/detachedwindowcontainer.cpp
+++ b/rkward/windows/detachedwindowcontainer.cpp
@@ -19,7 +19,6 @@
#include <klocale.h>
#include <kactioncollection.h>
-#include <kstatusbar.h>
#include <ktoolbar.h>
#include <kxmlguifactory.h>
@@ -27,6 +26,7 @@
#include <qwidget.h>
#include <QCloseEvent>
#include <QMenu>
+#include <QStatusBar>
#include "rktoplevelwindowgui.h"
#include "../rkward.h"
diff --git a/rkward/windows/rkcallstackviewer.cpp b/rkward/windows/rkcallstackviewer.cpp
index 03cc3d3..5e27f85 100644
--- a/rkward/windows/rkcallstackviewer.cpp
+++ b/rkward/windows/rkcallstackviewer.cpp
@@ -18,7 +18,6 @@
#include "rkcallstackviewer.h"
#include <klocale.h>
-#include <kvbox.h>
#include <QHBoxLayout>
#include <QVBoxLayout>
@@ -41,7 +40,7 @@ RKCallstackViewer::RKCallstackViewer (QWidget *parent, bool tool_window, const c
QVBoxLayout *layout = new QVBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
- layout_widget = new KVBox (this);
+ layout_widget = new QWidget (this);
layout->addWidget (layout_widget);
layout_widget->setFocusPolicy (Qt::StrongFocus);
@@ -69,6 +68,9 @@ void RKCallstackViewer::createRealWidget () {
RK_DEBUG (APP, DL_INFO, "creating callstack viewer");
real_widget = new RKCallstackViewerWidget (layout_widget);
+ QVBoxLayout *l = new QVBoxLayout (layout_widget);
+ l->setContentsMargins (0, 0, 0, 0);
+ layout ()->addWidget (real_widget);
setFocusProxy (real_widget);
}
}
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 7acab69..3db61a3 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -22,12 +22,9 @@
#include <ktexteditor/modificationinterface.h>
#include <ktexteditor/markinterface.h>
-#include <qlayout.h>
#include <qapplication.h>
-#include <qtabwidget.h>
#include <qfile.h>
#include <qtimer.h>
-#include <qobject.h>
#include <QHBoxLayout>
#include <QCloseEvent>
#include <QFrame>
@@ -35,17 +32,16 @@
#include <QKeyEvent>
#include <QEvent>
#include <QClipboard>
+#include <QMenu>
+#include <QAction>
+#include <QTemporaryFile>
+#include <QDir>
#include <klocale.h>
-#include <QMenu>
#include <kmessagebox.h>
-#include <kfiledialog.h>
-#include <QAction>
#include <kstandardaction.h>
-#include <klibloader.h>
#include <kactioncollection.h>
#include <kactionmenu.h>
-#include <QTemporaryFile>
#include <kio/deletejob.h>
#include <kio/job.h>
#include <kconfiggroup.h>
diff --git a/rkward/windows/rkdebugmessagewindow.cpp b/rkward/windows/rkdebugmessagewindow.cpp
index acb391d..7d80bf1 100644
--- a/rkward/windows/rkdebugmessagewindow.cpp
+++ b/rkward/windows/rkdebugmessagewindow.cpp
@@ -22,7 +22,6 @@
#include <QVBoxLayout>
#include <QTextEdit>
-#include <kvbox.h>
#include <kmessagebox.h>
#include <klocale.h>
@@ -40,7 +39,9 @@ RKDebugMessageWindow::RKDebugMessageWindow (QWidget* parent, bool tool_window, c
QVBoxLayout *layout = new QVBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
- layout_widget = new KVBox (this);
+ layout_widget = new QWidget (this);
+ QVBoxLayout *l = new QVBoxLayout (layout_widget);
+ l->setContentsMargins (0, 0, 0, 0);
layout->addWidget (layout_widget);
layout_widget->setFocusPolicy (Qt::StrongFocus);
@@ -72,6 +73,7 @@ void RKDebugMessageWindow::createWidget () {
if (!real_widget) {
RK_DEBUG (APP, DL_INFO, "creating debug message viewer");
real_widget = new RKDebugMessageWindowWidget (layout_widget);
+ layout_widget->layout ()->addWidget (real_widget);
setFocusProxy (layout_widget);
if (first) {
diff --git a/rkward/windows/rkfilebrowser.cpp b/rkward/windows/rkfilebrowser.cpp
index 51f243e..fd4c205 100644
--- a/rkward/windows/rkfilebrowser.cpp
+++ b/rkward/windows/rkfilebrowser.cpp
@@ -55,7 +55,7 @@ RKFileBrowser::RKFileBrowser (QWidget *parent, bool tool_window, const char *nam
QVBoxLayout *layout = new QVBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
- layout_widget = new KVBox (this);
+ layout_widget = new QWidget (this);
layout->addWidget (layout_widget);
layout_widget->setFocusPolicy (Qt::StrongFocus);
@@ -77,6 +77,9 @@ void RKFileBrowser::showEvent (QShowEvent *e) {
RK_DEBUG (APP, DL_INFO, "creating file browser");
real_widget = new RKFileBrowserWidget (layout_widget);
+ QVBoxLayout *l = new QVBoxLayout (layout_widget);
+ l->setContentsMargins (0, 0, 0, 0);
+ l->addWidget (real_widget);
setFocusProxy (real_widget);
}
@@ -89,12 +92,15 @@ void RKFileBrowser::currentWDChanged () {
/////////////////// RKFileBrowserWidget ////////////////////
-RKFileBrowserWidget::RKFileBrowserWidget (QWidget *parent) : KVBox (parent) {
+RKFileBrowserWidget::RKFileBrowserWidget (QWidget *parent) : QWidget (parent) {
RK_TRACE (APP);
+ QVBoxLayout *layout = new QVBoxLayout (this);
+
KToolBar *toolbar = new KToolBar (this);
toolbar->setIconSize (QSize (16, 16));
toolbar->setToolButtonStyle (Qt::ToolButtonIconOnly);
+ layout->addWidget (toolbar);
urlbox = new KUrlComboBox (KUrlComboBox::Directories, true, this);
KUrlCompletion* cmpl = new KUrlCompletion (KUrlCompletion::DirCompletion);
@@ -103,6 +109,7 @@ RKFileBrowserWidget::RKFileBrowserWidget (QWidget *parent) : KVBox (parent) {
urlbox->setSizePolicy (QSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed));
urlbox->completionBox (true)->installEventFilter (this);
setFocusProxy (urlbox);
+ layout->addWidget (urlbox);
dir = new KDirOperator (QUrl (), this);
dir->setPreviewWidget (0);
@@ -110,6 +117,7 @@ RKFileBrowserWidget::RKFileBrowserWidget (QWidget *parent) : KVBox (parent) {
dir->readConfig (config);
dir->setView (KFile::Default);
connect (RKWardMainWindow::getMain (), &RKWardMainWindow::aboutToQuitRKWard, this, &RKFileBrowserWidget::saveConfig);
+ layout->addWidget (dir);
toolbar->addAction (dir->actionCollection ()->action ("up"));
toolbar->addAction (dir->actionCollection ()->action ("back"));
@@ -226,7 +234,7 @@ bool RKFileBrowserWidget::eventFilter (QObject* o, QEvent* e) {
return false;
}
- return (KVBox::eventFilter (o, e));
+ return (QWidget::eventFilter (o, e));
}
void RKFileBrowserWidget::fileActivated (const KFileItem& item) {
diff --git a/rkward/windows/rkfilebrowser.h b/rkward/windows/rkfilebrowser.h
index cd95eef..5751f58 100644
--- a/rkward/windows/rkfilebrowser.h
+++ b/rkward/windows/rkfilebrowser.h
@@ -20,8 +20,6 @@
#include "rkmdiwindow.h"
-#include <kvbox.h>
-
#include <QList>
#include <QUrl>
@@ -47,7 +45,7 @@ public slots:
void currentWDChanged ();
private:
RKFileBrowserWidget *real_widget;
- KVBox *layout_widget;
+ QWidget *layout_widget;
friend class RKWardMainWindow;
static RKFileBrowser *main_browser;
};
@@ -55,7 +53,7 @@ friend class RKWardMainWindow;
/** The internal widget used in RKFileBrowser
TODO: KDE4: check whether there is a ready widget for this. Much of the implementation is a modified copy from Kate / kdevelop.
*/
-class RKFileBrowserWidget : public KVBox {
+class RKFileBrowserWidget : public QWidget {
Q_OBJECT
public:
explicit RKFileBrowserWidget (QWidget *widget);
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index f15ecb0..5d8aa95 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -16,13 +16,11 @@
***************************************************************************/
#include "rkhtmlwindow.h"
-#include <klibloader.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kparts/plugin.h>
#include <kactioncollection.h>
#include <kdirwatch.h>
-#include <kmimetype.h>
#include <kio/job.h>
#include <kservice.h>
#include <kwebview.h>
@@ -45,6 +43,7 @@
#include <QTemporaryFile>
#include <QGuiApplication>
#include <QIcon>
+#include <QMimeDatabase>
#include "../rkglobals.h"
#include "../rbackend/rinterface.h"
@@ -98,7 +97,7 @@ bool RKWebPage::acceptNavigationRequest (QWebFrame* frame, const QNetworkRequest
}
if (frame != mainFrame ()) {
- if (request.url ().isLocalFile () && (KMimeType::findByUrl (request.url ())->is ("text/html"))) return true;
+ if (request.url ().isLocalFile () && (QMimeDatabase ().mimeTypeForUrl (request.url ()).inherits ("text/html"))) return true;
}
if (QUrl (mainFrame ()->url ()).matches (request.url (), QUrl::NormalizePathSegments | QUrl::StripTrailingSlash)) {
@@ -367,7 +366,7 @@ bool RKHTMLWindow::openURL (const QUrl &url) {
}
}
- if (url.isLocalFile () && (KMimeType::findByUrl (url)->is ("text/html") || window_mode == HTMLOutputWindow)) {
+ if (url.isLocalFile () && (QMimeDatabase ().mimeTypeForUrl (url).inherits ("text/html") || window_mode == HTMLOutputWindow)) {
changeURL (url);
QFileInfo out_file (url.toLocalFile ());
bool ok = out_file.exists();
@@ -397,7 +396,7 @@ bool RKHTMLWindow::openURL (const QUrl &url) {
}
}
- RKWorkplace::mainWorkplace ()->openAnyUrl (url, QString (), KMimeType::findByUrl (url)->is ("text/html")); // NOTE: text/html type urls, which we have not handled, above, are forced to be opened externally, to avoid recursion. E.g. help:// protocol urls.
+ RKWorkplace::mainWorkplace ()->openAnyUrl (url, QString (), QMimeDatabase ().mimeTypeForUrl (url).inherits ("text/html")); // NOTE: text/html type urls, which we have not handled, above, are forced to be opened externally, to avoid recursion. E.g. help:// protocol urls.
return true;
}
diff --git a/rkward/windows/rktoolwindowbar.cpp b/rkward/windows/rktoolwindowbar.cpp
index acff81a..ceb5a7c 100644
--- a/rkward/windows/rktoolwindowbar.cpp
+++ b/rkward/windows/rktoolwindowbar.cpp
@@ -19,7 +19,6 @@
#include "rktoolwindowbar.h"
-#include <khbox.h>
#include <QMenu>
#include <klocale.h>
#include <kparts/partmanager.h>
@@ -113,7 +112,8 @@ void RKToolWindowBar::setSplitter (QSplitter *splitter) {
RK_ASSERT (!container);
RKToolWindowBar::splitter = splitter;
- container = new KHBox (splitter);
+ container = new QWidget (splitter);
+ new QHBoxLayout (container);
splitter->setContentsMargins (0, 0, 0, 0);
container->layout ()->setContentsMargins (0, 0, 0, 0);
container->layout ()->setSpacing (0);
@@ -145,8 +145,7 @@ void RKToolWindowBar::addWidget (RKMDIWindow *window) {
tab (id)->installEventFilter (this);
if (window->isAttached ()) {
- window->hide();
- window->setParent (container);
+ reclaimDetached (window);
}
show ();
@@ -157,6 +156,7 @@ void RKToolWindowBar::reclaimDetached (RKMDIWindow *window) {
window->hide();
window->setParent (container);
+ container->layout ()->addWidget (window);
}
void RKToolWindowBar::removeWidget (RKMDIWindow *widget) {
diff --git a/rkward/windows/rktoolwindowbar.h b/rkward/windows/rktoolwindowbar.h
index f5d982f..c10e305 100644
--- a/rkward/windows/rktoolwindowbar.h
+++ b/rkward/windows/rktoolwindowbar.h
@@ -72,7 +72,7 @@ friend class RKWorkplace;
RKMDIWindow* idToWidget (int id) const;
QSplitter* splitter;
- KHBox* container;
+ QWidget* container;
int last_known_size;
int id_of_popup;
diff --git a/rkward/windows/rkwindowcatcher.cpp b/rkward/windows/rkwindowcatcher.cpp
index 8bde5fd..fd1c9d0 100644
--- a/rkward/windows/rkwindowcatcher.cpp
+++ b/rkward/windows/rkwindowcatcher.cpp
@@ -22,6 +22,9 @@
#include <qlayout.h>
#include <qapplication.h>
#include <QDesktopWidget>
+#include <QPushButton>
+#include <QDialogButtonBox>
+#include <QDialog>
#include <kmessagebox.h>
#include <klocale.h>
@@ -165,12 +168,10 @@ void RKWindowCatcher::killDevice (int device_number) {
#warning TODO: Q_WS_X11 is simply no longer defined. Adjust this functionality.
#include <QTimer>
#include <QCloseEvent>
+#include <QSpinBox>
#include <ktoggleaction.h>
#include <kselectaction.h>
-#include <kdialog.h>
-#include <knuminput.h>
-#include <kvbox.h>
#include <kactioncollection.h>
#include "../rkglobals.h"
@@ -226,6 +227,7 @@ RKCaughtX11Window::RKCaughtX11Window (RKGraphicsDevice* rkward_device, int devic
xembed_container->setFixedSize (rk_native_device->viewPort ()->size ());
resize (xembed_container->size ());
rk_native_device->viewPort ()->setParent (xembed_container);
+ xembed_container->layout ()->addWidget (rk_native_device->viewPort ());
connect (rkward_device, &RKGraphicsDevice::captionChanged, this, &RKCaughtX11Window::setCaption);
connect (rkward_device, &RKGraphicsDevice::goingInteractive, this, &RKCaughtX11Window::deviceInteractive);
stop_interaction->setVisible (true);
@@ -255,14 +257,15 @@ void RKCaughtX11Window::commonInit (int device_number) {
QVBoxLayout *layout = new QVBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
- box_widget = new KVBox (this);
- layout->addWidget (box_widget);
scroll_widget = new QScrollArea (this);
scroll_widget->hide ();
layout->addWidget (scroll_widget);
- xembed_container = new KVBox (box_widget); // QX11EmbedContainer can not be reparented (between the box_widget, and the scroll_widget) directly. Therefore we place it into a container, and reparent that instead.
+ xembed_container = new QWidget (this); // QX11EmbedContainer can not be reparented (between the this, and the scroll_widget) directly. Therefore we place it into a container, and reparent that instead.
// Also, this makes it easier to handle the various different devices
+ QVBoxLayout *xembed_layout = new QVBoxLayout (xembed_container);
+ xembed_layout->setContentsMargins (0, 0, 0, 0);
+ layout->addWidget (xembed_container);
dynamic_size = false;
dynamic_size_action->setChecked (false);
@@ -426,16 +429,15 @@ void RKCaughtX11Window::fixedSizeToggled () {
if (dynamic_size_action->isChecked ()) {
scroll_widget->takeWidget ();
- xembed_container->setParent (box_widget);
+ layout ()->addWidget (xembed_container);
xembed_container->show ();
scroll_widget->hide ();
- box_widget->show ();
xembed_container->setMinimumSize (5, 5);
xembed_container->setMaximumSize (32767, 32767);
} else {
xembed_container->setFixedSize (xembed_container->size ());
+ layout ()->removeWidget (xembed_container);
scroll_widget->setWidget (xembed_container);
- box_widget->hide ();
scroll_widget->show ();
}
}
@@ -468,29 +470,35 @@ void RKCaughtX11Window::setFixedSizeManual () {
RK_TRACE (MISC);
// TODO: not very pretty, yet
- KDialog *dialog = new KDialog (this);
- dialog->setButtons (KDialog::Ok|KDialog::Cancel);
- dialog->setCaption (i18n ("Specify fixed size"));
+ QDialog *dialog = new QDialog (this);
+ dialog->setWindowTitle (i18n ("Specify fixed size"));
dialog->setModal (true);
- KVBox *page = new KVBox (dialog);
- dialog->setMainWidget (page);
+ QVBoxLayout *dlayout = new QVBoxLayout (dialog);
- new QLabel (i18n ("Width"), page);
- QSpinBox *width = new QSpinBox(page);
+ dlayout->addWidget (new QLabel (i18n ("Width"), dialog));
+ QSpinBox *width = new QSpinBox (dialog);
width->setMaximum (32767);
width->setMinimum (5);
width->setSingleStep (1);
width->setValue (xembed_container->width ());
width->setFocus ();
width->selectAll ();
+ dlayout->addWidget (width);
- new QLabel (i18n ("Height"), page);
- QSpinBox *height = new QSpinBox(page);
+ dlayout->addWidget (new QLabel (i18n ("Height"), dialog));
+ QSpinBox *height = new QSpinBox (dialog);
height->setMaximum (32767);
height->setMinimum (5);
height->setSingleStep (1);
height->setValue (xembed_container->height ());
+ dlayout->addWidget (height);
+
+ QDialogButtonBox *box = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ connect (box->button (QDialogButtonBox::Ok), &QPushButton::clicked, dialog, &QDialog::accept);
+ connect (box->button (QDialogButtonBox::Cancel), &QPushButton::clicked, dialog, &QDialog::reject);
+ box->button (QDialogButtonBox::Ok)->setShortcut (Qt::CTRL | Qt::Key_Return);
+ dlayout->addWidget (box);
dialog->exec ();
@@ -528,17 +536,23 @@ void RKCaughtX11Window::copyDeviceToRObject () {
RK_TRACE (MISC);
// TODO: not very pretty, yet
- KDialog *dialog = new KDialog (this);
- dialog->setButtons (KDialog::Ok|KDialog::Cancel);
- dialog->setCaption (i18n ("Specify R object"));
+ QDialog *dialog = new QDialog (this);
+ dialog->setWindowTitle (i18n ("Specify R object"));
dialog->setModal (true);
- KVBox *page = new KVBox (dialog);
- dialog->setMainWidget (page);
+ QVBoxLayout *layout = new QVBoxLayout (dialog);
+
+ layout->addWidget (new QLabel (i18n ("Specify the R object name, you want to save the graph to"), dialog));
+ RKSaveObjectChooser *chooser = new RKSaveObjectChooser (dialog, "my.plot");
+ layout->addWidget (chooser);
+
+ QDialogButtonBox *box = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ connect (box->button (QDialogButtonBox::Ok), &QPushButton::clicked, dialog, &QDialog::accept);
+ connect (box->button (QDialogButtonBox::Cancel), &QPushButton::clicked, dialog, &QDialog::reject);
+ box->button (QDialogButtonBox::Ok)->setShortcut (Qt::CTRL | Qt::Key_Return);
+ layout->addWidget (box);
- new QLabel (i18n ("Specify the R object name, you want to save the graph to"), page);
- RKSaveObjectChooser *chooser = new RKSaveObjectChooser (page, "my.plot");
- connect (chooser, &RKSaveObjectChooser::changed, dialog, &KDialog::enableButtonOk);
- if (!chooser->isOk ()) dialog->enableButtonOk (false);
+ connect (chooser, &RKSaveObjectChooser::changed, box->button (QDialogButtonBox::Ok), &QPushButton::setEnabled);
+ if (!chooser->isOk ()) box->button (QDialogButtonBox::Ok)->setEnabled (false);
dialog->exec ();
diff --git a/rkward/windows/rkwindowcatcher.h b/rkward/windows/rkwindowcatcher.h
index f3cadaa..bd53c3f 100644
--- a/rkward/windows/rkwindowcatcher.h
+++ b/rkward/windows/rkwindowcatcher.h
@@ -103,7 +103,6 @@ class QAction;
class KSelectAction;
class QXEmbedCopy;
class QScrollArea;
-class KVBox;
class RKProgressControl;
class QX11EmbedContainer;
class QWinHost;
@@ -178,9 +177,8 @@ private:
bool killed_in_r;
bool close_attempted;
WId embedded;
- KVBox *xembed_container;
+ QWidget *xembed_container;
QScrollArea *scroll_widget;
- KVBox *box_widget;
RKProgressControl *error_dialog;
static QHash<int, RKCaughtX11Window*> device_windows;
diff --git a/rkward/windows/rkworkplace.cpp b/rkward/windows/rkworkplace.cpp
index 3b7cc45..37785c5 100644
--- a/rkward/windows/rkworkplace.cpp
+++ b/rkward/windows/rkworkplace.cpp
@@ -20,14 +20,9 @@
#include <kparts/partmanager.h>
#include <kmessagebox.h>
#include <klocale.h>
-#include <kiconloader.h>
-#include <khbox.h>
-#include <kvbox.h>
#include <kglobalsettings.h>
#include <kactioncollection.h>
#include <krun.h>
-#include <kmimetype.h>
-#include <kstandarddirs.h>
#include <KSharedConfig>
#include <KMessageWidget>
@@ -36,6 +31,7 @@
#include <QKeyEvent>
#include <QDir>
#include <QApplication>
+#include <QMimeDatabase>
#include "detachedwindowcontainer.h"
#include "rkcommandeditorwindow.h"
@@ -71,20 +67,27 @@ RKWorkplace::RKWorkplace (QWidget *parent) : QWidget (parent) {
_workspace_config = 0;
window_placement_override = RKMDIWindow::AnyWindowState;
- /* Splitter setup contains heavy copying from Kate's katemdi! */
- KVBox *vbox = new KVBox (this);
+ // message area
+ message_area = new QWidget (this);
+ QVBoxLayout *message_layout = new QVBoxLayout (message_area);
+ message_layout->setContentsMargins (0, 0, 0, 0);
- tool_window_bars[RKToolWindowList::Top] = new RKToolWindowBar (KMultiTabBar::Top, vbox);
- vert_splitter = new QSplitter (Qt::Vertical, vbox);
+ QVBoxLayout *vbox = new QVBoxLayout (this);
+ vbox->setContentsMargins (0, 0, 0, 0);
+ vbox->addWidget (message_area);
+
+ tool_window_bars[RKToolWindowList::Top] = new RKToolWindowBar (KMultiTabBar::Top, this);
+ vert_splitter = new QSplitter (Qt::Vertical, this);
vert_splitter->setOpaqueResize (KGlobalSettings::opaqueResize ());
tool_window_bars[RKToolWindowList::Top]->setSplitter (vert_splitter);
- KHBox *hbox = new KHBox (vert_splitter);
- vert_splitter->setCollapsible (vert_splitter->indexOf (hbox), false);
- vert_splitter->setStretchFactor (vert_splitter->indexOf (hbox), 1);
+ QWidget *harea = new QWidget (vert_splitter);
+ QHBoxLayout *hbox = new QHBoxLayout (harea);
+ vert_splitter->setCollapsible (vert_splitter->indexOf (harea), false);
+ vert_splitter->setStretchFactor (vert_splitter->indexOf (harea), 1);
- tool_window_bars[RKToolWindowList::Left] = new RKToolWindowBar (KMultiTabBar::Left, hbox);
- horiz_splitter = new QSplitter (Qt::Horizontal, hbox);
+ tool_window_bars[RKToolWindowList::Left] = new RKToolWindowBar (KMultiTabBar::Left, harea);
+ horiz_splitter = new QSplitter (Qt::Horizontal, harea);
horiz_splitter->setOpaqueResize (KGlobalSettings::opaqueResize ());
tool_window_bars[RKToolWindowList::Left]->setSplitter (horiz_splitter);
@@ -92,26 +95,21 @@ RKWorkplace::RKWorkplace (QWidget *parent) : QWidget (parent) {
horiz_splitter->setCollapsible (horiz_splitter->indexOf (wview), false);
horiz_splitter->setStretchFactor(horiz_splitter->indexOf (wview), 1);
- tool_window_bars[RKToolWindowList::Bottom] = new RKToolWindowBar (KMultiTabBar::Bottom, vbox);
- tool_window_bars[RKToolWindowList::Bottom]->setSplitter (vert_splitter);
-
- tool_window_bars[RKToolWindowList::Right] = new RKToolWindowBar (KMultiTabBar::Right, hbox);
+ tool_window_bars[RKToolWindowList::Right] = new RKToolWindowBar (KMultiTabBar::Right, harea);
tool_window_bars[RKToolWindowList::Right]->setSplitter (horiz_splitter);
+ hbox->addWidget (tool_window_bars[RKToolWindowList::Left]);
+ hbox->addWidget (horiz_splitter);
+ hbox->addWidget (tool_window_bars[RKToolWindowList::Right]);
+
+ tool_window_bars[RKToolWindowList::Bottom] = new RKToolWindowBar (KMultiTabBar::Bottom, this);
+ tool_window_bars[RKToolWindowList::Bottom]->setSplitter (vert_splitter);
+ vbox->addWidget (tool_window_bars[RKToolWindowList::Top]);
+ vbox->addWidget (vert_splitter);
+ vbox->addWidget (tool_window_bars[RKToolWindowList::Bottom]);
KConfigGroup toolbar_config = KSharedConfig::openConfig ()->group ("ToolwindowBars");
for (int i = 0; i < TOOL_WINDOW_BAR_COUNT; ++i) tool_window_bars[i]->restoreSize (toolbar_config);
- // message area
- message_area = new QWidget (this);
- QVBoxLayout *message_layout = new QVBoxLayout (message_area);
- message_layout->setContentsMargins (0, 0, 0, 0);
-
- // now add it all to this widget
- QVBoxLayout *box = new QVBoxLayout (this);
- box->setContentsMargins (0, 0, 0, 0);
- box->addWidget (message_area);
- box->addWidget (vbox);
-
history = new RKMDIWindowHistory (this);
connect (RKWardMainWindow::getMain (), &RKWardMainWindow::aboutToQuitRKWard, this, &RKWorkplace::saveSettings);
@@ -137,7 +135,9 @@ void RKWorkplace::addMessageWidget (KMessageWidget* message) {
QString workspaceConfigFileName (const QUrl &url) {
QString base_name = QString (QCryptographicHash::hash (url.toDisplayString ().toUtf8 (), QCryptographicHash::Md5).toHex());
- return (KStandardDirs::locateLocal ("data", "rkward/workspace_config_" + base_name));
+ QDir dir (QStandardPaths::writableLocation (QStandardPaths::GenericDataLocation));
+ dir.mkpath ("rkward");
+ return (dir.absoluteFilePath ("rkward/workspace_config_" + base_name));
}
KConfigBase *RKWorkplace::workspaceConfig () {
@@ -403,14 +403,15 @@ bool RKWorkplace::openAnyUrl (const QUrl &url, const QString &known_mimetype, bo
if (url.scheme () == "rkward") {
if (RKHTMLWindow::handleRKWardURL (url)) return true;
}
- KMimeType::Ptr mimetype;
- if (!known_mimetype.isEmpty ()) mimetype = KMimeType::mimeType (known_mimetype);
- else mimetype = KMimeType::findByUrl (url);
+ QMimeDatabase mdb;
+ QMimeType mimetype;
+ if (!known_mimetype.isEmpty ()) mimetype = mdb.mimeTypeForName (known_mimetype);
+ else mimetype = mdb.mimeTypeForUrl (url);
if (!force_external) {
// NOTE: Currently a known mimetype implies that the URL is local or served from the local machine.
// Thus, external web pages are *not* opened, here. Which is the behavior we want, although the implementation is ugly
- if (mimetype->is ("text/html")) {
+ if (mimetype.inherits ("text/html")) {
openHelpWindow (url, true);
return true; // TODO
}
@@ -418,10 +419,10 @@ bool RKWorkplace::openAnyUrl (const QUrl &url, const QString &known_mimetype, bo
RKWardMainWindow::getMain ()->askOpenWorkspace (url);
return true; // TODO
}
- if (mimetype->is ("text/plain")) {
+ if (mimetype.inherits ("text/plain")) {
return (openScriptEditor (url, QString (), RKSettingsModuleCommandEditor::matchesScriptFileFilter (url.fileName())));
}
- RK_DEBUG (APP, DL_INFO, "Don't know how to handle mimetype %s.", qPrintable (mimetype->name ()));
+ RK_DEBUG (APP, DL_INFO, "Don't know how to handle mimetype %s.", qPrintable (mimetype.name ()));
}
if (KMessageBox::questionYesNo (this, i18n ("The url you are trying to open ('%1') is not a local file or the filetype is not supported by RKWard. Do you want to open the url in the default application?", url.toDisplayString ()), i18n ("Open in default application?")) != KMessageBox::Yes) {
diff --git a/rkward/windows/rkworkplaceview.cpp b/rkward/windows/rkworkplaceview.cpp
index 28d856b..3f1dc8c 100644
--- a/rkward/windows/rkworkplaceview.cpp
+++ b/rkward/windows/rkworkplaceview.cpp
@@ -17,20 +17,20 @@
#include "rkworkplaceview.h"
-#include <ktabbar.h>
#include <klocale.h>
-#include <QKeySequence>
#include <kactioncollection.h>
-#include <QAction>
-#include <QIcon>
#include <kdeversion.h>
#include <kacceleratormanager.h>
-#include <QMenu>
#include <qapplication.h>
#include <qevent.h>
#include <qlayout.h>
#include <QToolButton>
+#include <QTabBar>
+#include <QAction>
+#include <QIcon>
+#include <QMenu>
+#include <QKeySequence>
#include "rkmdiwindow.h"
#include "rkworkplace.h"
diff --git a/rkward/windows/robjectbrowser.cpp b/rkward/windows/robjectbrowser.cpp
index ccee13a..2667531 100644
--- a/rkward/windows/robjectbrowser.cpp
+++ b/rkward/windows/robjectbrowser.cpp
@@ -25,7 +25,6 @@
#include <klocale.h>
#include <kinputdialog.h>
#include <kmessagebox.h>
-#include <kvbox.h>
#include "../rkward.h"
#include "rkhelpsearchwindow.h"
@@ -53,7 +52,7 @@ RObjectBrowser::RObjectBrowser (QWidget *parent, bool tool_window, const char *n
QVBoxLayout *layout = new QVBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
- layout_widget = new KVBox (this);
+ layout_widget = new QWidget (this);
layout->addWidget (layout_widget);
layout_widget->setFocusPolicy (Qt::StrongFocus);
@@ -94,6 +93,10 @@ void RObjectBrowser::initialize () {
RK_DEBUG (APP, DL_INFO, "creating workspace browser");
internal = new RObjectBrowserInternal (layout_widget);
+ QVBoxLayout *l = new QVBoxLayout (layout_widget);
+ l->setContentsMargins (0, 0, 0, 0);
+ l->addWidget (internal);
+
setFocusProxy (internal);
setMinimumSize (internal->minimumSize ());
}
diff --git a/rkward/windows/robjectbrowser.h b/rkward/windows/robjectbrowser.h
index 7e22496..620d02d 100644
--- a/rkward/windows/robjectbrowser.h
+++ b/rkward/windows/robjectbrowser.h
@@ -27,7 +27,6 @@ class RKObjectListViewSettings;
class QPushButton;
class RObject;
class RObjectBrowserInternal;
-class KVBox;
/**
This widget provides a browsable list of all objects in the R workspace
@@ -46,7 +45,7 @@ public:
void showEvent (QShowEvent *e) override;
private:
RObjectBrowserInternal *internal;
- KVBox *layout_widget;
+ QWidget *layout_widget;
bool locked;
friend class RKWardMainWindow;
More information about the rkward-tracker
mailing list