[rkward/frameworks] /: Merge branch 'master' into frameworks

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Mar 14 20:30:56 UTC 2016


Git commit 671381f35885deea4931434db0f5d392b92b9a6d by Thomas Friedrichsmeier.
Committed on 14/03/2016 at 20:30.
Pushed by tfry into branch 'frameworks'.

Merge branch 'master' into frameworks

M  +9    -5    ChangeLog
M  +1    -1    TODO
M  +6    -2    doc/rkwardplugins/index.docbook
M  +10   -4    rkward/core/robject.cpp
M  +4    -1    rkward/core/robject.h
M  +1    -0    rkward/dialogs/rkloadlibsdialog.cpp
M  +1    -1    rkward/misc/CMakeLists.txt
M  +3    -1    rkward/misc/multistringselector.cpp
M  +64   -5    rkward/misc/rkstandardactions.cpp
M  +6    -2    rkward/misc/rkstandardactions.h
M  +2    -1    rkward/plugin/rkpreviewbox.cpp
M  +1    -0    rkward/plugin/rkstandardcomponentgui.cpp
M  +1    -1    rkward/rbackend/FindR.cmake
M  +0    -2    rkward/rbackend/rinterface.cpp
M  +3    -4    rkward/rbackend/rkrbackend.cpp
M  +1    -3    rkward/rbackend/rkrbackend.h
M  +1    -1    rkward/rbackend/rkrbackendprotocol_backend.cpp
M  +1    -1    rkward/rbackend/rkreventloop.cpp
M  +0    -2    rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp
M  +0    -2    rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
M  +6    -3    rkward/rkconsole.cpp
M  +1    -3    rkward/rkconsole.h
M  +13   -1    rkward/settings/rksettingsmoduleoutput.cpp
M  +3    -0    rkward/settings/rksettingsmoduleoutput.h
M  +5    -3    rkward/windows/rkcommandeditorwindow.cpp
M  +8    -6    rkward/windows/rkcommandeditorwindow.h
M  +16   -1    rkward/windows/rkhtmlwindow.cpp
M  +1    -0    rkward/windows/rkhtmlwindow.h
M  +11   -7    rkward/windows/robjectbrowser.cpp
M  +8    -5    rkward/windows/robjectbrowser.h

http://commits.kde.org/rkward/671381f35885deea4931434db0f5d392b92b9a6d

diff --cc ChangeLog
index 30eaed2,9d124e5..0fe517e
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,14 -1,13 +1,18 @@@
 +- Show the message accompanying rk.show.files() or rk.edit.files() inside the main window, instead of a separate dialog
 +- File browser gains "Rename" context menu action
 +- File selection fields in plugin dialogs remember the last used directory (per session), and check for a valid selection
 +- Better handling of text drag-and-drop inside the R console window
 +
- --- Version 0.6.5 - XXXXXXXXXXXXXXX
- 
- 
+ UNRELEASED: --- Version 0.6.5 - Apr-02-2016
+ - Add option to override CSS file used for the output window
+ - When manually adding pluginmaps, load these after, not before other pluginmaps, by default
+ - Added context menu option to search for information on current symbol online
+ - Fixed: Wizard plugins would be too small, initially
+ - Fixed: Help Search was not longer working correctly with R 3.2.x
+ - Fix compilation with R 3.3.x
  - Provide better status feedback when searching / filtering among installable packages
  - Add access to basic menu items for docked previews
- - Move preview controls to the button-column of dialogs                                            TODO document, polish
+ - Move preview controls to the button-column of dialogs
  - Add preview to Sort data-, Subset data, and Recode categorical data-plugins
  - Add preview to Power Analysis plugin
  - Add support for adding "htmlwidget"- and "gvis"-class objects to the output window via rk.print()
diff --cc TODO
index d85b105,c2747fb..09adb91
--- a/TODO
+++ b/TODO
@@@ -2,35 -2,6 +2,35 @@@ The following list of TODO-items is NO
  Also, plans change frequently. If something is listed for a specific release, that's no more than a rough plan.
  All in all, this TODO list is mostly for internal purposes, and many parts may not necessarily be intellegible to anybody but the authors.
  
 +KF5 port:
 +Things to do:
- - Device window embedding / remove qwinhost -> test / fix on Windows
 +- Grep for "KF5 TODO"
 +- Remove katepart status bar from all previews (including in wizard)
 +- Replace Q_WS_* and Q_OS_X11 as appropriate
 +Things to test at the end:
 +- Everthing concerning loading / saving, from recent files, scripts, workspace, etc.
 +  - Moved installations, moved workspaces.
 +Knwon issues to fix:
 +- Initial window placement for plugins is completely borked. One way around this seems to be to inherit RKStandardComponentGUI from QDialog. Does that work for inline embedded plugins?
 +- Initial window placement for plots is always 0, 0 on screen 1, apparently. The above workaround may not be available, here?
++- "Search Online" functionality is broken (except for package environments, for some reason)
 +
 +Minor layout stuff to fix in plugins:
 +- Barplot: "Display values" should be checkable frame
 +- Sort data: optionset should simply use vertical stacking, or fix the horizontal alignment
 +
 +Upcoming porting efforts: Port from QtScript to QJSEngine:
 +- Unforunately, QJSEngine lacks support for pre-compiled JS (QScriptProgram), ATM (Qt 5.5). We'll need some other optimization.
 +- Idea: Use _one_ engine for each plugin, _including_ any embedded plugins. Wrap existing JS code into a closure, exporting only the "primary" functions as properties of an object.
 +  - Then, the scriptbackend will call plugin_a.preprocess(), etc.
 +  - The scriptbackend knows which of the plugins it is currently dealing with, and thus can trivially relay all getValue()-calls as appropriate.
 +- Same approach for UI scripting.
 +
 +Port from QtWebKit to QtWebEngine
 +- Should be mostly unproblematic
 +- Somewhat unfortunate that QWebElement will be gone. We might be using this to amend the context menu, e.g. for copying one section to clipboard / deleting one section, etc.
 +  - Could perhaps be done by catching contextmenu event in JS, instead, then send to frontend, somehow.
 +
  New features in R 3.1.0 to make use of / support:
  
  - A new browser command s has been added, to “step into” function calls.
diff --cc rkward/misc/CMakeLists.txt
index 726f27a,c18ffa7..eba6c79
--- a/rkward/misc/CMakeLists.txt
+++ b/rkward/misc/CMakeLists.txt
@@@ -26,11 -29,15 +26,11 @@@ SET(misc_STAT_SRC
     rkdynamicsearchline.cpp
     rkaccordiontable.cpp
     rkxmlguipreviewarea.cpp
 +   rkdialogbuttonbox.cpp
     )
  
 -QT4_AUTOMOC(${misc_STAT_SRCS})
 -# Urghs. QT4_AUTOMOC scans only the .h-file for Q_OBJECT macros. Let's hope this will be better with KF5
 -QT4_GENERATE_MOC (rkaccordiontable.cpp ${CMAKE_CURRENT_BINARY_DIR}/rkaccordiontablemodel_moc.cpp)
 -QT4_GENERATE_MOC (rkstandardactions.cpp ${CMAKE_CURRENT_BINARY_DIR}/rkstandardactions_moc.cpp)
 -
  ADD_LIBRARY(misc STATIC ${misc_STAT_SRCS})
- TARGET_LINK_LIBRARIES(misc Qt5::Widgets KF5::WidgetsAddons KF5::KIOWidgets Qt5::Xml KF5::ConfigCore KF5::Parts KF5::WindowSystem)
 -
++TARGET_LINK_LIBRARIES(misc Qt5::Widgets KF5::WidgetsAddons KF5::KIOWidgets Qt5::Xml KF5::ConfigCore KF5::Parts KF5::WindowSystem KF5::TextEditor)
  
  ########### install files ###############
  
diff --cc rkward/misc/rkstandardactions.cpp
index 8811bda,663e8f5..d8af816
--- a/rkward/misc/rkstandardactions.cpp
+++ b/rkward/misc/rkstandardactions.cpp
@@@ -73,11 -73,67 +75,68 @@@ QAction* RKStandardActions::runAll (RKM
  	return ret;
  }
  
- QAction* RKStandardActions::functionHelp (RKMDIWindow *window, const QObject *receiver, const char *member) {
 -class RKSearchRHelpAction : public KAction {
++class RKSearchRHelpAction : public QAction {
+ 	Q_OBJECT
+ public:
 -	RKSearchRHelpAction (QObject *parent, RKScriptContextProvider *context_provider) : KAction (parent) {
++	RKSearchRHelpAction (QObject *parent, RKScriptContextProvider *context_provider) : QAction (parent) {
+ 		RK_TRACE (MISC);
+ 		provider = context_provider;
+ 		setText (i18n ("&Function reference"));
+ 		setShortcut (Qt::Key_F2);
+ 		connect (this, SIGNAL (triggered(bool)), this, SLOT (doSearch()));
+ 	};
+ public slots:
+ 	void doSearch () {
+ 		RK_TRACE (MISC);
+ 		QString symbol, package;
+ 		provider->currentHelpContext (&symbol, &package);
+ 		RKHelpSearchWindow::mainHelpSearch ()->getFunctionHelp (symbol, package);
+ 	};
+ private:
+ 	RKScriptContextProvider *provider;
+ };
+ 
 -KAction* RKStandardActions::functionHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider) {
++QAction* RKStandardActions::functionHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider) {
  	RK_TRACE (MISC);
  
- 	QAction* ret = window->standardActionCollection ()->addAction ("function_reference", receiver, member);
- 	ret->setText (i18n ("&Function reference"));
- 	window->standardActionCollection ()->setDefaultShortcut (ret, Qt::Key_F2);
 -	KAction* ret = new RKSearchRHelpAction (window, context_provider);
++	QAction* ret = new RKSearchRHelpAction (window, context_provider);
+ 	window->standardActionCollection ()->addAction ("function_reference", ret);
  	return ret;
  }
+ 
+ #include <kurifilter.h>
+ #include <ktoolinvocation.h>
+ 
 -class RKSearchOnlineHelpAction : public KAction {
++class RKSearchOnlineHelpAction : public QAction {
+ 	Q_OBJECT
+ public:
 -	RKSearchOnlineHelpAction (QObject *parent, RKScriptContextProvider *context_provider) : KAction (parent) {
++	RKSearchOnlineHelpAction (QObject *parent, RKScriptContextProvider *context_provider) : QAction (parent) {
+ 		RK_TRACE (MISC);
+ 		provider = context_provider;
+ 		setText (i18n ("Search Online"));
+ 		connect (this, SIGNAL (triggered(bool)), this, SLOT (doSearch()));
+ 	};
+ public slots:
+ 	void doSearch () {
+ 		RK_TRACE (MISC);
+ 		QString symbol, package;
+ 		provider->currentHelpContext (&symbol, &package);
+ 		KUriFilterData data (symbol + " " + package + " R");
 -		KUriFilter::self ()->filterSearchUri (data, KUriFilter::NormalTextFilter);
++		bool ok = KUriFilter::self ()->filterSearchUri (data, KUriFilter::NormalTextFilter);
++		RK_DEBUG (MISC, DL_DEBUG, "Searching for %s in %s online -> %d: %s", qPrintable (symbol), qPrintable (package), ok, qPrintable (data.uri ().url ()));
+ 		KToolInvocation::invokeBrowser (data.uri ().url ());
+ 	};
+ private:
+ 	RKScriptContextProvider *provider;
+ };
+ 
 -KAction* RKStandardActions::onlineHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider) {
++QAction* RKStandardActions::onlineHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider) {
+ 	RK_TRACE (MISC);
+ 
+ 	// KF5 TODO: Add / replace with submenu to select search provider -> KUriFilterSearchProviderActions
 -	KAction* ret = new RKSearchOnlineHelpAction (window, context_provider);
++	QAction* ret = new RKSearchOnlineHelpAction (window, context_provider);
+ 	window->standardActionCollection ()->addAction ("search_online", ret);
+ 	return ret;
+ }
+ 
 -#include "rkstandardactions_moc.cpp"
++#include "rkstandardactions.moc"
diff --cc rkward/misc/rkstandardactions.h
index 5429f75,9571404..92b2f33
--- a/rkward/misc/rkstandardactions.h
+++ b/rkward/misc/rkstandardactions.h
@@@ -27,15 -28,18 +28,18 @@@ class RKScriptContextProvider
  
  @author Thomas Friedrichsmeier */
  namespace RKStandardActions {
 -	KAction *copyLinesToOutput (RKMDIWindow *window, const QObject *receiver=0, const char *member=0);
 +	QAction *copyLinesToOutput (RKMDIWindow *window, const QObject *receiver=0, const char *member=0);
  /** Allows special pasting modes for script windows.
  @param member needs to have the signature void fun (const QString&). */
 -	KAction* pasteSpecial (RKMDIWindow *window, const QObject *receiver=0, const char *member=0);
 +	QAction* pasteSpecial (RKMDIWindow *window, const QObject *receiver=0, const char *member=0);
  
 -	KAction* runCurrent (RKMDIWindow *window, const QObject *receiver=0, const char *member=0, bool current_or_line=false);
 -	KAction* runAll (RKMDIWindow *window, const QObject *receiver=0, const char *member=0);
 +	QAction* runCurrent (RKMDIWindow *window, const QObject *receiver=0, const char *member=0, bool current_or_line=false);
 +	QAction* runAll (RKMDIWindow *window, const QObject *receiver=0, const char *member=0);
  
- 	QAction* functionHelp (RKMDIWindow *window, const QObject *receiver=0, const char *member=0);
 -	KAction* functionHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider);
++	QAction* functionHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider);
+ /** Search for current symbol / selection, online. Note that you will not have to connect this action to any slot to work. It does everything by itself.
+  *  It will query the given context_provider for context. */
 -	KAction* onlineHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider);
++	QAction* onlineHelp (RKMDIWindow *window, RKScriptContextProvider *context_provider);
  };
  
  #endif
diff --cc rkward/rbackend/rkrbackend.h
index 42f75c7,96d5cf1..c933941
--- a/rkward/rbackend/rkrbackend.h
+++ b/rkward/rbackend/rkrbackend.h
@@@ -30,10 -30,8 +30,8 @@@
  #include "rcommandstack.h"
  #include "rkrbackendprotocol_backend.h"
  
 -#ifdef Q_WS_WIN
 +#ifdef Q_OS_WIN
- extern "C" {
- 	void RK_scheduleIntr();
- }
+ void RK_scheduleIntr();
  #endif
  
  class QStringList;
diff --cc rkward/rkconsole.h
index bf1e107,500715a..98ad69d
--- a/rkward/rkconsole.h
+++ b/rkward/rkconsole.h
@@@ -61,7 -61,8 +61,8 @@@ public
  /** Returns the current cursor position, within the current command (without taking into account the prefix). Returns -1 if the cursor is not on the line containing the command. */
  	int currentCursorPositionInCommand ();
  	void doTabCompletion ();
 -	QString provideContext (int line_rev);
 -	void currentHelpContext (QString *symbol, QString *package);  // KF5 TODO: override keyword
 +	QString provideContext (int line_rev) override;
++	void currentHelpContext (QString *symbol, QString *package) override;
  
  	static RKConsole *mainConsole () { return main_console; };
  	static void setMainConsole (RKConsole *console) { main_console = console; };
@@@ -135,12 -136,11 +136,11 @@@ friend class RKConsolePart
  
  	bool tab_key_pressed_before;
  
- 	QAction* context_help_action;
 -	KAction* run_selection_action;
 -	KAction* interrupt_command_action;
 -	KAction* copy_commands_action;
 -	KAction* copy_literal_action;
 -	KAction* paste_action;
 +	QAction* run_selection_action;
 +	QAction* interrupt_command_action;
 +	QAction* copy_commands_action;
 +	QAction* copy_literal_action;
 +	QAction* paste_action;
  
  	KActionCollection *kate_edit_actions;
  	void triggerEditAction (QString name);
diff --cc rkward/settings/rksettingsmoduleoutput.cpp
index d468775,07ff5b6..0a0e6ec
--- a/rkward/settings/rksettingsmoduleoutput.cpp
+++ b/rkward/settings/rksettingsmoduleoutput.cpp
@@@ -26,9 -27,10 +26,11 @@@
  #include <qcheckbox.h>
  #include <QVBoxLayout>
  #include <QComboBox>
 +#include <QSpinBox>
  
  #include "../rkglobals.h"
+ #include "../misc/getfilenamewidget.h"
+ #include "../misc/rkcommonfunctions.h"
  #include "../rbackend/rinterface.h"
  #include "../debug.h"
  
@@@ -44,9 -46,10 +46,10 @@@ RKCarbonCopySettings::RKCarbonCopySetti
  	RK_TRACE (SETTINGS);
  
  	QVBoxLayout *main_vbox = new QVBoxLayout (this);
+ 	main_vbox->setContentsMargins (0, 0, 0, 0);
  	cc_globally_enabled_box = new QGroupBox (i18n ("Carbon copy commands to output"), this);
  	cc_globally_enabled_box->setCheckable (true);
 -	connect (cc_globally_enabled_box, SIGNAL (clicked(bool)), this, SLOT (settingChanged()));
 +	connect (cc_globally_enabled_box, &QGroupBox::clicked, this, &RKCarbonCopySettings::settingChanged);
  	main_vbox->addWidget (cc_globally_enabled_box);
  
  	QVBoxLayout *group_layout = new QVBoxLayout (cc_globally_enabled_box);
diff --cc rkward/settings/rksettingsmoduleoutput.h
index 87a80de,8e110ac..42dd997
--- a/rkward/settings/rksettingsmoduleoutput.h
+++ b/rkward/settings/rksettingsmoduleoutput.h
@@@ -24,8 -24,9 +24,9 @@@
  class QCheckBox;
  class QGroupBox;
  class QComboBox;
 -class KIntSpinBox;
 +class QSpinBox;
  class RCommand;
+ class GetFileNameWidget;
  
  /**
  Allows to configure which types of commands should be "carbon copied" to the output window. Like the RKSettingsModules classes, this class encapsulates both, the setting itself,
@@@ -95,10 -96,11 +96,11 @@@ private
  	QCheckBox *auto_show_box;
  	QCheckBox *auto_raise_box;
  	QComboBox *graphics_type_box;
 -	KIntSpinBox *graphics_width_box;
 -	KIntSpinBox *graphics_height_box;
 -	KIntSpinBox *graphics_jpg_quality_box;
 +	QSpinBox *graphics_width_box;
 +	QSpinBox *graphics_height_box;
 +	QSpinBox *graphics_jpg_quality_box;
  	RKCarbonCopySettings *cc_settings;
+ 	GetFileNameWidget *custom_css_file_box;
  
  	static bool auto_show;
  	static bool auto_raise;
diff --cc rkward/windows/rkcommandeditorwindow.cpp
index f16cbda,e31982b..c4356ca
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@@ -200,12 -214,12 +200,13 @@@ void RKCommandEditorWindow::initializeA
  	action_run_all = RKStandardActions::runAll (this, this, SLOT (runAll()));
  	action_run_current = RKStandardActions::runCurrent (this, this, SLOT (runCurrent()), true);
  	// NOTE: enter_and_submit is not currently added to the menu
 -	KAction *action = ac->addAction ("enter_and_submit", this, SLOT (enterAndSubmit()));
 +	QAction *action = ac->addAction ("enter_and_submit", this, SLOT (enterAndSubmit()));
  	action->setText (i18n ("Insert line break and run"));
 -	action->setShortcuts (KShortcut (Qt::AltModifier + Qt::Key_Return, Qt::AltModifier + Qt::Key_Enter));
 +	ac->setDefaultShortcuts (action, QList<QKeySequence>() << Qt::AltModifier + Qt::Key_Return << Qt::AltModifier + Qt::Key_Enter);
 +	ac->setDefaultShortcut (action, Qt::AltModifier + Qt::Key_Return); // KF5 TODO: This line needed only for KF5 < 5.2, according to documentation
  
- 	action_help_function = RKStandardActions::functionHelp (this, this, SLOT (showHelp()));
+ 	RKStandardActions::functionHelp (this, this);
+ 	RKStandardActions::onlineHelp (this, this);
  
  	actionmenu_run_block = new KActionMenu (i18n ("Run block"), this);
  	actionmenu_run_block->setDelayed (false);	// KDE4: TODO does not work correctly in the tool bar.
diff --cc rkward/windows/rkcommandeditorwindow.h
index 0cf2cbb,fcb17a0..4e044b2
--- a/rkward/windows/rkcommandeditorwindow.h
+++ b/rkward/windows/rkcommandeditorwindow.h
@@@ -164,9 -192,10 +169,10 @@@ public
  	void setReadOnly (bool ro);
  
  /** Return current url */
 -	KUrl url ();
 +	QUrl url ();
  
 -	QString provideContext (int line_rev);
 -	void currentHelpContext (QString* symbol, QString* package);  // KF5 TODO: add override keyword
 +	QString provideContext (int line_rev) override;
++	void currentHelpContext (QString* symbol, QString* package) override;
  	QString currentCompletionWord () const;
  
  	void highlightLine (int linenum);
@@@ -252,17 -287,15 +256,15 @@@ private
  	KActionMenu* actionmenu_unmark_block;
  	KActionMenu* actionmenu_run_block;
  
 -	KAction* action_run_all;
 -	KAction* action_run_current;
 +	QAction* action_run_all;
 +	QAction* action_run_current;
  
 -	KAction* action_setwd_to_script;
 +	QAction* action_setwd_to_script;
  
- 	QAction* action_help_function;
- 
 -	KUrl previous_autosave_url;
 +	QUrl previous_autosave_url;
  	QTimer* autosave_timer;
  
 -	KUrl delete_on_close;
 +	QUrl delete_on_close;
  };
  
  /** Simple class to provide HTML highlighting for arbitrary R code. */
diff --cc rkward/windows/rkhtmlwindow.cpp
index 1599b44,e53b7df..ebc13d3
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@@ -638,16 -613,16 +638,16 @@@ void RKHTMLWindowPart::initActions () 
  	// output window actions
  	outputFlush = actionCollection ()->addAction ("output_flush", window, SLOT (flushOutput()));
  	outputFlush->setText (i18n ("&Flush Output"));
 -	outputFlush->setIcon (KIcon ("edit-delete"));
 +	outputFlush->setIcon (QIcon::fromTheme("edit-delete"));
  
- 	outputRefresh = actionCollection ()->addAction ("output_refresh", window->page->action (QWebPage::ReloadAndBypassCache), SLOT (trigger()));
+ 	outputRefresh = actionCollection ()->addAction ("output_refresh", window, SLOT (refresh()));
  	outputRefresh->setText (i18n ("&Refresh Output"));
 -	outputRefresh->setIcon (KIcon ("view-refresh"));
 +	outputRefresh->setIcon (QIcon::fromTheme("view-refresh"));
  
  	actionCollection ()->addAction (KStandardAction::Find, "find", window->findbar, SLOT (activate()));
 -	KAction* findAhead = actionCollection ()->addAction ("find_ahead", new KAction (i18n ("Find as you type"), this));
 -	findAhead->setShortcut ('/');
 -	connect (findAhead, SIGNAL (triggered(bool)), window->findbar, SLOT (activate()));
 +	QAction* findAhead = actionCollection ()->addAction ("find_ahead", new QAction (i18n ("Find as you type"), this));
 +	actionCollection ()->setDefaultShortcut (findAhead, '/');
 +	connect (findAhead, &QAction::triggered, window->findbar, &RKFindBar::activate);
  	actionCollection ()->addAction (KStandardAction::FindNext, "find_next", window->findbar, SLOT (forward()));;
  	actionCollection ()->addAction (KStandardAction::FindPrev, "find_previous", window->findbar, SLOT (backward()));;;
  }
@@@ -1044,10 -1019,17 +1044,17 @@@ void RKOutputWindowManager::registerWin
  void RKOutputWindowManager::setCurrentOutputPath (const QString &_path) {
  	RK_TRACE (APP);
  
 -	KUrl url = KUrl::fromLocalFile (_path);
 -	url.cleanPath ();
 +	QUrl url = QUrl::fromLocalFile (_path);
 +	url = url.adjusted (QUrl::NormalizePathSegments);
  	QString path = url.toLocalFile ();
  
+ #ifdef Q_OS_WIN
+ 	// On windows, when flushing the output (i.e. deleting, re-creating it), KDirWatch seems to purge the file from the
+ 	// watch list (KDE 4.10.2; always?), so we need to re-add it. To make things complex, however, this may happen
+ 	// asynchronously, with this function called (via rk.set.output.html.file()), _before_ KDirWatch purges the file.
+ 	// To hack around the race condition, we re-watch the output file after a short delay.
+ 	QTimer::singleShot (100, this, SLOT (rewatchOutput ()));
+ #endif
  	if (path == current_default_path) return;
  
  	if (!windows.contains (path)) {
diff --cc rkward/windows/robjectbrowser.cpp
index 773b917,5643a45..314a24a
--- a/rkward/windows/robjectbrowser.cpp
+++ b/rkward/windows/robjectbrowser.cpp
@@@ -92,11 -94,7 +93,11 @@@ void RObjectBrowser::initialize () 
  
  	RK_DEBUG (APP, DL_INFO, "creating workspace browser");
  
- 	internal = new RObjectBrowserInternal (layout_widget);
+ 	internal = new RObjectBrowserInternal (layout_widget, this);
 +	QVBoxLayout *l = new QVBoxLayout (layout_widget);
 +	l->setContentsMargins (0, 0, 0, 0);
 +	l->addWidget (internal);
 +
  	setFocusProxy (internal);
  	setMinimumSize (internal->minimumSize ());
  }
@@@ -117,24 -115,24 +118,24 @@@ RObjectBrowserInternal::RObjectBrowserI
  	update_button = new QPushButton (i18n ("Update"), this);
  	vbox->addWidget (update_button);
  
- 	actions.insert (Help, new QAction (i18n ("Search Help"), this));
- 	connect (actions[Help], &QAction::triggered, this, &RObjectBrowserInternal::popupHelp);
+ 	actions.insert (Help, RKStandardActions::functionHelp (browser, this));
+ 	actions.insert (SearchOnline, RKStandardActions::onlineHelp (browser, this));
  	actions.insert (Edit, new QAction (i18n ("Edit"), this));
 -	connect (actions[Edit], SIGNAL(triggered(bool)), this, SLOT(popupEdit()));
 +	connect (actions[Edit], &QAction::triggered, this, &RObjectBrowserInternal::popupEdit);
  	actions.insert (View, new QAction (i18n ("View"), this));
 -	connect (actions[View], SIGNAL(triggered(bool)), this, SLOT(popupView()));
 +	connect (actions[View], &QAction::triggered, this, &RObjectBrowserInternal::popupView);
  	actions.insert (Rename, new QAction (i18n ("Rename"), this));
 -	connect (actions[Rename], SIGNAL(triggered(bool)), this, SLOT(popupRename()));
 +	connect (actions[Rename], &QAction::triggered, this, &RObjectBrowserInternal::popupRename);
  	actions.insert (Copy, new QAction (i18n ("Copy to new symbol"), this));
 -	connect (actions[Copy], SIGNAL(triggered(bool)), this, SLOT(popupCopy()));
 +	connect (actions[Copy], &QAction::triggered, this, &RObjectBrowserInternal::popupCopy);
  	actions.insert (CopyToGlobalEnv, new QAction (i18n ("Copy to .GlobalEnv"), this));
 -	connect (actions[CopyToGlobalEnv], SIGNAL(triggered(bool)), this, SLOT(popupCopyToGlobalEnv()));
 +	connect (actions[CopyToGlobalEnv], &QAction::triggered, this, &RObjectBrowserInternal::popupCopyToGlobalEnv);
  	actions.insert (Delete, new QAction (i18n ("Delete"), this));
 -	connect (actions[Delete], SIGNAL(triggered(bool)), this, SLOT(popupDelete()));
 +	connect (actions[Delete], &QAction::triggered, this, &RObjectBrowserInternal::popupDelete);
  	actions.insert (Unload, new QAction (i18n ("Unload Package"), this));
 -	connect (actions[Unload], SIGNAL(triggered(bool)), this, SLOT(popupUnload()));
 +	connect (actions[Unload], &QAction::triggered, this, &RObjectBrowserInternal::popupUnload);
  	actions.insert (LoadUnloadPackages, new QAction (i18n ("Load / Unload Packages"), this));
 -	connect (actions[LoadUnloadPackages], SIGNAL(triggered(bool)), RKWardMainWindow::getMain(), SLOT(slotFileLoadLibs()));
 +	connect (actions[LoadUnloadPackages], &QAction::triggered, RKWardMainWindow::getMain(), &RKWardMainWindow::slotFileLoadLibs);
  
  	QAction* sep = list_view->contextMenu ()->insertSeparator (list_view->contextMenu ()->actions ().value (0));
  	list_view->contextMenu ()->insertActions (sep, actions);
diff --cc rkward/windows/robjectbrowser.h
index 620d02d,2fec0bf..cadc453
--- a/rkward/windows/robjectbrowser.h
+++ b/rkward/windows/robjectbrowser.h
@@@ -80,7 -82,8 +81,8 @@@ private slots
  	void doubleClicked (const QModelIndex &index);
  protected:
  /** reimplemnented from QWidget to make show the globalenv object when activated (other than by mouse click) */
 -	void focusInEvent (QFocusEvent *e);
 -	void currentHelpContext (QString *symbol, QString *package); // KF5 TODO: override
 +	void focusInEvent (QFocusEvent *e) override;
++	void currentHelpContext (QString *symbol, QString *package) override;
  private:
  	enum PopupActions {
  		Help=0,



More information about the rkward-tracker mailing list