[education/rkward] rkward: Fix const value should be passed as reference.

Thomas Friedrichsmeier null at kde.org
Thu Mar 31 19:43:37 BST 2022


Git commit ee30d2d6f46cca36c2ade89913388e3e923c8d66 by Thomas Friedrichsmeier.
Committed on 31/03/2022 at 18:43.
Pushed by tfry into branch 'master'.

Fix const value should be passed as reference.

M  +1    -1    rkward/agents/rksaveagent.cpp
M  +1    -1    rkward/core/rkpseudoobjects.cpp
M  +1    -1    rkward/core/rkpseudoobjects.h
M  +1    -1    rkward/core/robjectlist.cpp
M  +1    -1    rkward/core/robjectlist.h
M  +2    -2    rkward/main.cpp
M  +1    -1    rkward/misc/rkcommonfunctions.cpp
M  +1    -1    rkward/misc/rkcommonfunctions.h
M  +1    -1    rkward/misc/rkoutputdirectory.cpp
M  +6    -6    rkward/plugin/rkcomponentmap.cpp
M  +2    -2    rkward/plugin/rkcomponentmap.h
M  +1    -1    rkward/plugin/rkstandardcomponent.cpp
M  +1    -1    rkward/plugin/rkstandardcomponent.h
M  +3    -3    rkward/rbackend/rkrbackend.cpp
M  +1    -1    rkward/rkconsole.cpp
M  +1    -1    rkward/rkconsole.h
M  +1    -1    rkward/scriptbackends/qtscriptbackend.cpp
M  +1    -1    rkward/scriptbackends/qtscriptbackend.h
M  +1    -1    rkward/settings/rksettings.cpp
M  +1    -1    rkward/settings/rksettingsmoduleplugins.cpp
M  +1    -1    rkward/settings/rksettingsmoduleplugins.h
M  +2    -2    rkward/windows/rkcommandeditorwindow.cpp
M  +2    -2    rkward/windows/rkcommandeditorwindow.h
M  +2    -2    rkward/windows/rkhtmlwindow.cpp
M  +2    -2    rkward/windows/rkhtmlwindow.h
M  +5    -5    rkward/windows/rkworkplace.cpp

https://invent.kde.org/education/rkward/commit/ee30d2d6f46cca36c2ade89913388e3e923c8d66

diff --git a/rkward/agents/rksaveagent.cpp b/rkward/agents/rksaveagent.cpp
index 044c9a74..5accacfd 100644
--- a/rkward/agents/rksaveagent.cpp
+++ b/rkward/agents/rksaveagent.cpp
@@ -35,7 +35,7 @@
 // We save to several files at once, meaning the standard overwrite check is not quite good enough for us.
 // More importantly, it is entirely broken in KF5 < 5.22.0 (https://bugs.kde.org/show_bug.cgi?id=360666)
 // So check for overwriting ourselves.
-bool checkOverwriteWorkspace (QUrl url, QWidget *parent) {
+bool checkOverwriteWorkspace (const QUrl &url, QWidget *parent) {
 	if (url.isEmpty () || !url.isLocalFile ()) {
 		return true;
 	}
diff --git a/rkward/core/rkpseudoobjects.cpp b/rkward/core/rkpseudoobjects.cpp
index 87fc296c..7a35b358 100644
--- a/rkward/core/rkpseudoobjects.cpp
+++ b/rkward/core/rkpseudoobjects.cpp
@@ -49,7 +49,7 @@ QString RSlotsPseudoObject::makeChildName (const QString &short_child_name, bool
 	return (parent->getFullName (options) + '@' + safe_name);
 }
 
-RKNamespaceObject::RKNamespaceObject (REnvironmentObject* package, const QString name) : REnvironmentObject (package, name.isNull () ? "NAMESPACE" : name) {
+RKNamespaceObject::RKNamespaceObject (REnvironmentObject* package, const QString &name) : REnvironmentObject (package, name.isNull () ? "NAMESPACE" : name) {
 	RK_TRACE (OBJECTS);
 	type |= PseudoObject;
 	pseudo_object_types.insert (this, NamespaceObject);
diff --git a/rkward/core/rkpseudoobjects.h b/rkward/core/rkpseudoobjects.h
index db92ed7f..13ea19f6 100644
--- a/rkward/core/rkpseudoobjects.h
+++ b/rkward/core/rkpseudoobjects.h
@@ -48,7 +48,7 @@ rather call it a "special" object, instead).
 */
 class RKNamespaceObject : public REnvironmentObject {
 public:
-	explicit RKNamespaceObject (REnvironmentObject* package, const QString name = QString ());
+	explicit RKNamespaceObject (REnvironmentObject* package, const QString &name = QString ());
 	~RKNamespaceObject ();
 
 	QString getFullName (int) const override;
diff --git a/rkward/core/robjectlist.cpp b/rkward/core/robjectlist.cpp
index bf19ae56..fec20cc7 100644
--- a/rkward/core/robjectlist.cpp
+++ b/rkward/core/robjectlist.cpp
@@ -217,7 +217,7 @@ void RObjectList::updateEnvironments (const QStringList &_env_names, bool force_
 	RK_DO (RK_ASSERT (childmap == newchildmap), OBJECTS, DL_DEBUG);	// this is an expensive assert, hence wrapping it inside RK_DO
 }
 
-void RObjectList::updateNamespaces (const QStringList namespace_names) {
+void RObjectList::updateNamespaces (const QStringList &namespace_names) {
 	RK_TRACE (OBJECTS);
 
 	QStringList orphan_namespace_names;
diff --git a/rkward/core/robjectlist.h b/rkward/core/robjectlist.h
index 0d77be95..6cb55865 100644
--- a/rkward/core/robjectlist.h
+++ b/rkward/core/robjectlist.h
@@ -87,7 +87,7 @@ protected:
 	bool updateStructure (RData *new_data) override;
 	void rCommandDone (RCommand *command) override;
 	void updateEnvironments (const QStringList &env_names, bool force_globalenv_update);
-	void updateNamespaces (const QStringList namespace_names);
+	void updateNamespaces (const QStringList &namespace_names);
 private:
 	friend class RKLoadAgent;
 	friend class RKSaveAgent;
diff --git a/rkward/main.cpp b/rkward/main.cpp
index 1150f58b..e97bbc59 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -111,7 +111,7 @@
 #	define PATH_VAR_SEP ':'
 #endif
 
-QString findExeAtPath (const QString appname, const QString &path) {
+QString findExeAtPath (const QString &appname, const QString &path) {
 	QDir dir (path);
 	dir.makeAbsolute ();
 	if (QFileInfo (dir.filePath (appname)).isExecutable ()) return dir.filePath (appname);
@@ -171,7 +171,7 @@ void RKDebug (int flags, int level, const char *fmt, ...) {
 
 /** Check if the given path to R (or "auto") is executable, and fail with an appropriate message, otherwise. If "auto" is given as input, try to auto-locate an R installation at the standard
 installation path(s) for this platform. */
-QString resolveRSpecOrFail (QString input, QString message) {
+QString resolveRSpecOrFail (QString input, const QString &message) {
 	if (input == QLatin1String ("auto")) {
 		QString ret;
 #ifdef Q_OS_MACOS
diff --git a/rkward/misc/rkcommonfunctions.cpp b/rkward/misc/rkcommonfunctions.cpp
index ad177e43..ed5fc4ad 100644
--- a/rkward/misc/rkcommonfunctions.cpp
+++ b/rkward/misc/rkcommonfunctions.cpp
@@ -235,7 +235,7 @@ namespace RKCommonFunctions {
 		return out;
 	}
 
-	void setTips (const QString tip, QWidget *first, QWidget *second, QWidget *third) {
+	void setTips (const QString &tip, QWidget *first, QWidget *second, QWidget *third) {
 		for (int i=0; i < 3; ++i) {
 			QWidget *w = first;
 			if (i == 1) w = second;
diff --git a/rkward/misc/rkcommonfunctions.h b/rkward/misc/rkcommonfunctions.h
index 0e57cdc2..f934f20f 100644
--- a/rkward/misc/rkcommonfunctions.h
+++ b/rkward/misc/rkcommonfunctions.h
@@ -56,7 +56,7 @@ namespace RKCommonFunctions {
 	QString unescape (const QString &in);
 
 /** simultaneously sets tool tips and what's this tips on up to three QWidgets */
-	void setTips (const QString tip, QWidget *first, QWidget *second=0, QWidget *third=0);
+	void setTips (const QString &tip, QWidget *first, QWidget *second=0, QWidget *third=0);
 	QString noteSettingsTakesEffectAfterRestart ();
 /** Passing commands as part of arguments to windows shell scripts will fail miserably for paths with spaces or special characters. Transform to short path names for safety. No-op on sane platforms.*/
 	QString windowsShellScriptSafeCommand (const QString &orig);
diff --git a/rkward/misc/rkoutputdirectory.cpp b/rkward/misc/rkoutputdirectory.cpp
index 29f0fea8..11950676 100644
--- a/rkward/misc/rkoutputdirectory.cpp
+++ b/rkward/misc/rkoutputdirectory.cpp
@@ -39,7 +39,7 @@
 #include "../debug.h"
 
 /** much like `ls -Rl`. List directory contents including timestamps and sizes, recursively. Used to detect whether an output directory has any changes. */
-void listDirectoryState(const QString& _dir, QString *list, const QString prefix) {
+void listDirectoryState(const QString& _dir, QString *list, const QString &prefix) {
 	RK_TRACE(APP);
 
 	QDir dir(_dir);
diff --git a/rkward/plugin/rkcomponentmap.cpp b/rkward/plugin/rkcomponentmap.cpp
index 73a80f07..882fe5cb 100644
--- a/rkward/plugin/rkcomponentmap.cpp
+++ b/rkward/plugin/rkcomponentmap.cpp
@@ -173,7 +173,7 @@ void RKComponentGUIXML::Menu::clear () {
 	groups.clear ();
 }
 
-RKComponentGUIXML::Group *findOrCreateGroup (RKComponentGUIXML::Menu *parent, const QString group) {
+RKComponentGUIXML::Group *findOrCreateGroup (RKComponentGUIXML::Menu *parent, const QString &group) {
 	// try to find group
 	int bottom_index = -1;
 	QList<RKComponentGUIXML::Group*> &list = parent->groups;
@@ -204,7 +204,7 @@ RKComponentGUIXML::Group *findOrCreateGroup (RKComponentGUIXML::Menu *parent, co
 	return new_group;
 }
 
-void insertGroup (RKComponentGUIXML::Menu *parent, const QString &group_id, bool separated, const QString after_group) {
+void insertGroup (RKComponentGUIXML::Menu *parent, const QString &group_id, bool separated, const QString &after_group) {
 	RK_TRACE (PLUGIN);
 	RK_ASSERT (parent);
 
@@ -231,7 +231,7 @@ void insertGroup (RKComponentGUIXML::Menu *parent, const QString &group_id, bool
 	}
 }
 
-void insertEntry (RKComponentGUIXML::Menu *parent, RKComponentGUIXML::Entry *entry, const QString in_group) {
+void insertEntry (RKComponentGUIXML::Menu *parent, RKComponentGUIXML::Entry *entry, const QString &in_group) {
 	RK_TRACE (PLUGIN);
 	RK_ASSERT (parent);
 
@@ -242,7 +242,7 @@ void insertEntry (RKComponentGUIXML::Menu *parent, RKComponentGUIXML::Entry *ent
 	}
 }
 
-RKComponentGUIXML::Menu *findMenu (RKComponentGUIXML::Menu *parent, const QString id) {
+RKComponentGUIXML::Menu *findMenu (RKComponentGUIXML::Menu *parent, const QString &id) {
 	RK_TRACE (PLUGIN);
 
 	RK_ASSERT (parent);
@@ -257,7 +257,7 @@ RKComponentGUIXML::Menu *findMenu (RKComponentGUIXML::Menu *parent, const QStrin
 	return 0;
 }
 
-int RKComponentGUIXML::addEntries (RKComponentGUIXML::Menu *menu, XMLHelper &xml, const QDomElement description, const QString& cnamespace) {
+int RKComponentGUIXML::addEntries (RKComponentGUIXML::Menu *menu, XMLHelper &xml, const QDomElement &description, const QString& cnamespace) {
 	RK_TRACE (PLUGIN);
 
 	int leaves = 0;
@@ -544,7 +544,7 @@ bool RKComponentMap::invokeComponent (const QString &component_id, const QString
 	return true;
 }
 
-void RKPluginMapParseResult::addAndPrintError (int level, const QString message) {
+void RKPluginMapParseResult::addAndPrintError (int level, const QString &message) {
 	detailed_problems.append (message);
 	RK_DEBUG (PLUGIN, level, qPrintable (message));
 }
diff --git a/rkward/plugin/rkcomponentmap.h b/rkward/plugin/rkcomponentmap.h
index d871552f..0ae417ea 100644
--- a/rkward/plugin/rkcomponentmap.h
+++ b/rkward/plugin/rkcomponentmap.h
@@ -174,7 +174,7 @@ friend class RKComponentMap;
 /** Clear component overrides (see addOverride()). */
 	static void clearOverrides ();
 private:
-	int addEntries (RKComponentGUIXML::Menu *menu, XMLHelper &xml, const QDomElement description, const QString& cnamespace);
+	int addEntries (RKComponentGUIXML::Menu *menu, XMLHelper &xml, const QDomElement &description, const QString& cnamespace);
 	void menuItemsToXml (const RKComponentGUIXML::Menu *menu, QDomElement &xml);
 	void resolveComponentLabelsAndSortMenu (Menu *menu, const QString &menu_path=QString ());
 	struct ComponentOverride {
@@ -196,7 +196,7 @@ public:
 		detailed_problems.append (other.detailed_problems);
 		valid_plugins += other.valid_plugins;
 	};
-	void addAndPrintError (int level, const QString message);
+	void addAndPrintError (int level, const QString &message);
 	QStringList detailed_problems;
 	int valid_plugins;
 };
diff --git a/rkward/plugin/rkstandardcomponent.cpp b/rkward/plugin/rkstandardcomponent.cpp
index f38cc1f8..abd6b04b 100644
--- a/rkward/plugin/rkstandardcomponent.cpp
+++ b/rkward/plugin/rkstandardcomponent.cpp
@@ -537,7 +537,7 @@ RKComponentBuilder::~RKComponentBuilder () {
 	RK_TRACE (PLUGIN);
 }
 
-QDomElement RKComponentBuilder::doElementCopy (const QString id, XMLHelper &xml, const QDomElement &copy) {
+QDomElement RKComponentBuilder::doElementCopy (const QString &id, XMLHelper &xml, const QDomElement &copy) {
 	RK_TRACE (PLUGIN);
 
 	QDomElement res;
diff --git a/rkward/plugin/rkstandardcomponent.h b/rkward/plugin/rkstandardcomponent.h
index f29228da..5e28a136 100644
--- a/rkward/plugin/rkstandardcomponent.h
+++ b/rkward/plugin/rkstandardcomponent.h
@@ -154,7 +154,7 @@ public:
 private:
 /** internal convenience function to schedule a property connection */
 	void addConnection (const QString &client_id, const QString &client_property, const QString &governor_id, const QString &governor_property, bool reconcile, const QDomElement &origin);
-	QDomElement doElementCopy (const QString id, XMLHelper &xml, const QDomElement &copy);
+	QDomElement doElementCopy (const QString &id, XMLHelper &xml, const QDomElement &copy);
 	QDomElement doc_elem;
 	RKComponent *parent;
 	struct RKComponentPropertyConnection {
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index 7ebe09e9..d415a5b1 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -660,7 +660,7 @@ int RChooseFile (int isnew, char *buf, int len) {
 /* There are about one million possible entry points to editing / showing files. We try to cover them all, using the
 following bunch of functions (REditFilesHelper() and doShowEditFiles() are helpers, only) */
 
-void REditFilesHelper (QStringList files, QStringList titles, QString wtitle, RBackendRequest::RCallbackType edit, bool delete_files, bool prompt) {
+void REditFilesHelper (const QStringList &files, const QStringList &titles, const QString &wtitle, RBackendRequest::RCallbackType edit, bool delete_files, bool prompt) {
 	RK_TRACE (RBACKEND);
 
 	RK_ASSERT ((edit == RBackendRequest::ShowFiles) || (edit == RBackendRequest::EditFiles));
@@ -733,7 +733,7 @@ int RShowFiles (int nfile, const char **file, const char **headers, const char *
 
 /* FROM R_ext/RStartup.h: "Return value here is expected to be 1 for Yes, -1 for No and 0 for Cancel:
    symbolic constants in graphapp.h" */
-int doDialogHelper (QString caption, QString message, QString button_yes, QString button_no, QString button_cancel, QString default_button, bool wait) {
+int doDialogHelper (const QString &caption, const QString &message, const QString &button_yes, const QString &button_no, const QString &button_cancel, const QString &default_button, bool wait) {
 	RK_TRACE (RBACKEND);
 
 	RBackendRequest request (wait, RBackendRequest::ShowMessage);
@@ -899,7 +899,7 @@ extern "C" int R_interrupts_pending;
 #else
 LibExtern int R_interrupts_pending;
 #endif
-void doError (QString callstring) {
+void doError (const QString &callstring) {
 	RK_TRACE (RBACKEND);
 
 	if ((RKRBackend::repl_status.eval_depth == 0) && (!RKRBackend::repl_status.browser_context) && (!RKRBackend::this_pointer->isKilled ()) && (RKRBackend::repl_status.user_command_status != RKRBackend::RKReplStatus::ReplIterationKilled) && (RKRBackend::repl_status.user_command_status != RKRBackend::RKReplStatus::NoUserCommand)) {
diff --git a/rkward/rkconsole.cpp b/rkward/rkconsole.cpp
index aa5de60f..34b0fadb 100644
--- a/rkward/rkconsole.cpp
+++ b/rkward/rkconsole.cpp
@@ -213,7 +213,7 @@ QAction* RKConsole::addProxyAction (const QString& actionName, const QString& la
 	}
 }
 
-void RKConsole::triggerEditAction (QString name) {
+void RKConsole::triggerEditAction (const QString &name) {
 	RK_TRACE (APP);
 
 	if (!kate_edit_actions) return;
diff --git a/rkward/rkconsole.h b/rkward/rkconsole.h
index c757c7c1..9d65cc0b 100644
--- a/rkward/rkconsole.h
+++ b/rkward/rkconsole.h
@@ -138,7 +138,7 @@ friend class RKConsolePart;
 	QAction* paste_action;
 
 	KActionCollection *kate_edit_actions;
-	void triggerEditAction (QString name);
+	void triggerEditAction (const QString &name);
 	void setCursorClear (int line, int col);
 
 	void initializeActions (KActionCollection *ac);
diff --git a/rkward/scriptbackends/qtscriptbackend.cpp b/rkward/scriptbackends/qtscriptbackend.cpp
index d8d84e6a..49ffd638 100644
--- a/rkward/scriptbackends/qtscriptbackend.cpp
+++ b/rkward/scriptbackends/qtscriptbackend.cpp
@@ -328,7 +328,7 @@ namespace RKPrecompiledQtScripts {
 	QMap<QString, QScriptProgram> compiled_includes;
 	QMutex compiled_includes_mutex;
 
-	bool loadCommonScript (QScriptEngine* engine, QString scriptfile) {
+	bool loadCommonScript (QScriptEngine* engine, const QString &scriptfile) {
 		RK_TRACE (PHP);
 
 		// NOTE: QScriptProgram cannot be evaluated concurrently in several threads (see https://bugreports.qt-project.org/browse/QTBUG-29246).
diff --git a/rkward/scriptbackends/qtscriptbackend.h b/rkward/scriptbackends/qtscriptbackend.h
index f913c01a..f8d538c4 100644
--- a/rkward/scriptbackends/qtscriptbackend.h
+++ b/rkward/scriptbackends/qtscriptbackend.h
@@ -108,7 +108,7 @@ private:
 #define USE_Q_SCRIPT_PROGRAM
 #include <QScriptProgram>
 namespace RKPrecompiledQtScripts {
-	bool loadCommonScript (QScriptEngine *engine, QString scriptfile);
+	bool loadCommonScript (QScriptEngine *engine, const QString &scriptfile);
 };
 
 #endif
diff --git a/rkward/settings/rksettings.cpp b/rkward/settings/rksettings.cpp
index 8cb73190..2a441134 100644
--- a/rkward/settings/rksettings.cpp
+++ b/rkward/settings/rksettings.cpp
@@ -159,7 +159,7 @@ void RKSettings::initModules () {
 
 	QLabel *l = new QLabel(i18n("<h1>Add-ons</h1><p>RKWard add-ons come in a variety of forms, each with their own configuration options:</p><h2>R packages</h2><p><a href=\"rkward://settings/rpackages\">Add-ons to the R language itself</a>. These are usually downloaded from \"CRAN\". Some of these add-on packages may additionally contain RKWard plugins.</p><h2>RKWard plugins</h2><p><a href=\"rkward://settings/plugins\">Graphical dialogs to R functionality</a>. These plugins are usually pre-installed with RKWard, or with an R package. However, they can be activated/deactivated to help keep the menus manageable. Note that it is relatively easy to <a href=\"https://api.kde.org/doc/rkwardplugins/\">create your own custom dialogs as plugins</a>!</p><h2>Kate plugins</h2><p><a href=\"rkward://settings/kateplugins\">Plugins developed for Kate / KTextEditor</a>. These provide shared functionality that is useful in the context of text editing and IDE applications. These plugins are usually found pre-installed on your system. You can configure to load the plugins that are useful to your own workflow.</p>"));
 	l->setWordWrap(true);
-	connect(l, &QLabel::linkActivated, [=](const QString url) { RKWorkplace::mainWorkplace()->openAnyUrl(QUrl(url)); });
+	connect(l, &QLabel::linkActivated, [=](const QString &url) { RKWorkplace::mainWorkplace()->openAnyUrl(QUrl(url)); });
 	pages[SuperPageAddons] = addPage(l, i18n("Add-ons"));
 	registerPageModule(SuperPageAddons, PageRPackages);
 	registerPageModule(SuperPageAddons, PagePlugins);
diff --git a/rkward/settings/rksettingsmoduleplugins.cpp b/rkward/settings/rksettingsmoduleplugins.cpp
index 771faec4..67b81cae 100644
--- a/rkward/settings/rksettingsmoduleplugins.cpp
+++ b/rkward/settings/rksettingsmoduleplugins.cpp
@@ -114,7 +114,7 @@ void RKSettingsModulePlugins::applyChanges () {
 	interface_pref = static_cast<PluginPrefs> (button_group->checkedId ());
 }
 
-RKSettingsModulePlugins::PluginMapList RKSettingsModulePlugins::setPluginMaps (const RKSettingsModulePlugins::PluginMapList new_list) {
+RKSettingsModulePlugins::PluginMapList RKSettingsModulePlugins::setPluginMaps (const RKSettingsModulePlugins::PluginMapList &new_list) {
 	RK_TRACE (SETTINGS);
 
 	known_plugin_maps = new_list;
diff --git a/rkward/settings/rksettingsmoduleplugins.h b/rkward/settings/rksettingsmoduleplugins.h
index e015a80c..bdf6fc70 100644
--- a/rkward/settings/rksettingsmoduleplugins.h
+++ b/rkward/settings/rksettingsmoduleplugins.h
@@ -117,7 +117,7 @@ private:
 	static void fixPluginMapLists ();
 friend class RKPluginMapSelectionWidget;
 /** Sets the new list of plugins. Potentially removes unreadable ones, and returns the effective list. */
-	static PluginMapList setPluginMaps (const PluginMapList new_list);
+	static PluginMapList setPluginMaps (const PluginMapList &new_list);
 };
 
 class RKSettingsModulePluginsModel : public QAbstractTableModel {
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 39fdc416..d95ca94c 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -101,7 +101,7 @@ KTextEditor::Document* createDocument(bool with_signals) {
 	return ret;
 }
 
-RKCommandEditorWindow::RKCommandEditorWindow (QWidget *parent, const QUrl _url, const QString& encoding, int flags) : RKMDIWindow (parent, RKMDIWindow::CommandEditorWindow) {
+RKCommandEditorWindow::RKCommandEditorWindow (QWidget *parent, const QUrl &_url, const QString& encoding, int flags) : RKMDIWindow (parent, RKMDIWindow::CommandEditorWindow) {
 	RK_TRACE (COMMANDEDITOR);
 
 	QString id_header = QStringLiteral ("unnamedscript://");
@@ -1144,7 +1144,7 @@ QString exportText(const QString& text, const KTextEditor::Attribute::Ptr& attri
 	return ret;
 }
 
-QString RKCommandHighlighter::commandToHTML (const QString r_command, HighlightingMode mode) {
+QString RKCommandHighlighter::commandToHTML (const QString &r_command, HighlightingMode mode) {
 	KTextEditor::Document* doc = getDoc ();
 	KTextEditor::View* view = getView ();
 	doc->setText (r_command);
diff --git a/rkward/windows/rkcommandeditorwindow.h b/rkward/windows/rkcommandeditorwindow.h
index a1891b41..b2de8f44 100644
--- a/rkward/windows/rkcommandeditorwindow.h
+++ b/rkward/windows/rkcommandeditorwindow.h
@@ -91,7 +91,7 @@ public:
 /** constructor
 @param encoding encoding to use. If QString (), the default encoding is used.
 @param flags @See Combination of RKCommandEditorFlags */
-	explicit RKCommandEditorWindow (QWidget *parent, const QUrl url, const QString& encoding=QString (), int flags=RKCommandEditorFlags::DefaultFlags);
+	explicit RKCommandEditorWindow (QWidget *parent, const QUrl &url, const QString& encoding=QString (), int flags=RKCommandEditorFlags::DefaultFlags);
 /** destructor */
 	~RKCommandEditorWindow ();
 /** returns, whether the document was modified since the last save */
@@ -239,7 +239,7 @@ public:
 	};
 	static void copyLinesToOutput (KTextEditor::View *view, HighlightingMode mode);
 	static void setHighlighting (KTextEditor::Document *doc, HighlightingMode mode);
-	static QString commandToHTML (const QString r_command, HighlightingMode mode=RScript);
+	static QString commandToHTML (const QString &r_command, HighlightingMode mode=RScript);
 private:
 	static KTextEditor::Document* getDoc ();
 	static KTextEditor::Document* _doc;
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index 48a1dd45..f0be94e4 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -1263,7 +1263,7 @@ QString RKHelpRenderer::prepareHelpLink (const QString &href, const QString &tex
 	return (ret + "</a>");
 }
 
-QString RKHelpRenderer::componentPathToId (QString path) {
+QString RKHelpRenderer::componentPathToId (const QString &path) {
 	RK_TRACE (APP);
 
 	QStringList path_segments = path.split ('/', QString::SkipEmptyParts);
@@ -1275,7 +1275,7 @@ QString RKHelpRenderer::componentPathToId (QString path) {
 	return (path_segments.join ("::"));
 }
 
-RKComponentHandle *RKHelpRenderer::componentPathToHandle (QString path) {
+RKComponentHandle *RKHelpRenderer::componentPathToHandle (const QString &path) {
 	RK_TRACE (APP);
 
 	return (RKComponentMap::getComponentHandle (componentPathToId (path)));
diff --git a/rkward/windows/rkhtmlwindow.h b/rkward/windows/rkhtmlwindow.h
index 615d1bc3..a4bc159e 100644
--- a/rkward/windows/rkhtmlwindow.h
+++ b/rkward/windows/rkhtmlwindow.h
@@ -197,8 +197,8 @@ private:
 	QString renderHelpFragment (QDomElement &fragment);
 	QString resolveLabel (const QString &id) const;
 	QString prepareHelpLink (const QString &href, const QString &text);
-	QString componentPathToId (QString path);
-	RKComponentHandle *componentPathToHandle (QString path);
+	QString componentPathToId (const QString &path);
+	RKComponentHandle *componentPathToHandle (const QString &path);
 	QString startSection (const QString &name, const QString &title, const QString &shorttitle, QStringList *anchors, QStringList *anchor_names);
 
 	QIODevice *device;
diff --git a/rkward/windows/rkworkplace.cpp b/rkward/windows/rkworkplace.cpp
index e6824653..80c4b76d 100644
--- a/rkward/windows/rkworkplace.cpp
+++ b/rkward/windows/rkworkplace.cpp
@@ -807,7 +807,7 @@ RKMDIWindow * RKWorkplace::windowForPart(KParts::Part* part) const {
 	return nullptr;
 }
 
-QUrl checkAdjustRestoredUrl (const QString &_url, const QString old_base) {
+QUrl checkAdjustRestoredUrl (const QString &_url, const QString &old_base) {
 	QUrl url = QUrl::fromUserInput (_url, QString (), QUrl::AssumeLocalFile);
 
 	if (old_base.isEmpty ()) return (url);
@@ -910,7 +910,7 @@ ItemSpecification parseItemDescription (const QString &description) {
 	return ret;
 }
 
-RKMDIWindow* restoreDocumentWindowInternal (RKWorkplace* wp, ItemSpecification spec, const QString &base) {
+RKMDIWindow* restoreDocumentWindowInternal (RKWorkplace* wp, const ItemSpecification &spec, const QString &base) {
 	RK_TRACE (APP);
 
 	RKMDIWindow *win = nullptr;
@@ -1072,13 +1072,13 @@ public:
 		RK_TRACE (APP);
 	}
 
-	void update (const QList<RKMDIWindow*> windows) {
+	void update (const QList<RKMDIWindow*> &windows) {
 		RK_TRACE (APP);
 
 		clear ();
 		_windows = windows;
-		for (int i = windows.count () - 1; i >= 0; --i) {		// most recent top
-			RKMDIWindow *win = windows[i];
+		for (int i = windows.count() - 1; i >= 0; --i) {  // most recent first / on top
+			RKMDIWindow *win = _windows.at(i);
 			QListWidgetItem *item = new QListWidgetItem (this);
 			item->setIcon (RKStandardIcons::iconForWindow (win));
 			item->setText (win->windowTitle ());


More information about the rkward-tracker mailing list