[education/rkward] rkward/windows: Set QT_NO_CAST_FROM_ASCII in windows folder

Thomas Friedrichsmeier null at kde.org
Sat Apr 26 14:07:55 BST 2025


Git commit 3af91a2a7f33f74bde74f5999e4e8395dbe07706 by Thomas Friedrichsmeier.
Committed on 26/04/2025 at 13:07.
Pushed by tfry into branch 'master'.

Set QT_NO_CAST_FROM_ASCII in windows folder

M  +1    -0    rkward/windows/CMakeLists.txt
M  +31   -31   rkward/windows/rkcallstackviewer.cpp
M  +101  -96   rkward/windows/rkcodecompletion.cpp
M  +114  -123  rkward/windows/rkcommandeditorwindow.cpp
M  +18   -18   rkward/windows/rkcommandlog.cpp
M  +14   -15   rkward/windows/rkdebugmessagewindow.cpp
M  +7    -6    rkward/windows/rkfilebrowser.cpp
M  +113  -112  rkward/windows/rkhelpsearchwindow.cpp
M  +202  -193  rkward/windows/rkhtmlwindow.cpp
M  +1    -1    rkward/windows/rktexthints.cpp
M  +3    -3    rkward/windows/rktoplevelwindowgui.cpp
M  +84   -68   rkward/windows/rkwindowcatcher.cpp
M  +87   -86   rkward/windows/rkworkplace.cpp
M  +59   -59   rkward/windows/rkworkplaceview.cpp
M  +16   -14   rkward/windows/robjectbrowser.cpp

https://invent.kde.org/education/rkward/-/commit/3af91a2a7f33f74bde74f5999e4e8395dbe07706

diff --git a/rkward/windows/CMakeLists.txt b/rkward/windows/CMakeLists.txt
index 3626b3a1e..7dc0d48c8 100644
--- a/rkward/windows/CMakeLists.txt
+++ b/rkward/windows/CMakeLists.txt
@@ -33,3 +33,4 @@ SET(windows_STAT_SRCS
 
 ADD_LIBRARY(windows STATIC ${windows_STAT_SRCS})
 TARGET_LINK_LIBRARIES(windows Qt6::Widgets Qt6::PrintSupport Qt6::WebEngineWidgets KF6::TextEditor KF6::Notifications KF6::WindowSystem KF6::KIOFileWidgets KF6::I18n)
+add_definitions(-DQT_NO_CAST_FROM_ASCII) # TODO remove, here, once enabled on top level
diff --git a/rkward/windows/rkcallstackviewer.cpp b/rkward/windows/rkcallstackviewer.cpp
index 499912e1c..b887cd7e4 100644
--- a/rkward/windows/rkcallstackviewer.cpp
+++ b/rkward/windows/rkcallstackviewer.cpp
@@ -110,44 +110,44 @@ RKCallstackViewerWidget::~RKCallstackViewerWidget () {
 	RK_TRACE (APP);
 }
 
-void RKCallstackViewerWidget::updateState () {
-	RK_TRACE (APP);
-
-	if (RKDebugHandler::instance ()->state () == RKDebugHandler::NotInDebugger) {
-		QString info = i18n ("Not in a debugger context");
-		frame_source->setText (info);
-		frame_selector->clear ();
-		frame_info->setText ("<b>" + info + "</b>");
-	} else if (RKDebugHandler::instance ()->state () == RKDebugHandler::InDebugPrompt) {
-		frame_selector->clear ();
-		frame_selector->setEnabled (true);
-		frame_selector->insertItems (0, RKDebugHandler::instance ()->calls ());
-		frame_selector->setCurrentRow (frame_selector->count () - 1);
+void RKCallstackViewerWidget::updateState() {
+	RK_TRACE(APP);
+
+	if (RKDebugHandler::instance()->state() == RKDebugHandler::NotInDebugger) {
+		QString info = i18n("Not in a debugger context");
+		frame_source->setText(info);
+		frame_selector->clear();
+		frame_info->setText(u"<b>"_s + info + u"</b>"_s);
+	} else if (RKDebugHandler::instance()->state() == RKDebugHandler::InDebugPrompt) {
+		frame_selector->clear();
+		frame_selector->setEnabled(true);
+		frame_selector->insertItems(0, RKDebugHandler::instance()->calls());
+		frame_selector->setCurrentRow(frame_selector->count() - 1);
 	} else {
-		frame_selector->setEnabled (false);
+		frame_selector->setEnabled(false);
 	}
 }
 
-void RKCallstackViewerWidget::frameChanged (int frame_number) {
-	RK_TRACE (APP);
+void RKCallstackViewerWidget::frameChanged(int frame_number) {
+	RK_TRACE(APP);
 
-	if (RKDebugHandler::instance ()->state () == RKDebugHandler::NotInDebugger) return;
+	if (RKDebugHandler::instance()->state() == RKDebugHandler::NotInDebugger) return;
 
-	frame_info->setText (i18n ("<b>Current call:</b> %1<br><b>Environment:</b> %2<br><b>Local objects:</b> %3",
-									RKDebugHandler::instance ()->calls ().value (frame_number).toHtmlEscaped (),
-									RKDebugHandler::instance ()->environments ().value (frame_number).toHtmlEscaped (),
-									RKDebugHandler::instance ()->locals ().value (frame_number).split ('\n').join (QStringLiteral(", ")).toHtmlEscaped ()));
-	frame_source->setText (RKDebugHandler::instance ()->functions ().value (frame_number) + '\n');
-	int line = RKDebugHandler::instance ()->relativeSourceLines ().value (frame_number, 0);
-	if (line > 0) frame_source->highlightLine (line - 1);
-	else if (frame_number < RKDebugHandler::instance ()->calls ().size () - 1) {
+	frame_info->setText(i18n("<b>Current call:</b> %1<br><b>Environment:</b> %2<br><b>Local objects:</b> %3",
+	                         RKDebugHandler::instance()->calls().value(frame_number).toHtmlEscaped(),
+	                         RKDebugHandler::instance()->environments().value(frame_number).toHtmlEscaped(),
+	                         RKDebugHandler::instance()->locals().value(frame_number).split(u'\n').join(u", "_s).toHtmlEscaped()));
+	frame_source->setText(RKDebugHandler::instance()->functions().value(frame_number) + u'\n');
+	int line = RKDebugHandler::instance()->relativeSourceLines().value(frame_number, 0);
+	if (line > 0) frame_source->highlightLine(line - 1);
+	else if (frame_number < RKDebugHandler::instance()->calls().size() - 1) {
 		// no (valid) source reference available? Make an effort to locate (candidate line(s) for) the call
-		QStringList lines = RKDebugHandler::instance ()->functions ().value (frame_number).split ('\n');
-		QString call = RKDebugHandler::instance ()->calls ().value (frame_number + 1);
-		call = call.left (call.indexOf ('(')).trimmed ();
-		QRegularExpression call_exp (QRegularExpression::escape (call) + "\\s*\\(");
-		for (int i = lines.size () - 1; i >= 0; --i) {
-			if (lines.at (i).contains (call_exp)) frame_source->highlightLine (i);
+		QStringList lines = RKDebugHandler::instance()->functions().value(frame_number).split(u'\n');
+		QString call = RKDebugHandler::instance()->calls().value(frame_number + 1);
+		call = call.left(call.indexOf(u'(')).trimmed();
+		QRegularExpression call_exp(QRegularExpression::escape(call) + u"\\s*\\("_s);
+		for (int i = lines.size() - 1; i >= 0; --i) {
+			if (lines.at(i).contains(call_exp)) frame_source->highlightLine(i);
 		}
 	}
 }
diff --git a/rkward/windows/rkcodecompletion.cpp b/rkward/windows/rkcodecompletion.cpp
index 85e386378..b2e878f19 100644
--- a/rkward/windows/rkcodecompletion.cpp
+++ b/rkward/windows/rkcodecompletion.cpp
@@ -116,11 +116,11 @@ void RKCompletionManager::userTriggeredCompletion () {
 	user_triggered = false;
 }
 
-void RKCompletionManager::tryCompletion () {
-	RK_TRACE (COMMANDEDITOR);
+void RKCompletionManager::tryCompletion() {
+	RK_TRACE(COMMANDEDITOR);
 	if (!_view) {
 		// NOTE: This should not be possible, because the connections  have not been set up in the constructor, in this case.
-		RK_ASSERT (_view);
+		RK_ASSERT(_view);
 		return;
 	}
 	if (ignore_next_trigger) {
@@ -128,33 +128,36 @@ void RKCompletionManager::tryCompletion () {
 		return;
 	}
 
-	KTextEditor::Document *doc = _view->document ();
+	KTextEditor::Document *doc = _view->document();
 	KTextEditor::Cursor c = _view->cursorPosition();
 	cached_position = c;
-	uint para=c.line(); int cursor_pos=c.column();
+	uint para = c.line();
+	int cursor_pos = c.column();
 
-	QString current_line = doc->line (para);
+	QString current_line = doc->line(para);
 	int start;
 	int end;
-	RKCommonFunctions::getCurrentSymbolOffset (current_line, cursor_pos-1, false, &start, &end);
-	symbol_range = KTextEditor::Range (para, start, para, end);
-	bool is_help = (start >= 1) && (current_line.at(start-1) == '?');
+	RKCommonFunctions::getCurrentSymbolOffset(current_line, cursor_pos - 1, false, &start, &end);
+	symbol_range = KTextEditor::Range(para, start, para, end);
+	bool is_help = (start >= 1) && (current_line.at(start - 1) == u'?');
 	if (!user_triggered) {
 		if (end > cursor_pos) {
-			symbol_range = KTextEditor::Range ();   // Only hint when at the end of a word/symbol: https://mail.kde.org/pipermail/rkward-devel/2015-April/004122.html
+			symbol_range =
+			    KTextEditor::Range();  // Only hint when at the end of a word/symbol: https://mail.kde.org/pipermail/rkward-devel/2015-April/004122.html
 		} else {
-			if (doc->defaultStyleAt (c) == KSyntaxHighlighting::Theme::TextStyle::Comment) symbol_range = KTextEditor::Range ();	// do not hint while in comments
+			if (doc->defaultStyleAt(c) == KSyntaxHighlighting::Theme::TextStyle::Comment) symbol_range = KTextEditor::Range();  // do not hint while in comments
 		}
 	}
 
-	QString word = currentCompletionWord ();
-	if (user_triggered || (word.length () >= settings->autoMinChars ())) {
+	QString word = currentCompletionWord();
+	if (user_triggered || (word.length() >= settings->autoMinChars())) {
 		QString filename;
-		// as a very simple heuristic: If the current symbol starts with a quote, we should probably attempt file name completion, instead of symbol name completion
-		if (word.startsWith ('\"') || word.startsWith ('\'') || word.startsWith ('`')) {
-			symbol_range.setStart (KTextEditor::Cursor (symbol_range.start ().line (), symbol_range.start ().column () + 1));   // confine range to inside the quotes.
-			filename = word.mid (1);
-			word.clear ();
+		// as a very simple heuristic: If the current symbol starts with a quote, we should probably attempt file name completion, instead of symbol name
+		// completion
+		if (word.startsWith(u'\"') || word.startsWith(u'\'') || word.startsWith(u'`')) {
+			symbol_range.setStart(KTextEditor::Cursor(symbol_range.start().line(), symbol_range.start().column() + 1));  // confine range to inside the quotes.
+			filename = word.mid(1);
+			word.clear();
 		}
 
 		completion_model->updateCompletionList(word, is_help);
@@ -163,29 +166,30 @@ void RKCompletionManager::tryCompletion () {
 		completion_model->updateCompletionList(QString(), false);
 		file_completion_model->updateCompletionList(QString());
 	}
-	RK_DEBUG(EDITOR, DL_DEBUG, "completion symbol range %d, %d -> %d, %d", symbol_range.start().line(), symbol_range.start().column(), symbol_range.end().line(), symbol_range.end().column());
+	RK_DEBUG(EDITOR, DL_DEBUG, "completion symbol range %d, %d -> %d, %d", symbol_range.start().line(), symbol_range.start().column(),
+	         symbol_range.end().line(), symbol_range.end().column());
 
-	updateCallHint ();
+	updateCallHint();
 
 	// update ArgHint.
-	argname_range = KTextEditor::Range (-1, -1, -1, -1);
+	argname_range = KTextEditor::Range(-1, -1, -1, -1);
 	// Named arguments are just like regular symbols, *but* we must require that they are preceeded by either a ',', or the opening '(', immediately.
 	// Otherwise, they are an argument value expression, for sure.
 	// We also assume (foolishly), that if we are on a new line, we're probably starting a new arg. TODO: Actually check this!
-	if (callhint_model->currentFunction ()) {
+	if (callhint_model->currentFunction()) {
 		argname_range = symbol_range;
-		for (int i = symbol_range.start ().column () - 1; i >= 0; --i) {
-			QChar c = current_line.at (i);
-			if (c == ',' || c == '(') {
+		for (int i = symbol_range.start().column() - 1; i >= 0; --i) {
+			QChar c = current_line.at(i);
+			if (c == u',' || c == u'(') {
 				break;
-			} else if (!c.isSpace ()) {
-				argname_range = KTextEditor::Range (-1, -1, -1, -1);
+			} else if (!c.isSpace()) {
+				argname_range = KTextEditor::Range(-1, -1, -1, -1);
 			}
 		}
 	}
-	arghint_model->updateCompletionList (callhint_model->currentFunction (), argname_range.isValid () ? doc->text (argname_range) : QString ());
+	arghint_model->updateCompletionList(callhint_model->currentFunction(), argname_range.isValid() ? doc->text(argname_range) : QString());
 
-	updateVisibility ();
+	updateVisibility();
 }
 
 bool isCode (KTextEditor::Document* doc, int line, int column) {
@@ -196,22 +200,22 @@ bool isCode (KTextEditor::Document* doc, int line, int column) {
 	return true;
 }
 
-void RKCompletionManager::updateCallHint () {
-	RK_TRACE (COMMANDEDITOR);
+void RKCompletionManager::updateCallHint() {
+	RK_TRACE(COMMANDEDITOR);
 
-	if (_view->isCompletionActive () && !update_call) return;
+	if (_view->isCompletionActive() && !update_call) return;
 	update_call = false;
 
-	int line = cached_position.line () + 1;
+	int line = cached_position.line() + 1;
 	QString full_context;
 	int potential_symbol_end = -2;
 	int parenthesis_level = 0;
 	int prefix_offset = 0;
-	KTextEditor::Document *doc = _view->document ();
+	KTextEditor::Document *doc = _view->document();
 	while (potential_symbol_end < -1 && line >= 0) {
 		--line;
-		QString context_line = doc->line (line);
-		if (!prefix.isEmpty()) {   // For skipping interactive output sections in console. Empty for RKCommandEditorWindow
+		QString context_line = doc->line(line);
+		if (!prefix.isEmpty()) {  // For skipping interactive output sections in console. Empty for RKCommandEditorWindow
 			if (context_line.startsWith(prefix)) {
 				prefix_offset = prefix.length();
 			} else if (context_line.startsWith(continuation_prefix)) {
@@ -221,21 +225,22 @@ void RKCompletionManager::updateCallHint () {
 			}
 			context_line = context_line.mid(prefix_offset);
 		}
-		full_context.prepend (context_line);
+		full_context.prepend(context_line);
 
-		int pos = context_line.length () - 1;
-		if (line == cached_position.line ()) pos = cached_position.column () - 1 - prefix_offset;   // when on current line, look backward from cursor position, not line end
+		int pos = context_line.length() - 1;
+		if (line == cached_position.line())
+			pos = cached_position.column() - 1 - prefix_offset;  // when on current line, look backward from cursor position, not line end
 		for (int i = pos; i >= 0; --i) {
-			QChar c = context_line.at (i);
-			if (c == '(') {
-				if (isCode (doc, line, i)) {
+			QChar c = context_line.at(i);
+			if (c == u'(') {
+				if (isCode(doc, line, i)) {
 					if (--parenthesis_level < 0) {
 						potential_symbol_end = i - 1;
 						break;
 					}
 				}
-			} else if (c == ')') {
-				if (isCode (doc, line, i)) {
+			} else if (c == u')') {
+				if (isCode(doc, line, i)) {
 					++parenthesis_level;
 				}
 			}
@@ -244,22 +249,22 @@ void RKCompletionManager::updateCallHint () {
 
 	// now find out where the symbol to the left of the opening brace ends
 	// there cannot be a line-break between the opening brace, and the symbol name (or can there?), so no need to fetch further context
-	while ((potential_symbol_end >= 0) && full_context.at (potential_symbol_end).isSpace ()) {
+	while ((potential_symbol_end >= 0) && full_context.at(potential_symbol_end).isSpace()) {
 		--potential_symbol_end;
 	}
 
 	// now identify the symbol and object (if any)
 	RObject *object = nullptr;
-	call_opening = KTextEditor::Cursor (-1, -1);
+	call_opening = KTextEditor::Cursor(-1, -1);
 	if (potential_symbol_end > 0) {
-		QString effective_symbol = RKCommonFunctions::getCurrentSymbol (full_context, potential_symbol_end);
-		if (!effective_symbol.isEmpty ()) {
-			object = RObjectList::getObjectList ()->findObject (effective_symbol);
-			call_opening = KTextEditor::Cursor (line, potential_symbol_end+1);
+		QString effective_symbol = RKCommonFunctions::getCurrentSymbol(full_context, potential_symbol_end);
+		if (!effective_symbol.isEmpty()) {
+			object = RObjectList::getObjectList()->findObject(effective_symbol);
+			call_opening = KTextEditor::Cursor(line, potential_symbol_end + 1);
 		}
 	}
 
-	callhint_model->setFunction (object);
+	callhint_model->setFunction(object);
 }
 
 void RKCompletionManager::startModel( KTextEditor::CodeCompletionModel *model, bool start, const KTextEditor::Range &range) {
@@ -306,18 +311,18 @@ void RKCompletionManager::modelGainedLateData(RKCompletionModelBase* model) {
 	startModel(model, true, model->completionRange(view(), view()->cursorPosition()));
 }
 
-void RKCompletionManager::textInserted (KTextEditor::Document*, const KTextEditor::Cursor& position, const QString& text) {
-	if (_view->isCompletionActive ()) {
+void RKCompletionManager::textInserted(KTextEditor::Document*, const KTextEditor::Cursor& position, const QString& text) {
+	if (_view->isCompletionActive()) {
 		if (position < call_opening) update_call = true;
-		else if (text.contains (QChar ('(')) || text.contains (QChar (')'))) update_call = true;
+		else if (text.contains(QChar(u'(')) || text.contains(QChar(u')'))) update_call = true;
 	}
 	tryCompletionProxy();
 }
 
-void RKCompletionManager::textRemoved (KTextEditor::Document*, const KTextEditor::Range& range, const QString& text) {
-	if (_view->isCompletionActive ()) {
-		if (range.start () < call_opening) update_call = true;
-		else if (text.contains (QChar ('(')) || text.contains (QChar (')'))) update_call = true;
+void RKCompletionManager::textRemoved(KTextEditor::Document*, const KTextEditor::Range& range, const QString& text) {
+	if (_view->isCompletionActive()) {
+		if (range.start() < call_opening) update_call = true;
+		else if (text.contains(QChar(u'(')) || text.contains(QChar(u')'))) update_call = true;
 	}
 	tryCompletionProxy();
 }
@@ -332,16 +337,16 @@ void RKCompletionManager::lineUnwrapped (KTextEditor::Document* , int ) {
 	tryCompletionProxy ();
 }
 
-void RKCompletionManager::cursorPositionChanged (KTextEditor::View* view, const KTextEditor::Cursor& newPosition) {
-	if (_view->isCompletionActive ()) {
+void RKCompletionManager::cursorPositionChanged(KTextEditor::View* view, const KTextEditor::Cursor& newPosition) {
+	if (_view->isCompletionActive()) {
 		if (newPosition < call_opening) update_call = true;
 		else {
-			QString text = view->document ()->text (KTextEditor::Range (newPosition, cached_position));
-			if (text.contains (QChar ('(')) || text.contains (QChar (')'))) update_call = true;
+			QString text = view->document()->text(KTextEditor::Range(newPosition, cached_position));
+			if (text.contains(QChar(u'(')) || text.contains(QChar(u')'))) update_call = true;
 		}
-		tryCompletionProxy ();
-	} else if (settings->autoCursorActivated ()) {
-		tryCompletionProxy ();
+		tryCompletionProxy();
+	} else if (settings->autoCursorActivated()) {
+		tryCompletionProxy();
 	}
 }
 
@@ -529,11 +534,11 @@ bool RKCompletionManager::eventFilter (QObject*, QEvent* event) {
 				}
 
 				// No, we cannot just send a fake key event, easily...
-				KActionCollection *kate_edit_actions = view ()->findChild<KActionCollection*> ("edit_actions");
-				QAction *action = kate_edit_actions ? (kate_edit_actions->action (k->key () == Qt::Key_Up ? "move_line_up" : "move_line_down")) : nullptr;
+				KActionCollection *kate_edit_actions = view()->findChild<KActionCollection *>("edit_actions");
+				QAction *action = kate_edit_actions ? (kate_edit_actions->action(k->key() == Qt::Key_Up ? u"move_line_up"_s : u"move_line_down"_s)) : nullptr;
 				if (!action) {
-					kate_edit_actions = view ()->actionCollection ();
-					action = kate_edit_actions ? (kate_edit_actions->action (k->key () == Qt::Key_Up ? "move_line_up" : "move_line_down")) : nullptr;
+					kate_edit_actions = view()->actionCollection();
+					action = kate_edit_actions ? (kate_edit_actions->action(k->key() == Qt::Key_Up ? u"move_line_up"_s : u"move_line_down"_s)) : nullptr;
 				}
 				if (action) action->trigger ();
 				else RK_ASSERT (action);
@@ -721,40 +726,40 @@ RKCallHintModel::RKCallHintModel (RKCompletionManager* manager) : RKCompletionMo
 
 // TODO: There could be more than one function by a certain name, and we could support this!
 void RKCallHintModel::setFunction(RObject* _function) {
-	RK_TRACE (COMMANDEDITOR);
+	RK_TRACE(COMMANDEDITOR);
 
 	if (function == _function) return;
 	function = _function;
 
-	beginResetModel ();
-	if (function && function->isType (RObject::Function)) {
+	beginResetModel();
+	if (function && function->isType(RObject::Function)) {
 		// initialize hint
-		RFunctionObject *fo = static_cast<RFunctionObject*> (function);
-		QStringList args = fo->argumentNames ();
-		QStringList defs = fo->argumentDefaults ();
+		RFunctionObject* fo = static_cast<RFunctionObject*>(function);
+		QStringList args = fo->argumentNames();
+		QStringList defs = fo->argumentDefaults();
 
-		formals = '(';
-		formatting.clear ();
+		formals = u'(';
+		formatting.clear();
 		QTextCharFormat format;
 		format.setForeground(QBrush(Qt::green));
 
 		int pos = 1;
-		for (int i = 0; i < args.size (); ++i) {
+		for (int i = 0; i < args.size(); ++i) {
 			QString pair = args[i];
-			if (!defs.value(i).isEmpty ()) pair.append ('=' + defs[i]);
-			formatting.append ({ pos + args[i].length (), pair.length ()-args[i].length (), format });
+			if (!defs.value(i).isEmpty()) pair.append(u'=' + defs[i]);
+			formatting.append({pos + args[i].length(), pair.length() - args[i].length(), format});
 
-			if (i < (args.size () - 1)) pair.append (", ");
-			formals.append (pair);
+			if (i < (args.size() - 1)) pair.append(u", "_s);
+			formals.append(pair);
 
-			pos = pos + pair.length ();
+			pos = pos + pair.length();
 		}
-		formals.append (')');
+		formals.append(u')');
 		n_completions = 1;
 	} else {
 		n_completions = 0;
 	}
-	endResetModel ();
+	endResetModel();
 }
 
 QVariant RKCallHintModel::data (const QModelIndex& index, int role) const {
@@ -855,21 +860,21 @@ void RKArgumentHintModel::addRCompletions() {
 	}
 }
 
-QVariant RKArgumentHintModel::data (const QModelIndex& index, int role) const {
-	if (isHeaderItem (index)) {
-		if (role == Qt::DisplayRole) return i18n ("Function arguments");
+QVariant RKArgumentHintModel::data(const QModelIndex& index, int role) const {
+	if (isHeaderItem(index)) {
+		if (role == Qt::DisplayRole) return i18n("Function arguments");
 		if (role == KTextEditor::CodeCompletionModel::GroupRole) return Qt::DisplayRole;
-		if (role == KTextEditor::CodeCompletionModel::InheritanceDepth) return 0; // Sort above other models (except calltip)
-		return QVariant ();
+		if (role == KTextEditor::CodeCompletionModel::InheritanceDepth) return 0;  // Sort above other models (except calltip)
+		return QVariant();
 	}
 
-	int col = index.column ();
-	int row = index.row ();
+	int col = index.column();
+	int row = index.row();
 	if (role == Qt::DisplayRole) {
-		if (col == KTextEditor::CodeCompletionModel::Name) return (args.value (matches.value (row)));
+		if (col == KTextEditor::CodeCompletionModel::Name) return (args.value(matches.value(row)));
 		if (col == KTextEditor::CodeCompletionModel::Postfix) {
-			QString def = defs.value (matches.value (row));
-			if (!def.isEmpty ()) return (QString ('=' + def));
+			QString def = defs.value(matches.value(row));
+			if (!def.isEmpty()) return (QString(u'=' + def));
 		}
 	} else if (role == KTextEditor::CodeCompletionModel::InheritanceDepth) {
 		return row;  // disable sorting
@@ -880,7 +885,7 @@ QVariant RKArgumentHintModel::data (const QModelIndex& index, int role) const {
 		return (20);
 	}
 
-	return QVariant ();
+	return QVariant();
 }
 
 KTextEditor::Range RKArgumentHintModel::completionRange (KTextEditor::View*, const KTextEditor::Cursor&) {
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 421252d3d..923f3b8a7 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -314,12 +314,13 @@ RKCommandEditorWindow::~RKCommandEditorWindow () {
 	}
 }
 
-void RKCommandEditorWindow::fixupPartGUI () {
-	RK_TRACE (COMMANDEDITOR);
+void RKCommandEditorWindow::fixupPartGUI() {
+	RK_TRACE(COMMANDEDITOR);
 
 	// strip down the katepart's GUI. remove some stuff we definitely don't need.
-	RKCommonFunctions::removeContainers (m_view, QStringLiteral ("bookmarks,tools_spelling,tools_spelling_from_cursor,tools_spelling_selection,switch_to_cmd_line,set_confdlg").split (','), true);
-	RKCommonFunctions::moveContainer (m_view, QStringLiteral("Menu"), QStringLiteral("tools"), QStringLiteral("edit"), true);
+	RKCommonFunctions::removeContainers(
+	    m_view, u"bookmarks,tools_spelling,tools_spelling_from_cursor,tools_spelling_selection,switch_to_cmd_line,set_confdlg"_s.split(u','), true);
+	RKCommonFunctions::moveContainer(m_view, QStringLiteral("Menu"), QStringLiteral("tools"), QStringLiteral("edit"), true);
 }
 
 QAction *findAction (KTextEditor::View* view, const QString &actionName) {
@@ -443,13 +444,13 @@ void RKCommandEditorWindow::initBlocks () {
 		colorsquare.fill (colors[i]);
 		QIcon icon (colorsquare);
 
-		record.mark = ac->addAction("markblock" + QString::number(i), this, [this, i](){ markBlock(i); });
+		record.mark = ac->addAction(u"markblock"_s + QString::number(i), this, [this, i](){ markBlock(i); });
 		record.mark->setIcon (icon);
 		actionmenu_mark_block->addAction (record.mark);
-		record.unmark = ac->addAction("unmarkblock" + QString::number(i), this, [this, i](){ unmarkBlock(i); });
+		record.unmark = ac->addAction(u"unmarkblock"_s + QString::number(i), this, [this, i](){ unmarkBlock(i); });
 		record.unmark->setIcon (icon);
 		actionmenu_unmark_block->addAction (record.unmark);
-		record.run = ac->addAction("runblock" + QString::number(i), this, [this, i](){ runBlock(i); });
+		record.run = ac->addAction(u"runblock"_s + QString::number(i), this, [this, i](){ runBlock(i); });
 		ac->setDefaultShortcut (record.run, shortcuts[i]);
 		record.run->setIcon (icon);
 		actionmenu_run_block->addAction (record.run);
@@ -565,7 +566,7 @@ public:
 			// rkmarkdown::render() leaves these directories lying around, even if clean=TRUE. interemdiates_dir does not seem to have an effect. (07/2024)
 			// the name should be unique enough, though, so let's clean them
 			auto fi = QFileInfo(*infile);
-			QString known_temp_path = fi.absolutePath() + '/' + fi.baseName() + QLatin1String("_cache");
+			QString known_temp_path = fi.absolutePath() + u'/' + fi.baseName() + u"_cache"_s;
 			QDir(known_temp_path).removeRecursively();
 		}
 		infile->remove();
@@ -675,17 +676,17 @@ QString RmarkDownRender(const QString &infile, const QString &outdir, const QStr
 void RKCommandEditorWindow::initPreviewModes() {
 	RK_TRACE(COMMANDEDITOR);
 	preview_mode_list.append(PreviewMode{
-		QIcon::fromTheme("preview_math"), i18n("R Markdown (HTML)"), i18n("Preview of rendered R Markdown"),
+		QIcon::fromTheme(u"preview_math"_s), i18n("R Markdown (HTML)"), i18n("Preview of rendered R Markdown"),
 		i18n("Preview the script as rendered from RMarkdown format (.Rmd) to HTML."),
-		QLatin1String(".Rmd"),
+		u".Rmd"_s,
 		[](const QString& infile, const QString& outdir, const QString& /*preview_id*/) {
-			return RmarkDownRender(infile, outdir, "output_format=\"html_document\", ");
+			return RmarkDownRender(infile, outdir, u"output_format=\"html_document\", "_s);
 		}
 	});
 	preview_mode_list.append(PreviewMode{
-		QIcon::fromTheme("preview_math"), i18n("R Markdown (auto)"), i18n("Preview of rendered R Markdown"),
+		QIcon::fromTheme(u"preview_math"_s), i18n("R Markdown (auto)"), i18n("Preview of rendered R Markdown"),
 		i18n("Preview the script as rendered from RMarkdown format (.Rmd) to the format specified in the document header."),
-		QLatin1String(".Rmd"),
+		u".Rmd"_s,
 		[](const QString& infile, const QString& outdir, const QString& /*preview_id*/) {
 			return RmarkDownRender(infile, outdir, QString());
 		}
@@ -693,22 +694,22 @@ void RKCommandEditorWindow::initPreviewModes() {
 	preview_mode_list.append(PreviewMode{
 		RKStandardIcons::getIcon(RKStandardIcons::WindowOutput), i18n("RKWard Output"), i18n("Preview of generated RKWard output"),
 		i18n("Preview any output to the RKWard Output Window. This preview will be empty, if there is no call to <i>rk.print()</i> or other RKWard output commands."),
-		QLatin1String(".R"),
+		u".R"_s,
 		[](const QString& infile, const QString& outdir, const QString& /*preview_id*/) {
-			auto command = QLatin1String("output <- rk.set.output.html.file(%2, silent=TRUE)\n"
+			auto command = QStringLiteral("output <- rk.set.output.html.file(%2, silent=TRUE)\n"
 				"try(rk.flush.output(ask=FALSE, style=\"preview\", silent=TRUE))\n"
 				"try(source(%1, local=TRUE))\n"
 				"rk.set.output.html.file(output, silent=TRUE)\n"
 				"rk.show.html(%2)\n");
-			return command.arg(RObject::rQuote(infile), RObject::rQuote(outdir + QLatin1String("/output.html")));
+			return command.arg(RObject::rQuote(infile), RObject::rQuote(outdir + u"/output.html"_s));
 		}
 	});
 	preview_mode_list.append(PreviewMode{
 		RKStandardIcons::getIcon(RKStandardIcons::WindowConsole), i18n("R Console"), i18n("Preview of script running in interactive R Console"),
 		i18n("Preview the script as if it was run in the interactive R Console"),
-		QLatin1String(".R"),
+		u".R"_s,
 		[](const QString& infile, const QString& outdir, const QString& /*preview_id*/) {
-			auto command = QLatin1String("output <- rk.set.output.html.file(%2, silent=TRUE)\n"
+			auto command = QStringLiteral("output <- rk.set.output.html.file(%2, silent=TRUE)\n"
 				"on.exit(rk.set.output.html.file(output, silent=TRUE))\n"
 				"try(rk.flush.output(ask=FALSE, style=\"preview\", silent=TRUE))\n"
 				"exprs <- expression(NULL)\n"
@@ -727,15 +728,15 @@ void RKCommandEditorWindow::initPreviewModes() {
 				"}\n"
 				"rk.set.output.html.file(output, silent=TRUE)\n"
 				"rk.show.html(%2)\n");
-			return command.arg(RObject::rQuote(infile), RObject::rQuote(outdir + QLatin1String("/output.html")));
+			return command.arg(RObject::rQuote(infile), RObject::rQuote(outdir + u"/output.html"_s));
 		}
 	});
 	preview_mode_list.append(PreviewMode{
 		RKStandardIcons::getIcon(RKStandardIcons::WindowX11), i18n("Plot"), i18n("Preview of generated plot"),
 		i18n("Preview any onscreen graphics produced by running this script. This preview will be empty, if there is no call to <i>plot()</i> or other graphics commands."),
-		QLatin1String(".R"),
+		u".R"_s,
 		[](const QString& infile, const QString& /*outdir*/, const QString& preview_id) {
-			auto command = QLatin1String("olddev <- dev.cur()\n"
+			auto command = QStringLiteral("olddev <- dev.cur()\n"
 				".rk.startPreviewDevice(%2)\n"
 				"try(source(%1, local=TRUE, print.eval=TRUE))\n"
 				"if (olddev != 1) dev.set(olddev)\n");
@@ -754,7 +755,7 @@ void RKCommandEditorWindow::doRenderPreview () {
 
 	if (!preview->findChild<RKMDIWindow*>()) {
 		// (lazily) initialize the preview window with _something_, as an RKMDIWindow is needed to display messages (important, if there is an error during the first preview)
-		RInterface::issueCommand(".rk.with.window.hints(rk.show.html(content=\"\"), \"\", " + RObject::rQuote(preview_manager->previewId()) + ", style=\"preview\")", RCommand::App | RCommand::Sync);
+		RInterface::issueCommand(u".rk.with.window.hints(rk.show.html(content=\"\"), \"\", "_s + RObject::rQuote(preview_manager->previewId()) + u", style=\"preview\")"_s, RCommand::App | RCommand::Sync);
 	}
 
 	preview_io = RKScriptPreviewIO::init(preview_io, m_doc, nmode, mode.input_ext);
@@ -762,7 +763,7 @@ void RKCommandEditorWindow::doRenderPreview () {
 	preview->setLabel(mode.previewlabel);
 	preview->show();
 
-	RCommand *rcommand = new RCommand(".rk.with.window.hints(local({\n" + command + QStringLiteral("}), \"\", ") + RObject::rQuote(preview_manager->previewId()) + ", style=\"preview\")", RCommand::App);
+	RCommand *rcommand = new RCommand(u".rk.with.window.hints(local({\n"_s + command + u"}), \"\", "_s + RObject::rQuote(preview_manager->previewId()) + u", style=\"preview\")"_s, RCommand::App);
 	preview_manager->setCommand(rcommand);
 }
 
@@ -819,7 +820,7 @@ void RKCommandEditorWindow::doAutoSave () {
 	if (previous_autosave_url.isValid ()) {
 		backup_autosave_url = previous_autosave_url;
 		backup_autosave_url = backup_autosave_url.adjusted(QUrl::RemoveFilename);
-		backup_autosave_url.setPath(backup_autosave_url.path() + backup_autosave_url.fileName () + '~');
+		backup_autosave_url.setPath(backup_autosave_url.path() + backup_autosave_url.fileName () + u'~');
 		if (previous_autosave_url.isLocalFile ()) {
 			QFile::remove (backup_autosave_url.toLocalFile ());
 			QFile::copy (previous_autosave_url.toLocalFile (), backup_autosave_url.toLocalFile ());
@@ -859,11 +860,12 @@ void RKCommandEditorWindow::doAutoSave () {
 	autosave_timer.stop ();
 }
 
-void RKCommandEditorWindow::autoSaveHandlerJobFinished (RKJobSequence* seq) {
-	RK_TRACE (COMMANDEDITOR);
+void RKCommandEditorWindow::autoSaveHandlerJobFinished(RKJobSequence* seq) {
+	RK_TRACE(COMMANDEDITOR);
 
-	if (seq->hadError ()) {
-		KMessageBox::detailedError (this, i18n ("An error occurred while trying to create an autosave of the script file '%1':", url ().url ()), "- " + seq->errors ().join (QStringLiteral("\n- ")));
+	if (seq->hadError()) {
+		KMessageBox::detailedError(this, i18n("An error occurred while trying to create an autosave of the script file '%1':", url().url()),
+		                           u"- "_s + seq->errors().join(u"\n- "_s));
 	}
 }
 
@@ -951,7 +953,7 @@ void RKCommandEditorWindow::currentHelpContext (QString *symbol, QString *packag
 		*symbol = m_view->selectionText();
 	} else {
 		KTextEditor::Cursor c = m_view->cursorPosition();
-		QString line = m_doc->line(c.line()) + ' ';
+		QString line = m_doc->line(c.line()) + u' ';
 		*symbol = RKCommonFunctions::getCurrentSymbol(line, c.column());
 	}
 }
@@ -975,42 +977,42 @@ void RKCommandEditorWindow::paste (const QString& text) {
 	m_view->insertText (text);
 }
 
-void RKCommandEditorWindow::setWDToScript () {
-	RK_TRACE (COMMANDEDITOR);
+void RKCommandEditorWindow::setWDToScript() {
+	RK_TRACE(COMMANDEDITOR);
 
-	RK_ASSERT (!url ().isEmpty ());
-	QString dir = url ().adjusted (QUrl::RemoveFilename).path ();
+	RK_ASSERT(!url().isEmpty());
+	QString dir = url().adjusted(QUrl::RemoveFilename).path();
 #ifdef Q_OS_WIN
 	// KURL::directory () returns a leading slash on windows as of KDElibs 4.3
-	while (dir.startsWith ('/')) dir.remove (0, 1);
+	while (dir.startsWith(u'/')) dir.remove(0, 1);
 #endif
-	RKConsole::pipeUserCommand ("setwd (\"" + dir + "\")");
+	RKConsole::pipeUserCommand(u"setwd (\""_s + dir + u"\")"_s);
 }
 
-void RKCommandEditorWindow::runCurrent () {
-	RK_TRACE (COMMANDEDITOR);
+void RKCommandEditorWindow::runCurrent() {
+	RK_TRACE(COMMANDEDITOR);
 
-	if (m_view->selection ()) {
-		RKConsole::pipeUserCommand (m_view->selectionText ());
+	if (m_view->selection()) {
+		RKConsole::pipeUserCommand(m_view->selectionText());
 	} else {
 		KTextEditor::Cursor c = m_view->cursorPosition();
-		QString command = m_doc->line (c.line());
-		if (!command.isEmpty ()) RKConsole::pipeUserCommand (command + '\n');
+		QString command = m_doc->line(c.line());
+		if (!command.isEmpty()) RKConsole::pipeUserCommand(command + u'\n');
 
 		// advance to next line (NOTE: m_view->down () won't work on auto-wrapped lines)
 		c.setLine(c.line() + 1);
-		m_view->setCursorPosition (c);
+		m_view->setCursorPosition(c);
 	}
 }
 
-void RKCommandEditorWindow::enterAndSubmit () {
-	RK_TRACE (COMMANDEDITOR);
+void RKCommandEditorWindow::enterAndSubmit() {
+	RK_TRACE(COMMANDEDITOR);
 
-	KTextEditor::Cursor c = m_view->cursorPosition ();
-	int line = c.line ();
-	m_doc->insertText (c, QStringLiteral("\n"));
-	QString command = m_doc->line (line);
-	if (!command.isEmpty ()) RKConsole::pipeUserCommand (command + '\n');
+	KTextEditor::Cursor c = m_view->cursorPosition();
+	int line = c.line();
+	m_doc->insertText(c, QStringLiteral("\n"));
+	QString command = m_doc->line(line);
+	if (!command.isEmpty()) RKConsole::pipeUserCommand(command + u'\n');
 }
 
 void RKCommandEditorWindow::copyLinesToOutput () {
@@ -1154,118 +1156,111 @@ KTextEditor::View* RKCommandHighlighter::getView () {
 // NOTE: Most of the exporting code is copied from the katepart HTML exporter plugin more or less verbatim! (Source license: LGPL v2)
 //////////
 QString exportText(const QString& text, const KTextEditor::Attribute::Ptr& attrib, const KTextEditor::Attribute::Ptr& m_defaultAttribute) {
-	if ( !attrib || !attrib->hasAnyProperty() || attrib == m_defaultAttribute ) {
+	if (!attrib || !attrib->hasAnyProperty() || attrib == m_defaultAttribute) {
 		return (text.toHtmlEscaped());
 	}
 
 	QString ret;
-	if ( attrib->fontBold() ) {
-		ret.append ("<b>");
+	if (attrib->fontBold()) {
+		ret.append(u"<b>"_s);
 	}
-	if ( attrib->fontItalic() ) {
-		ret.append ("<i>");
+	if (attrib->fontItalic()) {
+		ret.append(u"<i>"_s);
 	}
 
-	bool writeForeground = attrib->hasProperty(QTextCharFormat::ForegroundBrush)
-		&& (!m_defaultAttribute || attrib->foreground().color() != m_defaultAttribute->foreground().color());
-	bool writeBackground = attrib->hasProperty(QTextCharFormat::BackgroundBrush)
-		&& (!m_defaultAttribute || attrib->background().color() != m_defaultAttribute->background().color());
+	bool writeForeground = attrib->hasProperty(QTextCharFormat::ForegroundBrush) &&
+	                       (!m_defaultAttribute || attrib->foreground().color() != m_defaultAttribute->foreground().color());
+	bool writeBackground = attrib->hasProperty(QTextCharFormat::BackgroundBrush) &&
+	                       (!m_defaultAttribute || attrib->background().color() != m_defaultAttribute->background().color());
 
-	if ( writeForeground || writeBackground ) {
-		ret.append (QStringLiteral("<span style='%1%2'>")
-					.arg(writeForeground ? QString(QLatin1String("color:") + attrib->foreground().color().name() + QLatin1Char(';')) : QString(),
-					     writeBackground ? QString(QLatin1String("background:") + attrib->background().color().name() + QLatin1Char(';')) : QString()));
+	if (writeForeground || writeBackground) {
+		ret.append(QStringLiteral("<span style='%1%2'>")
+		               .arg(writeForeground ? QString(QLatin1String("color:") + attrib->foreground().color().name() + QLatin1Char(';')) : QString(),
+		                    writeBackground ? QString(QLatin1String("background:") + attrib->background().color().name() + QLatin1Char(';')) : QString()));
 	}
 
-	ret.append (text.toHtmlEscaped());
+	ret.append(text.toHtmlEscaped());
 
-	if ( writeBackground || writeForeground ) {
-		ret.append ("</span>");
+	if (writeBackground || writeForeground) {
+		ret.append(u"</span>"_s);
 	}
-	if ( attrib->fontItalic() ) {
-		ret.append ("</i>");
+	if (attrib->fontItalic()) {
+		ret.append(u"</i>"_s);
 	}
-	if ( attrib->fontBold() ) {
-		ret.append ("</b>");
+	if (attrib->fontBold()) {
+		ret.append(u"</b>"_s);
 	}
 
 	return ret;
 }
 
-QString RKCommandHighlighter::commandToHTML (const QString &r_command, HighlightingMode mode) {
-	KTextEditor::Document* doc = getDoc ();
-	KTextEditor::View* view = getView ();
-	doc->setText (r_command);
-	if (r_command.endsWith ('\n')) doc->removeLine (doc->lines () - 1);
-	setHighlighting (doc, mode);
+QString RKCommandHighlighter::commandToHTML(const QString& r_command, HighlightingMode mode) {
+	KTextEditor::Document* doc = getDoc();
+	KTextEditor::View* view = getView();
+	doc->setText(r_command);
+	if (r_command.endsWith(u'\n')) doc->removeLine(doc->lines() - 1);
+	setHighlighting(doc, mode);
 	QString ret;
 
 	QString opening;
-	KTextEditor::Attribute::Ptr m_defaultAttribute = view->defaultStyleAttribute (KSyntaxHighlighting::Theme::TextStyle::Normal);
-	if ( !m_defaultAttribute ) {
-		opening = QLatin1String("<pre class=\"%3\">");
+	KTextEditor::Attribute::Ptr m_defaultAttribute = view->defaultStyleAttribute(KSyntaxHighlighting::Theme::TextStyle::Normal);
+	if (!m_defaultAttribute) {
+		opening = u"<pre class=\"%3\">"_s;
 	} else {
-		opening = QStringLiteral("<pre style='%1%2' class=\"%3\">")
-				.arg(m_defaultAttribute->fontBold() ? "font-weight:bold;" : "",
-				     m_defaultAttribute->fontItalic() ? "text-style:italic;" : "");
-				// Note: copying the default text/background colors is pointless in our case, and leads to subtle inconsistencies.
+		opening = u"<pre style='%1%2' class=\"%3\">"_s
+		              .arg(m_defaultAttribute->fontBold() ? u"font-weight:bold;"_s : u""_s, m_defaultAttribute->fontItalic() ? u"text-style:italic;"_s : u""_s);
+		// Note: copying the default text/background colors is pointless in our case, and leads to subtle inconsistencies.
 	}
 
 	const KTextEditor::Attribute::Ptr noAttrib(nullptr);
 
-	if (mode == RScript) ret = opening.arg (QStringLiteral("code"));
-	enum {
-		Command,
-		Output,
-		Warning,
-		None
-	} previous_chunk = None;
-	for (int i = 0; i < doc->lines (); ++i)
-	{
-		const QString &line = doc->line(i);
+	if (mode == RScript) ret = opening.arg(QStringLiteral("code"));
+	enum { Command, Output, Warning, None } previous_chunk = None;
+	for (int i = 0; i < doc->lines(); ++i) {
+		const QString& line = doc->line(i);
 		const QList<KTextEditor::AttributeBlock> attribs = view->lineAttributes(i);
 		int lineStart = 0;
 
 		if (mode == RInteractiveSession) {
-			if (line.startsWith (QLatin1String("> ")) || line.startsWith (QLatin1String("+ "))) {
-				lineStart = 2;	// skip the prompt. Prompt will be indicated by the CSS, instead
+			if (line.startsWith(QLatin1String("> ")) || line.startsWith(QLatin1String("+ "))) {
+				lineStart = 2;  // skip the prompt. Prompt will be indicated by the CSS, instead
 				if (previous_chunk != Command) {
-					if (previous_chunk != None) ret.append ("</pre>");
-					ret.append (opening.arg (QStringLiteral("code")));
+					if (previous_chunk != None) ret.append(u"</pre>"_s);
+					ret.append(opening.arg(QStringLiteral("code")));
 					previous_chunk = Command;
 				}
 			} else {
 				if (previous_chunk != Output) {
-					if (previous_chunk != None) ret.append ("</pre>");
-					ret.append (opening.arg (QStringLiteral("output_normal")));
+					if (previous_chunk != None) ret.append(u"</pre>"_s);
+					ret.append(opening.arg(QStringLiteral("output_normal")));
 					previous_chunk = Output;
 				}
-				ret.append (line.toHtmlEscaped () + '\n');	// don't copy output "highlighting". It is set using CSS, instead
+				ret.append(line.toHtmlEscaped() + u'\n');  // don't copy output "highlighting". It is set using CSS, instead
 				continue;
 			}
 		}
 
 		int handledUntil = lineStart;
 		int remainingChars = line.length();
-		for ( const KTextEditor::AttributeBlock& block : attribs ) {
+		for (const KTextEditor::AttributeBlock& block : attribs) {
 			if ((block.start + block.length) <= handledUntil) continue;
 			int start = qMax(block.start, lineStart);
-			if ( start > handledUntil ) {
-				ret += exportText( line.mid( handledUntil, start - handledUntil ), noAttrib, m_defaultAttribute );
+			if (start > handledUntil) {
+				ret += exportText(line.mid(handledUntil, start - handledUntil), noAttrib, m_defaultAttribute);
 			}
-			int end = qMin (block.start + block.length, remainingChars);
+			int end = qMin(block.start + block.length, remainingChars);
 			int length = end - start;
-			ret += exportText( line.mid( start, length ), block.attribute, m_defaultAttribute);
+			ret += exportText(line.mid(start, length), block.attribute, m_defaultAttribute);
 			handledUntil = end;
 		}
 
-		if ( handledUntil < lineStart + remainingChars ) {
-			ret += exportText( line.mid( handledUntil, remainingChars ), noAttrib, m_defaultAttribute );
+		if (handledUntil < lineStart + remainingChars) {
+			ret += exportText(line.mid(handledUntil, remainingChars), noAttrib, m_defaultAttribute);
 		}
 
-		if (i < (doc->lines () - 1)) ret.append ("\n");
+		if (i < (doc->lines() - 1)) ret.append(u"\n"_s);
 	}
-	ret.append ("</pre>\n");
+	ret.append(u"</pre>\n"_s);
 
 	return ret;
 }
@@ -1290,26 +1285,22 @@ void RKCommandHighlighter::setHighlighting (KTextEditor::Document *doc, Highligh
 	if (!(doc->setHighlightingMode (mode_string) && doc->setMode (mode_string))) RK_DEBUG (COMMANDEDITOR, DL_ERROR, "R syntax highlighting definition ('%s')not found!", qPrintable (mode_string));
 }
 
-void RKCommandHighlighter::copyLinesToOutput (KTextEditor::View *view, HighlightingMode mode) {
-	RK_TRACE (COMMANDEDITOR);
+void RKCommandHighlighter::copyLinesToOutput(KTextEditor::View *view, HighlightingMode mode) {
+	RK_TRACE(COMMANDEDITOR);
 
 	// expand selection to full lines (or current line)
-	KTextEditor::Document *doc = view->document ();
-	KTextEditor::Range sel = view->selectionRange ();
-	if (!sel.isValid ()) {
-		KTextEditor::Cursor pos = view->cursorPosition ();
-		sel.setRange (KTextEditor::Cursor (pos.line (), 0),
-					  KTextEditor::Cursor (pos.line (), doc->lineLength (pos.line ())));
+	KTextEditor::Document *doc = view->document();
+	KTextEditor::Range sel = view->selectionRange();
+	if (!sel.isValid()) {
+		KTextEditor::Cursor pos = view->cursorPosition();
+		sel.setRange(KTextEditor::Cursor(pos.line(), 0), KTextEditor::Cursor(pos.line(), doc->lineLength(pos.line())));
 	} else {
-		sel.setRange (KTextEditor::Cursor (sel.start ().line (), 0),
-					  KTextEditor::Cursor (sel.end ().line (), doc->lineLength (sel.end ().line ())));
+		sel.setRange(KTextEditor::Cursor(sel.start().line(), 0), KTextEditor::Cursor(sel.end().line(), doc->lineLength(sel.end().line())));
 	}
 
 	// highlight and submit
-	QString highlighted = commandToHTML (doc->text (sel), mode);
-	if (!highlighted.isEmpty ()) {
-		RInterface::issueCommand (".rk.cat.output (" + RObject::rQuote (highlighted) + ")\n", RCommand::App | RCommand::Silent);
+	QString highlighted = commandToHTML(doc->text(sel), mode);
+	if (!highlighted.isEmpty()) {
+		RInterface::issueCommand(u".rk.cat.output ("_s + RObject::rQuote(highlighted) + u")\n"_s, RCommand::App | RCommand::Silent);
 	}
 }
-
-
diff --git a/rkward/windows/rkcommandlog.cpp b/rkward/windows/rkcommandlog.cpp
index 0d1fee776..ee6b70490 100644
--- a/rkward/windows/rkcommandlog.cpp
+++ b/rkward/windows/rkcommandlog.cpp
@@ -93,34 +93,34 @@ void RKCommandLog::addOtherMessage(const QString &message, const QIcon &icon, RO
 		f.setBackground(QBrush(QColor(255, 255, 255)));
 		log_view->textCursor().mergeBlockFormat(f);
 	}
-	log_view->insertPlainText(message + '\n');
+	log_view->insertPlainText(message + u'\n');
 	log_view->setFontWeight(QFont::Normal);
 	log_view->setTextColor(Qt::black);
 }
 
-void RKCommandLog::addInputNoCheck (RCommand *command) {
-	RK_TRACE (APP);
-	if (command_input_shown.contains (command)) return;		// already shown
-
-// TODO: make colors/styles configurable
-	if (command->type () & RCommand::User) {
-		log_view->setTextColor (Qt::red);
-	} else if (command->type () & RCommand::Sync) {
-		log_view->setTextColor (Qt::gray);
-	} else if (command->type () & RCommand::Plugin) {
-		log_view->setTextColor (Qt::blue);
+void RKCommandLog::addInputNoCheck(RCommand *command) {
+	RK_TRACE(APP);
+	if (command_input_shown.contains(command)) return;  // already shown
+
+	// TODO: make colors/styles configurable
+	if (command->type() & RCommand::User) {
+		log_view->setTextColor(Qt::red);
+	} else if (command->type() & RCommand::Sync) {
+		log_view->setTextColor(Qt::gray);
+	} else if (command->type() & RCommand::Plugin) {
+		log_view->setTextColor(Qt::blue);
 	}
 
-	log_view->setFontItalic (true);
+	log_view->setFontItalic(true);
 
-	log_view->insertPlainText (command->command () + '\n');
+	log_view->insertPlainText(command->command() + u'\n');
 
-	checkRaiseWindow (command);
-	linesAdded ();
+	checkRaiseWindow(command);
+	linesAdded();
 
-	log_view->setFontItalic (false);
+	log_view->setFontItalic(false);
 
-	command_input_shown.append (command);
+	command_input_shown.append(command);
 }
 
 void RKCommandLog::addOutputNoCheck (RCommand *command, ROutput *output) {
diff --git a/rkward/windows/rkdebugmessagewindow.cpp b/rkward/windows/rkdebugmessagewindow.cpp
index ef0fcfa04..2e92a6c5a 100644
--- a/rkward/windows/rkdebugmessagewindow.cpp
+++ b/rkward/windows/rkdebugmessagewindow.cpp
@@ -107,28 +107,27 @@ RKDebugMessageWindowWidget::~RKDebugMessageWindowWidget () {
 	RK_TRACE (APP);
 }
 
-void RKDebugMessageWindowWidget::newMessage (const int flags, const int level, const QString &message) {
-	Q_UNUSED (flags);
+void RKDebugMessageWindowWidget::newMessage(const int flags, const int level, const QString &message) {
+	Q_UNUSED(flags);
 
 	// Not tracing this! That might lead to infinite recursion!
 	if (level == DL_TRACE) {
-		message_viewer->setTextColor (Qt::gray);
-		message_viewer->insertPlainText (QStringLiteral("TRACE\t"));
+		message_viewer->setTextColor(Qt::gray);
+		message_viewer->insertPlainText(QStringLiteral("TRACE\t"));
 	} else if (level == DL_DEBUG) {
-		message_viewer->setTextColor (Qt::blue);
-		message_viewer->insertPlainText (QStringLiteral("DEBUG\t"));
+		message_viewer->setTextColor(Qt::blue);
+		message_viewer->insertPlainText(QStringLiteral("DEBUG\t"));
 	} else if (level == DL_INFO) {
-		message_viewer->setTextColor (Qt::green);
-		message_viewer->insertPlainText (QStringLiteral("INFO\t"));
+		message_viewer->setTextColor(Qt::green);
+		message_viewer->insertPlainText(QStringLiteral("INFO\t"));
 	} else if (level == DL_WARNING) {
-		message_viewer->setTextColor (Qt::darkYellow);
-		message_viewer->insertPlainText (QStringLiteral("WARNING\t"));
+		message_viewer->setTextColor(Qt::darkYellow);
+		message_viewer->insertPlainText(QStringLiteral("WARNING\t"));
 	} else {
-		message_viewer->setTextColor (Qt::red);
-		message_viewer->insertPlainText (QStringLiteral("ERROR\t"));
+		message_viewer->setTextColor(Qt::red);
+		message_viewer->insertPlainText(QStringLiteral("ERROR\t"));
 	}
-	message_viewer->setTextColor (Qt::black);
+	message_viewer->setTextColor(Qt::black);
 
-	message_viewer->insertPlainText (message + '\n');
+	message_viewer->insertPlainText(message + u'\n');
 }
-
diff --git a/rkward/windows/rkfilebrowser.cpp b/rkward/windows/rkfilebrowser.cpp
index ffa9fc31b..42bd6bdd7 100644
--- a/rkward/windows/rkfilebrowser.cpp
+++ b/rkward/windows/rkfilebrowser.cpp
@@ -149,15 +149,16 @@ void RKFileBrowserWidget::syncToWD () {
 	if (isVisible()) setURL (QUrl::fromLocalFile (QDir::currentPath ()));
 }
 
-void RKFileBrowserWidget::rename () {
-	RK_TRACE (APP);
+void RKFileBrowserWidget::rename() {
+	RK_TRACE(APP);
 
-	QString name = QInputDialog::getText (this, i18n ("Rename..."), i18n ("New name for '%1':", context_menu_url.fileName ()), QLineEdit::Normal, context_menu_url.fileName ());
-	if (name.isEmpty ()) return;
+	QString name =
+	    QInputDialog::getText(this, i18n("Rename..."), i18n("New name for '%1':", context_menu_url.fileName()), QLineEdit::Normal, context_menu_url.fileName());
+	if (name.isEmpty()) return;
 
 	QUrl dest_url = context_menu_url;
-	dest_url.setPath (context_menu_url.adjusted (QUrl::RemoveFilename).path () + '/' + name);
-	KIO::moveAs (context_menu_url, dest_url);
+	dest_url.setPath(context_menu_url.adjusted(QUrl::RemoveFilename).path() + u'/' + name);
+	KIO::moveAs(context_menu_url, dest_url);
 }
 
 void RKFileBrowserWidget::contextMenuHook(const KFileItem& item, QMenu* menu) {
diff --git a/rkward/windows/rkhelpsearchwindow.cpp b/rkward/windows/rkhelpsearchwindow.cpp
index a8ca1fc5f..c89a4ca71 100644
--- a/rkward/windows/rkhelpsearchwindow.cpp
+++ b/rkward/windows/rkhelpsearchwindow.cpp
@@ -42,82 +42,82 @@ SPDX-License-Identifier: GPL-2.0-or-later
 
 RKHelpSearchWindow* RKHelpSearchWindow::main_help_search = nullptr;
 
-RKHelpSearchWindow::RKHelpSearchWindow (QWidget *parent, bool tool_window, const char *name) : RKMDIWindow (parent, SearchHelpWindow, tool_window, name) {
-	RK_TRACE (APP);
-	setPart (new RKDummyPart(nullptr, this));
-	initializeActivationSignals ();
-	setFocusPolicy (Qt::ClickFocus);
-
-	QVBoxLayout* main_layout = new QVBoxLayout (this);
-	QHBoxLayout* selection_layout = new QHBoxLayout ();
-	main_layout->addLayout (selection_layout);
-	selection_layout->setContentsMargins (0, 0, 0, 0);
-
-	QVBoxLayout* labels_layout = new QVBoxLayout ();
-	selection_layout->addLayout (labels_layout);
-	labels_layout->setContentsMargins (0, 0, 0, 0);
-	QLabel *label = new QLabel (i18n ("Find:"), this);
-	label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
-	labels_layout->addWidget (label);
-	label = new QLabel (i18n ("Fields:"), this);
-	label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
-	labels_layout->addWidget (label);
-
-	QVBoxLayout* main_settings_layout = new QVBoxLayout ();
-	selection_layout->addLayout (main_settings_layout);
-	main_settings_layout->setContentsMargins (0, 0, 0, 0);
-	field = new QComboBox (this);
-	field->setEditable (true);
-	field->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
-	connect (field->lineEdit (), &QLineEdit::returnPressed, this, &RKHelpSearchWindow::slotFindButtonClicked);
-	main_settings_layout->addWidget (field);
-
-	QHBoxLayout* fields_packages_layout = new QHBoxLayout ();
-	main_settings_layout->addLayout (fields_packages_layout);
-	fields_packages_layout->setContentsMargins (0, 0, 0, 0);
-	fieldsList = new QComboBox (this);
-	fieldsList->setEditable (false);
-	fieldsList->addItem (i18n ("All"), "c(\"alias\", \"concept\", \"title\",\"keyword\")");
-	fieldsList->addItem (i18n ("All but keywords"), "c(\"alias\", \"concept\", \"title\")");
-	fieldsList->addItem (i18n ("Keywords"), "c(\"keyword\")");
-	fieldsList->addItem (i18n ("Title"), "c(\"title\")");
-	fields_packages_layout->addWidget (fieldsList);
-
-	label = new QLabel (i18n ("Package:"), this);
-	label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
-	fields_packages_layout->addWidget (label);
-
-	packagesList = new QComboBox (this);
-	packagesList->setEditable (false);
-	fields_packages_layout->addWidget (packagesList);
-	connect (RKSessionVars::instance (), &RKSessionVars::installedPackagesChanged, this, &RKHelpSearchWindow::updateInstalledPackages);
-	updateInstalledPackages ();
-
-	QVBoxLayout* checkboxes_layout = new QVBoxLayout ();
-	selection_layout->addLayout (checkboxes_layout);
-	checkboxes_layout->setContentsMargins (0, 0, 0, 0);
-	caseSensitiveCheckBox = new QCheckBox (i18n ("Case sensitive"), this);
-	checkboxes_layout->addWidget (caseSensitiveCheckBox);
-	fuzzyCheckBox = new QCheckBox (i18n ("Fuzzy matching"), this);
-	fuzzyCheckBox->setChecked (true);
-	checkboxes_layout->addWidget (fuzzyCheckBox);
-
-	findButton = new QPushButton (i18n ("Find"), this);
-	findButton->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
-	connect (findButton, &QPushButton::clicked, this, &RKHelpSearchWindow::slotFindButtonClicked);
-	selection_layout->addWidget (findButton);
-
-	results = new RKHelpSearchResultsModel (this);
-	proxy_model = new QSortFilterProxyModel (this);
-	proxy_model->setSourceModel (results);
-	results_view = new QTreeView (this);
-	results_view->setRootIsDecorated (false);
-	results_view->setModel (proxy_model);
-	results_view->setSortingEnabled (true);
-	connect (results_view, &QTreeView::doubleClicked, this, &RKHelpSearchWindow::resultDoubleClicked);
-	main_layout->addWidget (results_view);
-
-	setCaption (i18n ("Help search"));
+RKHelpSearchWindow::RKHelpSearchWindow(QWidget* parent, bool tool_window, const char* name) : RKMDIWindow(parent, SearchHelpWindow, tool_window, name) {
+	RK_TRACE(APP);
+	setPart(new RKDummyPart(nullptr, this));
+	initializeActivationSignals();
+	setFocusPolicy(Qt::ClickFocus);
+
+	QVBoxLayout* main_layout = new QVBoxLayout(this);
+	QHBoxLayout* selection_layout = new QHBoxLayout();
+	main_layout->addLayout(selection_layout);
+	selection_layout->setContentsMargins(0, 0, 0, 0);
+
+	QVBoxLayout* labels_layout = new QVBoxLayout();
+	selection_layout->addLayout(labels_layout);
+	labels_layout->setContentsMargins(0, 0, 0, 0);
+	QLabel* label = new QLabel(i18n("Find:"), this);
+	label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
+	labels_layout->addWidget(label);
+	label = new QLabel(i18n("Fields:"), this);
+	label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
+	labels_layout->addWidget(label);
+
+	QVBoxLayout* main_settings_layout = new QVBoxLayout();
+	selection_layout->addLayout(main_settings_layout);
+	main_settings_layout->setContentsMargins(0, 0, 0, 0);
+	field = new QComboBox(this);
+	field->setEditable(true);
+	field->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
+	connect(field->lineEdit(), &QLineEdit::returnPressed, this, &RKHelpSearchWindow::slotFindButtonClicked);
+	main_settings_layout->addWidget(field);
+
+	QHBoxLayout* fields_packages_layout = new QHBoxLayout();
+	main_settings_layout->addLayout(fields_packages_layout);
+	fields_packages_layout->setContentsMargins(0, 0, 0, 0);
+	fieldsList = new QComboBox(this);
+	fieldsList->setEditable(false);
+	fieldsList->addItem(i18n("All"), u"c(\"alias\", \"concept\", \"title\",\"keyword\")"_s);
+	fieldsList->addItem(i18n("All but keywords"), u"c(\"alias\", \"concept\", \"title\")"_s);
+	fieldsList->addItem(i18n("Keywords"), u"c(\"keyword\")"_s);
+	fieldsList->addItem(i18n("Title"), u"c(\"title\")"_s);
+	fields_packages_layout->addWidget(fieldsList);
+
+	label = new QLabel(i18n("Package:"), this);
+	label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
+	fields_packages_layout->addWidget(label);
+
+	packagesList = new QComboBox(this);
+	packagesList->setEditable(false);
+	fields_packages_layout->addWidget(packagesList);
+	connect(RKSessionVars::instance(), &RKSessionVars::installedPackagesChanged, this, &RKHelpSearchWindow::updateInstalledPackages);
+	updateInstalledPackages();
+
+	QVBoxLayout* checkboxes_layout = new QVBoxLayout();
+	selection_layout->addLayout(checkboxes_layout);
+	checkboxes_layout->setContentsMargins(0, 0, 0, 0);
+	caseSensitiveCheckBox = new QCheckBox(i18n("Case sensitive"), this);
+	checkboxes_layout->addWidget(caseSensitiveCheckBox);
+	fuzzyCheckBox = new QCheckBox(i18n("Fuzzy matching"), this);
+	fuzzyCheckBox->setChecked(true);
+	checkboxes_layout->addWidget(fuzzyCheckBox);
+
+	findButton = new QPushButton(i18n("Find"), this);
+	findButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+	connect(findButton, &QPushButton::clicked, this, &RKHelpSearchWindow::slotFindButtonClicked);
+	selection_layout->addWidget(findButton);
+
+	results = new RKHelpSearchResultsModel(this);
+	proxy_model = new QSortFilterProxyModel(this);
+	proxy_model->setSourceModel(results);
+	results_view = new QTreeView(this);
+	results_view->setRootIsDecorated(false);
+	results_view->setModel(proxy_model);
+	results_view->setSortingEnabled(true);
+	connect(results_view, &QTreeView::doubleClicked, this, &RKHelpSearchWindow::resultDoubleClicked);
+	main_layout->addWidget(results_view);
+
+	setCaption(i18n("Help search"));
 }
 
 RKHelpSearchWindow::~RKHelpSearchWindow () {
@@ -141,70 +141,71 @@ void RKHelpSearchWindow::getContextHelp (const QString &context_line, int cursor
 	getFunctionHelp (result);
 }
 
-void RKHelpSearchWindow::getFunctionHelp (const QString &function_name, const QString &package, const QString &type) {
-	RK_TRACE (APP);
+void RKHelpSearchWindow::getFunctionHelp(const QString &function_name, const QString &package, const QString &type) {
+	RK_TRACE(APP);
 
-	// we use .rk.getHelp() instead of plain help() to receive an error, if no help could be found
-	QString command = QStringLiteral(".rk.getHelp(");
-	if (type == QLatin1String("demo")) command = QLatin1String("rk.demo(");
-	else if (type == QLatin1String("vignette")) command = QLatin1String("print (vignette(");
+	QString command = RObject::rQuote(function_name);
+	if (!package.isEmpty()) command.append(u", package="_s + RObject::rQuote(package));
 
-	command.append (RObject::rQuote (function_name));
-	if (!package.isEmpty ()) command.append (", package=" + RObject::rQuote (package));
-	command.append (")");
-	if (type == QLatin1String("vignette")) command.append (")");
+	if (type == QLatin1String("demo")) command = u"rk.demo("_s + command + u')';
+	else if (type == QLatin1String("vignette")) command = u"print (vignette("_s + command + u"))"_s;
+	else command = u".rk.getHelp("_s + command + u')'; // we use .rk.getHelp() instead of plain help() to receive an error, if no help could be found
 
 	auto c = new RCommand(command, RCommand::App | RCommand::GetStringVector, i18n("Find HTML help for %1", function_name));
-	c->whenFinished(this, [this](RCommand* command) {
-		if (command->failed ()) {
-			KMessageBox::error(this, i18n("No help found on '%1'. Maybe the corresponding package is not installed/loaded, or maybe you mistyped the command. Try using Help->Search R Help for more options.", command->command().section('\"', 1, 1)), i18n("No help found"));
+	c->whenFinished(this, [this, function_name](RCommand *command) {
+		if (command->failed()) {
+			KMessageBox::error(this,
+			                   i18n("No help found on '%1'. Maybe the corresponding package is not installed/loaded, or maybe you mistyped the command. Try "
+			                        "using Help->Search R Help for more options.", function_name),
+			                   i18n("No help found"));
 		}
 	});
 	RInterface::issueCommand(c);
 }
 
-void RKHelpSearchWindow::slotFindButtonClicked () {
-	RK_TRACE (APP);
+void RKHelpSearchWindow::slotFindButtonClicked() {
+	RK_TRACE(APP);
 
-	if (field->currentText ().isEmpty ()) {
+	if (field->currentText().isEmpty()) {
 		return;
 	}
-	
+
 	QString agrep = QStringLiteral("FALSE");
-	if (fuzzyCheckBox->isChecked ()) {
-		agrep=QLatin1String("NULL");
+	if (fuzzyCheckBox->isChecked()) {
+		agrep = QLatin1String("NULL");
 	}
-	
+
 	QString ignoreCase = QStringLiteral("TRUE");
-	if(caseSensitiveCheckBox->isChecked ()) {
-		ignoreCase=QLatin1String("FALSE");
+	if (caseSensitiveCheckBox->isChecked()) {
+		ignoreCase = QLatin1String("FALSE");
 	}
-	
+
 	QString package = QStringLiteral(", package=");
-	if (packagesList->currentIndex () == 0) {
-		package.append ("NULL");	// all installed packages; actually we could also use package.clear(), here.
-	} else if (packagesList->currentIndex () == 1) {
-		package.append (".packages()");	// all loaded packages
+	if (packagesList->currentIndex() == 0) {
+		package.append(u"NULL"_s);  // all installed packages; actually we could also use package.clear(), here.
+	} else if (packagesList->currentIndex() == 1) {
+		package.append(u".packages()"_s);  // all loaded packages
 	} else {
-		package.append ("\"" + packagesList->currentText () + "\"");
+		package.append(u"\""_s + packagesList->currentText() + u"\""_s);
 	}
 
-	QString fields = fieldsList->itemData (fieldsList->currentIndex ()).toString ();
+	QString fields = fieldsList->itemData(fieldsList->currentIndex()).toString();
 
-	QString s = ".rk.get.search.results (" + RObject::rQuote (field->currentText ()) + ", agrep=" + agrep + ", ignore.case=" + ignoreCase + package + ", fields=" + fields + ')';
+	QString s = u".rk.get.search.results ("_s + RObject::rQuote(field->currentText()) + u", agrep="_s + agrep + u", ignore.case="_s + ignoreCase + package +
+	            u", fields="_s + fields + u')';
 
 	auto c = new RCommand(s, RCommand::App | RCommand::Sync | RCommand::GetStringVector);
 	c->whenFinished(this, [this](RCommand *command) {
 		QStringList res;
-		if (command->failed ()) {
-			RK_ASSERT (false);
+		if (command->failed()) {
+			RK_ASSERT(false);
 		} else {
-			RK_ASSERT (command->getDataType () == RData::StringVector);
-			res = command->stringVector ();
+			RK_ASSERT(command->getDataType() == RData::StringVector);
+			res = command->stringVector();
 		}
-		results->setResults (res);
+		results->setResults(res);
 
-		for (int i = 0; i < COL_COUNT; ++i) results_view->resizeColumnToContents (i);
+		for (int i = 0; i < COL_COUNT; ++i) results_view->resizeColumnToContents(i);
 		setEnabled(true);
 	});
 	RInterface::issueCommand(c);
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index ae2954aab..d16a76cd6 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -489,33 +489,33 @@ void RKHTMLWindow::openRKHPage (const QUrl &url) {
 }
 
 // static
-bool RKHTMLWindow::handleRKWardURL (const QUrl &url, RKHTMLWindow *window) {
-	RK_TRACE (APP);
+bool RKHTMLWindow::handleRKWardURL(const QUrl &url, RKHTMLWindow *window) {
+	RK_TRACE(APP);
 
 	if (isRKWardUrl(url)) {
-		if (url.host () == QLatin1String("runplugin")) {
-			QString path = url.path ();
-			if (path.startsWith ('/')) path = path.mid (1);
-			int sep = path.indexOf ('/');
+		if (url.host() == QLatin1String("runplugin")) {
+			QString path = url.path();
+			if (path.startsWith(u'/')) path = path.mid(1);
+			int sep = path.indexOf(u'/');
 			// NOTE: These links may originate externally, even from untrusted sources. The submit mode *must* remain "ManualSubmit" for this reason!
-			RKComponentMap::invokeComponent (path.left (sep), path.mid (sep+1).split ('\n', Qt::SkipEmptyParts), RKComponentMap::ManualSubmit);
-		} else if (url.host () == QLatin1String("rhelp")) {
+			RKComponentMap::invokeComponent(path.left(sep), path.mid(sep + 1).split(u'\n', Qt::SkipEmptyParts), RKComponentMap::ManualSubmit);
+		} else if (url.host() == QLatin1String("rhelp")) {
 			// TODO: find a nice solution to render this in the current window
-			QStringList spec = url.path ().mid (1).split ('/');
+			QStringList spec = url.path().mid(1).split(u'/');
 			QString function, package, type;
-			if (!spec.isEmpty ()) function = spec.takeLast ();
-			if (!spec.isEmpty ()) package = spec.takeLast ();
-			if (!spec.isEmpty ()) type = spec.takeLast ();
-			RKHelpSearchWindow::mainHelpSearch ()->getFunctionHelp (function, package, type);
-		} else if (url.host () == QLatin1String("settings")) {
-			QString path = url.path ();
-			if (path.startsWith ('/')) path = path.mid (1);
+			if (!spec.isEmpty()) function = spec.takeLast();
+			if (!spec.isEmpty()) package = spec.takeLast();
+			if (!spec.isEmpty()) type = spec.takeLast();
+			RKHelpSearchWindow::mainHelpSearch()->getFunctionHelp(function, package, type);
+		} else if (url.host() == QLatin1String("settings")) {
+			QString path = url.path();
+			if (path.startsWith(u'/')) path = path.mid(1);
 			RKSettings::configureSettings(RKSettingsModule::PageId(path.toLatin1()));
-		} else if (url.host () == QLatin1String("open")) {
-			QString path = url.path().mid(1); // skip initial '/'
-			int sep = path.indexOf('/');
+		} else if (url.host() == QLatin1String("open")) {
+			QString path = url.path().mid(1);  // skip initial '/'
+			int sep = path.indexOf(u'/');
 			QString category = path.left(sep);
-			path = path.mid(sep+1);
+			path = path.mid(sep + 1);
 			RK_DEBUG(APP, DL_DEBUG, "rkward://open: %s -> %s , %s", qPrintable(url.path()), qPrintable(category), qPrintable(path));
 			QUrl target;
 			if (!path.isEmpty()) target = QUrl::fromUserInput(path);
@@ -530,9 +530,9 @@ bool RKHTMLWindow::handleRKWardURL (const QUrl &url, RKHTMLWindow *window) {
 				// See opening workspace, above.
 				QTimer::singleShot(0, RKWardMainWindow::getMain(), [target]() { RKWorkplace::mainWorkplace()->openAnyUrl(target); });
 			}
-		} else if (url.host () == QLatin1String("actions")) {  // anything else
-			QString action = url.path ();
-			if (action.startsWith ('/')) action = action.mid (1);
+		} else if (url.host() == QLatin1String("actions")) {  // anything else
+			QString action = url.path();
+			if (action.startsWith(u'/')) action = action.mid(1);
 			if (action == QLatin1String("new_data_frame")) {
 				RKWardMainWindow::getMain()->slotNewDataFrame();
 			} else if (action == QLatin1String("rpackage_install")) {
@@ -543,8 +543,8 @@ bool RKHTMLWindow::handleRKWardURL (const QUrl &url, RKHTMLWindow *window) {
 				RK_ASSERT(false);
 			}
 		} else {
-			if (window) window->openRKHPage (url);
-			else RKWorkplace::mainWorkplace ()->openHelpWindow (url);	// will recurse with window set, via openURL()
+			if (window) window->openRKHPage(url);
+			else RKWorkplace::mainWorkplace()->openHelpWindow(url);  // will recurse with window set, via openURL()
 		}
 		return true;
 	}
@@ -592,7 +592,7 @@ bool RKHTMLWindow::openURL (const QUrl &url) {
 				RK_DEBUG (APP, DL_WARNING, "Applying workaround for https://bugs.kde.org/show_bug.cgi?id=405386");
 				QFile f (url.toLocalFile ());
 				f.open (QIODevice::ReadOnly);
-				page->setHtmlWrapper(f.readAll(), url.adjusted(QUrl::RemoveFilename));
+				page->setHtmlWrapper(QString::fromUtf8(f.readAll()), url.adjusted(QUrl::RemoveFilename));
 				f.close ();
 			} else {
 				// NOTE: Quirk in Qt 6.7: When first loading a page, the window is somehow brought to the front, again. In preview windows
@@ -728,8 +728,8 @@ void RKHTMLWindow::updateState(){
 	updateCaption(current_url);
 }
 
-void RKHTMLWindow::updateCaption (const QUrl &url) {
-	RK_TRACE (APP);
+void RKHTMLWindow::updateCaption(const QUrl &url) {
+	RK_TRACE(APP);
 
 	if (window_mode == HTMLOutputWindow) {
 		if (dir) {
@@ -738,18 +738,17 @@ void RKHTMLWindow::updateCaption (const QUrl &url) {
 			if (dir->isActive()) mods.append(i18n("[Active]"));
 			// TODO: use icon(s), instead
 			bool mod = dir->isModifiedFast();
-			if (mod) mods.append("(*)");
+			if (mod) mods.append(u"(*)"_s);
 			if (!mods.isEmpty()) {
-				name.append(' ');
+				name.append(u' ');
 				name.append(mods);
 			}
 			setCaption(name);
 			part->revert->setEnabled(mod);
 		} else {
-			setCaption (i18n ("Output %1", url.fileName ()));
+			setCaption(i18nc("noun, the output", "Output %1", url.fileName()));
 		}
-	}
-	else setCaption (url.fileName ());
+	} else setCaption(url.fileName());
 }
 
 void RKHTMLWindow::refresh () {
@@ -783,12 +782,12 @@ void RKHTMLWindow::zoomOut () {
 	view->setZoomFactor (view->zoomFactor () / 1.1);
 }
 
-void RKHTMLWindow::setTextEncoding (QStringConverter::Encoding encoding) {
-	RK_TRACE (APP);
+void RKHTMLWindow::setTextEncoding(QStringConverter::Encoding encoding) {
+	RK_TRACE(APP);
 
 	QStringEncoder converter(encoding);
-	page->settings ()->setDefaultTextEncoding (converter.name ());
-	view->reload ();
+	page->settings()->setDefaultTextEncoding(QString::fromUtf8(converter.name()));
+	view->reload();
 }
 
 void RKHTMLWindow::useMode (WindowMode new_mode) {
@@ -819,20 +818,20 @@ void RKHTMLWindow::useMode (WindowMode new_mode) {
 	window_mode = new_mode;
 }
 
-void RKHTMLWindow::startNewCacheFile () {
+void RKHTMLWindow::startNewCacheFile() {
 	delete current_cache_file;
-	current_cache_file = new QTemporaryFile (QDir::tempPath () + QLatin1String ("/rkward_XXXXXX") + QLatin1String (".html"));
-	current_cache_file->open ();
+	current_cache_file = new QTemporaryFile(QDir::tempPath() + u"/rkward_XXXXXX.html"_s);
+	current_cache_file->open();
 }
 
-void RKHTMLWindow::fileDoesNotExistMessage () {
-	RK_TRACE (APP);
+void RKHTMLWindow::fileDoesNotExistMessage() {
+	RK_TRACE(APP);
 
-	page->setHtmlWrapper(QString("<html><body><h1>" + i18n ("Page does not exist or is broken") + "</h1></body></html>"), QUrl());;
+	page->setHtmlWrapper(u"<html><body><h1>"_s + i18n("Page does not exist or is broken") + u"</h1></body></html>"_s, QUrl());
 }
 
-void RKHTMLWindow::flushOutput () {
-	RK_TRACE (APP);
+void RKHTMLWindow::flushOutput() {
+	RK_TRACE(APP);
 
 	if (dir) {
 		dir->clear();
@@ -840,15 +839,17 @@ void RKHTMLWindow::flushOutput () {
 	}
 
 	// TODO: remove legacy code below, eventually
-	int res = KMessageBox::questionTwoActions(this, i18n ("Do you really want to clear the output? This will also remove all image files used in the output. It will not be possible to restore it."), i18n("Flush output?"), KStandardGuiItem::clear(), KStandardGuiItem::cancel());
-	if (res==KMessageBox::PrimaryAction) {
-		QFile out_file (current_url.toLocalFile ());
-		RCommand *c = new RCommand ("rk.flush.output (" + RCommand::rQuote (out_file.fileName ()) + ", ask=FALSE)\n", RCommand::App);
-		connect (c->notifier (), &RCommandNotifier::commandFinished, this, &RKHTMLWindow::refresh);
-		RKProgressControl *status = new RKProgressControl (this, i18n ("Flushing output"), i18n ("Flushing output"), RKProgressControl::CancellableNoProgress);
-		status->addRCommand (c, true);
-		status->doNonModal (true);
-		RInterface::issueCommand (c);
+	int res = KMessageBox::questionTwoActions(
+	    this, i18n("Do you really want to clear the output? This will also remove all image files used in the output. It will not be possible to restore it."),
+	    i18n("Flush output?"), KStandardGuiItem::clear(), KStandardGuiItem::cancel());
+	if (res == KMessageBox::PrimaryAction) {
+		QFile out_file(current_url.toLocalFile());
+		RCommand *c = new RCommand(u"rk.flush.output ("_s + RCommand::rQuote(out_file.fileName()) + u", ask=FALSE)\n"_s, RCommand::App);
+		connect(c->notifier(), &RCommandNotifier::commandFinished, this, &RKHTMLWindow::refresh);
+		RKProgressControl *status = new RKProgressControl(this, i18n("Flushing output"), i18n("Flushing output"), RKProgressControl::CancellableNoProgress);
+		status->addRCommand(c, true);
+		status->doNonModal(true);
+		RInterface::issueCommand(c);
 	}
 }
 
@@ -971,22 +972,22 @@ void RKHTMLWindowPart::setHelpWindowSkin() {
 //////////////////////////////////////////
 //////////////////////////////////////////
 
-bool RKHelpRenderer::renderRKHelp (const QUrl &url, RKHTMLWindow* container) {
-	RK_TRACE (APP);
+bool RKHelpRenderer::renderRKHelp(const QUrl &url, RKHTMLWindow *container) {
+	RK_TRACE(APP);
 
 	if (!isRKWardUrl(url)) {
-		RK_ASSERT (false);
+		RK_ASSERT(false);
 		return (false);
 	}
 
-	bool for_component = false;		// is this a help page for a component, or a top-level help page?
-	if (url.host () == QLatin1String("component")) for_component = true;
+	bool for_component = false;  // is this a help page for a component, or a top-level help page?
+	if (url.host() == QLatin1String("component")) for_component = true;
 
 	QStringList anchors, anchornames;
 
 	RKComponentHandle *chandle = nullptr;
 	if (for_component) {
-		chandle = componentPathToHandle (url.path ());
+		chandle = componentPathToHandle(url.path());
 		if (!chandle) return false;
 	}
 
@@ -994,86 +995,90 @@ bool RKHelpRenderer::renderRKHelp (const QUrl &url, RKHTMLWindow* container) {
 	component_xml = &component_xml_helper;
 	QString help_file_name;
 	QDomElement element;
-	QString help_base_dir = RKCommonFunctions::getRKWardDataDir () + "pages/";
-	QString css_filename = QUrl::fromLocalFile (help_base_dir + "rkward_help.css").toString ();
+	QString help_base_dir = RKCommonFunctions::getRKWardDataDir() + u"pages/"_s;
+	QString css_filename = QUrl::fromLocalFile(help_base_dir + u"rkward_help.css"_s).toString();
 
 	// determine help file, and prepare
 	if (for_component) {
-		component_doc_element = component_xml_helper.openXMLFile (DL_ERROR);
-		if (component_doc_element.isNull ()) return false;
-		element = component_xml_helper.getChildElement (component_doc_element, QStringLiteral("help"), DL_ERROR);
-		if (!element.isNull ()) {
-			help_file_name = component_xml_helper.getStringAttribute (element, QStringLiteral("file"), QString (), DL_ERROR);
-			if (!help_file_name.isEmpty ()) help_file_name = QFileInfo (chandle->getFilename ()).absoluteDir ().filePath (help_file_name);
+		component_doc_element = component_xml_helper.openXMLFile(DL_ERROR);
+		if (component_doc_element.isNull()) return false;
+		element = component_xml_helper.getChildElement(component_doc_element, QStringLiteral("help"), DL_ERROR);
+		if (!element.isNull()) {
+			help_file_name = component_xml_helper.getStringAttribute(element, QStringLiteral("file"), QString(), DL_ERROR);
+			if (!help_file_name.isEmpty()) help_file_name = QFileInfo(chandle->getFilename()).absoluteDir().filePath(help_file_name);
 		}
 	} else {
-		help_file_name = help_base_dir + url.path () + ".rkh";
+		help_file_name = help_base_dir + url.path() + u".rkh"_s;
 	}
-	RK_DEBUG (APP, DL_DEBUG, "rendering help page for local file %s", help_file_name.toLatin1().data());
+	RK_DEBUG(APP, DL_DEBUG, "rendering help page for local file %s", help_file_name.toLatin1().data());
 
 	// open help file
-	const RKMessageCatalog *catalog = component_xml_helper.messageCatalog ();
-	if (!for_component) catalog = RKMessageCatalog::getCatalog (QStringLiteral("rkward__pages"), RKCommonFunctions::getRKWardDataDir () + "po/");
-	XMLHelper help_xml_helper (help_file_name, catalog);
+	const RKMessageCatalog *catalog = component_xml_helper.messageCatalog();
+	if (!for_component) catalog = RKMessageCatalog::getCatalog(QStringLiteral("rkward__pages"), RKCommonFunctions::getRKWardDataDir() + u"po/"_s);
+	XMLHelper help_xml_helper(help_file_name, catalog);
 	help_xml = &help_xml_helper;
-	help_doc_element = help_xml_helper.openXMLFile (DL_ERROR);
-	if (help_doc_element.isNull () && (!for_component)) return false;
+	help_doc_element = help_xml_helper.openXMLFile(DL_ERROR);
+	if (help_doc_element.isNull() && (!for_component)) return false;
 
 	// initialize output, and set title
-	QString page_title (i18n ("No Title"));
+	QString page_title(i18n("No Title"));
 	if (for_component) {
-		page_title = chandle->getLabel ();
+		page_title = chandle->getLabel();
 	} else {
-		element = help_xml_helper.getChildElement (help_doc_element, QStringLiteral("title"), DL_WARNING);
-		page_title = help_xml_helper.i18nElementText (element, false, DL_WARNING);
+		element = help_xml_helper.getChildElement(help_doc_element, QStringLiteral("title"), DL_WARNING);
+		page_title = help_xml_helper.i18nElementText(element, false, DL_WARNING);
 	}
-	writeHTML("<html><head><title>" + page_title + "</title><link rel=\"stylesheet\" type=\"text/css\" href=\"" + css_filename + "\">"
-	          "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head>\n"
-	          "<body id=\"" + help_xml_helper.getStringAttribute(help_doc_element, QStringLiteral("pageid"), QStringLiteral("standard"), DL_INFO) + "\"><div id=\"main\">\n<h1>" + page_title + "</h1>\n");
+	writeHTML(u"<html><head><title>"_s + page_title + u"</title><link rel=\"stylesheet\" type=\"text/css\" href=\""_s + css_filename + u"\">"_s
+	          u"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head>\n"_s
+	          u"<body id=\""_s +
+	          help_xml_helper.getStringAttribute(help_doc_element, u"pageid"_s, u"standard"_s, DL_INFO) + u"\"><div id=\"main\">\n<h1>"_s + page_title +
+	          u"</h1>\n"_s);
 
-	if (help_doc_element.isNull ()) {
-		RK_ASSERT (for_component);
-		writeHTML (i18n ("<h1>Help page missing</h1>\n<p>The help page for this component has not yet been written (or is broken). Please consider contributing it.</p>\n"));
+	if (help_doc_element.isNull()) {
+		RK_ASSERT(for_component);
+		writeHTML(i18n(
+		    "<h1>Help page missing</h1>\n<p>The help page for this component has not yet been written (or is broken). Please consider contributing it.</p>\n"));
 	}
 	if (for_component) {
-		QString component_id = componentPathToId (url.path());
-		RKComponentHandle *handle = componentPathToHandle (url.path());
-		if (handle && handle->isAccessible ()) writeHTML ("<a href=\"rkward://runplugin/" + component_id + "/\">" + i18n ("Use %1 now", page_title) + "</a>");
+		QString component_id = componentPathToId(url.path());
+		RKComponentHandle *handle = componentPathToHandle(url.path());
+		if (handle && handle->isAccessible())
+			writeHTML(u"<a href=\"rkward://runplugin/"_s + component_id + u"/\">"_s + i18n("Use %1 now", page_title) + u"</a>"_s);
 	}
 
 	// fix all elements containing an "src" attribute
-	QDir base_path (QFileInfo (help_file_name).absolutePath());
-	XMLChildList src_elements = help_xml_helper.findElementsWithAttribute (help_doc_element, QStringLiteral("src"), QString (), true, DL_DEBUG);
-	for (XMLChildList::iterator it = src_elements.begin (); it != src_elements.end (); ++it) {
-		QString src = (*it).attribute (QStringLiteral("src"));
-		if (QUrl (src).isRelative ()) {
-			src = "file://" + QDir::cleanPath (base_path.filePath (src));
-			(*it).setAttribute (QStringLiteral("src"), src);
+	QDir base_path(QFileInfo(help_file_name).absolutePath());
+	XMLChildList src_elements = help_xml_helper.findElementsWithAttribute(help_doc_element, QStringLiteral("src"), QString(), true, DL_DEBUG);
+	for (XMLChildList::iterator it = src_elements.begin(); it != src_elements.end(); ++it) {
+		QString src = (*it).attribute(QStringLiteral("src"));
+		if (QUrl(src).isRelative()) {
+			src = u"file://"_s + QDir::cleanPath(base_path.filePath(src));
+			(*it).setAttribute(QStringLiteral("src"), src);
 		}
 	}
 
 	// render the sections
-	element = help_xml_helper.getChildElement (help_doc_element, QStringLiteral("summary"), DL_INFO);
-	if (!element.isNull ()) {
-		writeHTML (startSection (QStringLiteral("summary"), i18n ("Summary"), QString (), &anchors, &anchornames));
-		writeHTML (renderHelpFragment (element));
+	element = help_xml_helper.getChildElement(help_doc_element, QStringLiteral("summary"), DL_INFO);
+	if (!element.isNull()) {
+		writeHTML(startSection(QStringLiteral("summary"), i18n("Summary"), QString(), &anchors, &anchornames));
+		writeHTML(renderHelpFragment(element));
 		writeHTML(endSection());
 	}
 
-	element = help_xml_helper.getChildElement (help_doc_element, QStringLiteral("usage"), DL_INFO);
-	if (!element.isNull ()) {
-		writeHTML (startSection (QStringLiteral("usage"), i18n ("Usage"), QString (), &anchors, &anchornames));
-		writeHTML (renderHelpFragment (element));
+	element = help_xml_helper.getChildElement(help_doc_element, QStringLiteral("usage"), DL_INFO);
+	if (!element.isNull()) {
+		writeHTML(startSection(QStringLiteral("usage"), i18n("Usage"), QString(), &anchors, &anchornames));
+		writeHTML(renderHelpFragment(element));
 		writeHTML(endSection());
 	}
 
 	bool container_refresh_connected = false;
-	XMLChildList section_elements = help_xml_helper.getChildElements (help_doc_element, QStringLiteral("section"), DL_INFO);
-	for (XMLChildList::iterator it = section_elements.begin (); it != section_elements.end (); ++it) {
-		QString title = help_xml_helper.i18nStringAttribute (*it, QStringLiteral("title"), QString (), DL_WARNING);
-		QString shorttitle = help_xml_helper.i18nStringAttribute (*it, QStringLiteral("shorttitle"), QString (), DL_DEBUG);
-		QString id = help_xml_helper.getStringAttribute (*it, QStringLiteral("id"), QString (), DL_WARNING);
-		writeHTML (startSection (id, title, shorttitle, &anchors, &anchornames));
+	XMLChildList section_elements = help_xml_helper.getChildElements(help_doc_element, QStringLiteral("section"), DL_INFO);
+	for (XMLChildList::iterator it = section_elements.begin(); it != section_elements.end(); ++it) {
+		QString title = help_xml_helper.i18nStringAttribute(*it, QStringLiteral("title"), QString(), DL_WARNING);
+		QString shorttitle = help_xml_helper.i18nStringAttribute(*it, QStringLiteral("shorttitle"), QString(), DL_DEBUG);
+		QString id = help_xml_helper.getStringAttribute(*it, QStringLiteral("id"), QString(), DL_WARNING);
+		writeHTML(startSection(id, title, shorttitle, &anchors, &anchornames));
 		QString special = help_xml_helper.getStringAttribute(*it, QStringLiteral("special"), QString(), DL_DEBUG);
 		if (!special.isEmpty()) {
 			if (special == QLatin1String("recentfiles")) {
@@ -1086,14 +1091,16 @@ bool RKHelpRenderer::renderRKHelp (const QUrl &url, RKHTMLWindow* container) {
 					}
 				}
 				for (int i = 0; i < list.size(); ++i) {
-					writeHTML(QStringLiteral("<li>‎<a href=\"rkward://open/%1/%2\" title=\"%2\">%3</a></li>\n").arg(category, list[i].url(), RKCommonFunctions::escape(list[i].url(QUrl::PreferLocalFile))));
+					writeHTML(QStringLiteral("<li>‎<a href=\"rkward://open/%1/%2\" title=\"%2\">%3</a></li>\n")
+					              .arg(category, list[i].url(), RKCommonFunctions::escape(list[i].url(QUrl::PreferLocalFile))));
 				}
 				writeHTML(QStringLiteral("</ul>\n"));
-				writeHTML(QStringLiteral("<form action=\"rkward://open/%1/\"><button type=\"submit\">%3</button></form>\n").arg(category, i18n("Choose another file")));
+				writeHTML(QStringLiteral("<form action=\"rkward://open/%1/\"><button type=\"submit\">%3</button></form>\n")
+				              .arg(category, i18n("Choose another file")));
 				if (container && !container_refresh_connected) {
 					container_refresh_connected = true;
 					auto connection = new QMetaObject::Connection;
-					*connection = QObject::connect(RKRecentUrls::notifier(), &RKRecentUrls::recentUrlsChanged, container, [connection, container](){
+					*connection = QObject::connect(RKRecentUrls::notifier(), &RKRecentUrls::recentUrlsChanged, container, [connection, container]() {
 						// connection must self-destruct, as it will be re-created from refresh()
 						QObject::disconnect(*connection);
 						delete connection;
@@ -1103,30 +1110,31 @@ bool RKHelpRenderer::renderRKHelp (const QUrl &url, RKHTMLWindow* container) {
 				}
 			}
 		}
-		writeHTML (renderHelpFragment (*it));
+		writeHTML(renderHelpFragment(*it));
 		writeHTML(endSection());
 	}
 
-	// the section "settings" is the most complicated, as the labels of the individual GUI items has to be fetched from the component description. Of course it is only meaningful for component help, and not rendered for top level help pages.
+	// the section "settings" is the most complicated, as the labels of the individual GUI items has to be fetched from the component description. Of course it
+	// is only meaningful for component help, and not rendered for top level help pages.
 	if (for_component) {
-		element = help_xml_helper.getChildElement (help_doc_element, QStringLiteral("settings"), DL_INFO);
-		if (!element.isNull ()) {
-			writeHTML (startSection (QStringLiteral("settings"), i18n ("GUI settings"), QString (), &anchors, &anchornames));
-			XMLChildList setting_elements = help_xml_helper.getChildElements (element, QString (), DL_WARNING);
-			for (XMLChildList::iterator it = setting_elements.begin (); it != setting_elements.end (); ++it) {
-				if ((*it).tagName () == QLatin1String("setting")) {
-					QString id = help_xml_helper.getStringAttribute (*it, QStringLiteral("id"), QString (), DL_WARNING);
-					QString title = help_xml_helper.i18nStringAttribute (*it, QStringLiteral("title"), QString (), DL_INFO);
-					if (title.isEmpty ()) title = resolveLabel (id);
-					writeHTML ("<h4>" + title + "</h4>");
-					writeHTML (renderHelpFragment (*it));
-				} else if ((*it).tagName () == QLatin1String("caption")) {
-					QString id = help_xml_helper.getStringAttribute (*it, QStringLiteral("id"), QString (), DL_WARNING);
-					QString title = help_xml_helper.i18nStringAttribute (*it, QStringLiteral("title"), QString (), DL_INFO);
-					if (title.isEmpty ()) title = resolveLabel (id);
-					writeHTML ("<h3>" + title + "</h3>");
+		element = help_xml_helper.getChildElement(help_doc_element, QStringLiteral("settings"), DL_INFO);
+		if (!element.isNull()) {
+			writeHTML(startSection(QStringLiteral("settings"), i18n("GUI settings"), QString(), &anchors, &anchornames));
+			XMLChildList setting_elements = help_xml_helper.getChildElements(element, QString(), DL_WARNING);
+			for (XMLChildList::iterator it = setting_elements.begin(); it != setting_elements.end(); ++it) {
+				if ((*it).tagName() == QLatin1String("setting")) {
+					QString id = help_xml_helper.getStringAttribute(*it, QStringLiteral("id"), QString(), DL_WARNING);
+					QString title = help_xml_helper.i18nStringAttribute(*it, QStringLiteral("title"), QString(), DL_INFO);
+					if (title.isEmpty()) title = resolveLabel(id);
+					writeHTML(u"<h4>"_s + title + u"</h4>"_s);
+					writeHTML(renderHelpFragment(*it));
+				} else if ((*it).tagName() == QLatin1String("caption")) {
+					QString id = help_xml_helper.getStringAttribute(*it, QStringLiteral("id"), QString(), DL_WARNING);
+					QString title = help_xml_helper.i18nStringAttribute(*it, QStringLiteral("title"), QString(), DL_INFO);
+					if (title.isEmpty()) title = resolveLabel(id);
+					writeHTML(u"<h3>"_s + title + u"</h3>"_s);
 				} else {
-					help_xml_helper.displayError (&(*it), QStringLiteral("Tag not allowed, here"), DL_WARNING);
+					help_xml_helper.displayError(&(*it), QStringLiteral("Tag not allowed, here"), DL_WARNING);
 				}
 			}
 			writeHTML(endSection());
@@ -1134,27 +1142,27 @@ bool RKHelpRenderer::renderRKHelp (const QUrl &url, RKHTMLWindow* container) {
 	}
 
 	// "related" section
-	element = help_xml_helper.getChildElement (help_doc_element, QStringLiteral("related"), DL_INFO);
-	if (!element.isNull ()) {
-		writeHTML (startSection (QStringLiteral("related"), i18n ("Related functions and pages"), QString (), &anchors, &anchornames));
-		writeHTML (renderHelpFragment (element));
+	element = help_xml_helper.getChildElement(help_doc_element, QStringLiteral("related"), DL_INFO);
+	if (!element.isNull()) {
+		writeHTML(startSection(QStringLiteral("related"), i18n("Related functions and pages"), QString(), &anchors, &anchornames));
+		writeHTML(renderHelpFragment(element));
 		writeHTML(endSection());
 	}
 
 	// "technical" section
-	element = help_xml_helper.getChildElement (help_doc_element, QStringLiteral("technical"), DL_INFO);
-	if (!element.isNull ()) {
-		writeHTML (startSection (QStringLiteral("technical"), i18n ("Technical details"), QString (), &anchors, &anchornames));
-		writeHTML (renderHelpFragment (element));
+	element = help_xml_helper.getChildElement(help_doc_element, QStringLiteral("technical"), DL_INFO);
+	if (!element.isNull()) {
+		writeHTML(startSection(QStringLiteral("technical"), i18n("Technical details"), QString(), &anchors, &anchornames));
+		writeHTML(renderHelpFragment(element));
 		writeHTML(endSection());
 	}
 
 	if (for_component) {
 		// "dependencies" section
-		QList<RKComponentDependency> deps = chandle->getDependencies ();
-		if (!deps.isEmpty ()) {
-			writeHTML (startSection (QStringLiteral("dependencies"), i18n ("Dependencies"), QString (), &anchors, &anchornames));
-			writeHTML (RKComponentDependency::depsToHtml (deps));
+		QList<RKComponentDependency> deps = chandle->getDependencies();
+		if (!deps.isEmpty()) {
+			writeHTML(startSection(QStringLiteral("dependencies"), i18n("Dependencies"), QString(), &anchors, &anchornames));
+			writeHTML(RKComponentDependency::depsToHtml(deps));
 			writeHTML(endSection());
 		}
 	}
@@ -1162,30 +1170,30 @@ bool RKHelpRenderer::renderRKHelp (const QUrl &url, RKHTMLWindow* container) {
 	// "about" section
 	RKComponentAboutData about;
 	if (for_component) {
-		about = chandle->getAboutData ();
+		about = chandle->getAboutData();
 	} else {
-		about = RKComponentAboutData (help_xml_helper.getChildElement (help_doc_element, QStringLiteral("about"), DL_INFO), *help_xml);
+		about = RKComponentAboutData(help_xml_helper.getChildElement(help_doc_element, QStringLiteral("about"), DL_INFO), *help_xml);
 	}
 	if (about.valid) {
-		writeHTML (startSection (QStringLiteral("about"), i18n ("About"), QString (), &anchors, &anchornames));
-		writeHTML (about.toHtml ());
+		writeHTML(startSection(QStringLiteral("about"), i18n("About"), QString(), &anchors, &anchornames));
+		writeHTML(about.toHtml());
 		writeHTML(endSection());
 	}
 
 	// create a navigation bar
 	QUrl url_copy = url;
-	QString navigation = i18n ("<h1>On this page:</h1>");
-	RK_ASSERT (anchornames.size () == anchors.size ());
-	for (int i = 0; i < anchors.size (); ++i) {
+	QString navigation = i18n("<h1>On this page:</h1>");
+	RK_ASSERT(anchornames.size() == anchors.size());
+	for (int i = 0; i < anchors.size(); ++i) {
 		QString anchor = anchors[i];
 		QString anchorname = anchornames[i];
-		if (!(anchor.isEmpty () || anchorname.isEmpty ())) {
-			url_copy.setFragment (anchor);
-			navigation.append ("<p><a href=\"" + url_copy.url () + "\">" + anchorname + "</a></p>\n");
+		if (!(anchor.isEmpty() || anchorname.isEmpty())) {
+			url_copy.setFragment(anchor);
+			navigation.append(u"<p><a href=\""_s + url_copy.url() + u"\">"_s + anchorname + u"</a></p>\n"_s);
 		}
 	}
-	writeHTML ("</div><div id=\"navigation\">" + navigation + "</div>");
-	writeHTML (QStringLiteral("</body></html>\n"));
+	writeHTML(u"</div><div id=\"navigation\">"_s + navigation + u"</div>"_s);
+	writeHTML(u"</body></html>\n"_s);
 
 	return (true);
 }
@@ -1222,7 +1230,7 @@ QString RKHelpRenderer::renderHelpFragment (QDomElement &fragment) {
 		}
 		QString linktext;
 		int end = text.indexOf (QLatin1String(">"), npos) + 1;
-		if (text[end-2] != QChar ('/')) {
+		if (text[end-2] != u'/') {
 			int nend = text.indexOf (QLatin1String("</link>"), end);
 			linktext = text.mid (end, nend - end);
 			end = nend + 7;
@@ -1257,50 +1265,51 @@ QString RKHelpRenderer::renderHelpFragment (QDomElement &fragment) {
 	return ret;
 }
 
-QString RKHelpRenderer::prepareHelpLink (const QString &href, const QString &text) {
-	RK_TRACE (APP);
+QString RKHelpRenderer::prepareHelpLink(const QString &href, const QString &text) {
+	RK_TRACE(APP);
 
-	QString ret = "<a href=\"" + href + "\">";
-	if (!text.isEmpty ()) {
+	QString ret = u"<a href=\""_s + href + u"\">"_s;
+	if (!text.isEmpty()) {
 		ret += text;
 	} else {
 		QString ltext;
-		QUrl url (href);
+		QUrl url(href);
 		if (isRKWardUrl(url)) {
-			if (url.host () == QLatin1String("component")) {
-				RKComponentHandle *chandle = componentPathToHandle (url.path ());
-				if (chandle) ltext = chandle->getLabel ();
-			} else if (url.host () == QLatin1String("rhelp")) {
-				ltext = i18n ("R Reference on '%1'", url.path ().mid (1));
-			} else if (url.host () == QLatin1String("page")) {
-				QString help_base_dir = RKCommonFunctions::getRKWardDataDir () + "pages/";
-		
-				XMLHelper xml (help_base_dir + url.path () + ".rkh", RKMessageCatalog::getCatalog (QStringLiteral("rkward__pages"), RKCommonFunctions::getRKWardDataDir () + "po/"));
-				QDomElement doc_element = xml.openXMLFile (DL_WARNING);
-				QDomElement title_element = xml.getChildElement (doc_element, QStringLiteral("title"), DL_WARNING);
-				ltext = xml.i18nElementText (title_element, false, DL_WARNING);
+			if (url.host() == QLatin1String("component")) {
+				RKComponentHandle *chandle = componentPathToHandle(url.path());
+				if (chandle) ltext = chandle->getLabel();
+			} else if (url.host() == QLatin1String("rhelp")) {
+				ltext = i18n("R Reference on '%1'", url.path().mid(1));
+			} else if (url.host() == QLatin1String("page")) {
+				QString help_base_dir = RKCommonFunctions::getRKWardDataDir() + u"pages/"_s;
+
+				XMLHelper xml(help_base_dir + url.path() + u".rkh"_s,
+				              RKMessageCatalog::getCatalog(QStringLiteral("rkward__pages"), RKCommonFunctions::getRKWardDataDir() + u"po/"_s));
+				QDomElement doc_element = xml.openXMLFile(DL_WARNING);
+				QDomElement title_element = xml.getChildElement(doc_element, QStringLiteral("title"), DL_WARNING);
+				ltext = xml.i18nElementText(title_element, false, DL_WARNING);
 			}
 
-			if (ltext.isEmpty ()) {
-				ltext = i18n ("BROKEN REFERENCE");
-				RK_DEBUG (APP, DL_WARNING, "Broken reference to %s", url.path ().toLatin1 ().data ());
+			if (ltext.isEmpty()) {
+				ltext = i18n("BROKEN REFERENCE");
+				RK_DEBUG(APP, DL_WARNING, "Broken reference to %s", url.path().toLatin1().data());
 			}
 		}
-		ret.append (ltext);
+		ret.append(ltext);
 	}
-	return (ret + "</a>");
+	return (ret + u"</a>"_s);
 }
 
-QString RKHelpRenderer::componentPathToId (const QString &path) {
-	RK_TRACE (APP);
+QString RKHelpRenderer::componentPathToId(const QString &path) {
+	RK_TRACE(APP);
 
-	QStringList path_segments = path.split ('/', Qt::SkipEmptyParts);
-	if (path_segments.count () > 2) return QString();
-	if (path_segments.count () < 1) return QString();
-	if (path_segments.count () == 1) path_segments.push_front (QStringLiteral("rkward"));
-	RK_ASSERT (path_segments.count () == 2);
+	QStringList path_segments = path.split(u'/', Qt::SkipEmptyParts);
+	if (path_segments.count() > 2) return QString();
+	if (path_segments.count() < 1) return QString();
+	if (path_segments.count() == 1) path_segments.push_front(QStringLiteral("rkward"));
+	RK_ASSERT(path_segments.count() == 2);
 
-	return (path_segments.join (QStringLiteral("::")));
+	return (path_segments.join(QStringLiteral("::")));
 }
 
 RKComponentHandle *RKHelpRenderer::componentPathToHandle (const QString &path) {
@@ -1309,17 +1318,17 @@ RKComponentHandle *RKHelpRenderer::componentPathToHandle (const QString &path) {
 	return (RKComponentMap::getComponentHandle (componentPathToId (path)));
 }
 
-QString RKHelpRenderer::startSection (const QString &name, const QString &title, const QString &shorttitle, QStringList *anchors, QStringList *anchor_names) {
-	QString ret = "<div id=\"" + name + "\"><a name=\"" + name + "\">";
-	ret.append ("<h2>" + title + "</h2>\n");
-	anchors->append (name);
-	if (!shorttitle.isNull ()) anchor_names->append (shorttitle);
-	else anchor_names->append (title);
+QString RKHelpRenderer::startSection(const QString &name, const QString &title, const QString &shorttitle, QStringList *anchors, QStringList *anchor_names) {
+	QString ret = u"<div id=\""_s + name + u"\"><a name=\""_s + name + u"\">"_s;
+	ret.append(u"<h2>"_s + title + u"</h2>\n"_s);
+	anchors->append(name);
+	if (!shorttitle.isNull()) anchor_names->append(shorttitle);
+	else anchor_names->append(title);
 	return (ret);
 }
 
 QString RKHelpRenderer::endSection() {
-	return("</div>\n");
+	return(u"</div>\n"_s);
 }
 
 void RKHelpRenderer::writeHTML (const QString& string) {
diff --git a/rkward/windows/rktexthints.cpp b/rkward/windows/rktexthints.cpp
index 3c4f8205d..1ab49989d 100644
--- a/rkward/windows/rktexthints.cpp
+++ b/rkward/windows/rktexthints.cpp
@@ -27,7 +27,7 @@ RKTextHints::~RKTextHints() {
 QString RKTextHints::textHint(KTextEditor::View *view, const KTextEditor::Cursor &position) {
 	if (!settings->isEnabled(RKCodeCompletionSettings::MouseOver)) return QString();
 	RK_TRACE(COMMANDEDITOR);
-	QString line = view->document()->line(position.line()) + ' ';
+	QString line = view->document()->line(position.line()) + u' ';
 	QString symbol = RKCommonFunctions::getCurrentSymbol(line, position.column(), false);
 	auto obj = RObjectList::getObjectList()->findObject(symbol);
 	if (obj) {
diff --git a/rkward/windows/rktoplevelwindowgui.cpp b/rkward/windows/rktoplevelwindowgui.cpp
index d52d0fa4a..2f14705e6 100644
--- a/rkward/windows/rktoplevelwindowgui.cpp
+++ b/rkward/windows/rktoplevelwindowgui.cpp
@@ -72,11 +72,11 @@ RKTopLevelWindowGUI::RKTopLevelWindowGUI(KXmlGuiWindow *for_window) : QObject(fo
 	// NOTE: enabling / disabling the prev/next actions is not a good idea. It will cause the script windows to "accept" their shortcuts, when disabled
 	prev_action = actionCollection()->addAction(QStringLiteral("prev_window"), this, &RKTopLevelWindowGUI::previousWindow);
 	prev_action->setText(i18n("Previous Window"));
-	prev_action->setIcon(QIcon(":/rkward/icons/window_back.png"));
+	prev_action->setIcon(QIcon(u":/rkward/icons/window_back.png"_s));
 	actionCollection ()->setDefaultShortcut (prev_action, Qt::ControlModifier | Qt::Key_Tab);
 	next_action = actionCollection()->addAction(QStringLiteral("next_window"), this, &RKTopLevelWindowGUI::nextWindow);
 	next_action->setText(i18n("Next Window"));
-	next_action->setIcon(QIcon(":rkward/icons/window_forward.png"));
+	next_action->setIcon(QIcon(u":rkward/icons/window_forward.png"_s));
 	actionCollection ()->setDefaultShortcut (next_action, Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Tab);
 
 	QAction* action = actionCollection()->addAction(QStringLiteral("window_activate_docview"), this, &RKTopLevelWindowGUI::activateDocumentView);
@@ -252,7 +252,7 @@ void RKTopLevelWindowGUI::populateOutputWindowsMenu() {
 		auto dir = outputs[i];
 		QString title = dir->caption();
 		if (dir->isActive()) {
-			title.append(' ');
+			title.append(u' ');
 			title.append(i18n("[Active]"));
 		}
 		QAction* action = output_windows_menu->addAction(title);
diff --git a/rkward/windows/rkwindowcatcher.cpp b/rkward/windows/rkwindowcatcher.cpp
index da6e6f39a..acbffe895 100644
--- a/rkward/windows/rkwindowcatcher.cpp
+++ b/rkward/windows/rkwindowcatcher.cpp
@@ -393,7 +393,7 @@ void RKCaughtX11Window::commonClose(bool in_destructor) {
 
 	QString status = i18n("Closing device (saving history)");
 	if (!(close_attempted || killed_in_r)) {
-		RCommand* c = new RCommand("dev.off (" + QString::number(device_number) + ')', RCommand::App, i18n("Shutting down device number %1", device_number));
+		RCommand* c = new RCommand(u"dev.off ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Shutting down device number %1", device_number));
 		if (!in_destructor) setStatusMessage(status, c);
 		RInterface::issueCommand(c);
 		close_attempted = true;
@@ -578,131 +578,147 @@ static void issueCommand(RCommand* command, RKProgressControl* control) {
 	RInterface::issueCommand(command);
 }
 
-void RKCaughtX11Window::activateDevice () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::activateDevice() {
+	RK_TRACE(MISC);
 
-	issueCommand(new RCommand("dev.set (" + QString::number(device_number) + ')', RCommand::App, i18n("Activate graphics device number %1", device_number)), error_dialog);
+	issueCommand(new RCommand(u"dev.set ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Activate graphics device number %1", device_number)),
+	             error_dialog);
 }
 
-void RKCaughtX11Window::copyDeviceToOutput () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::copyDeviceToOutput() {
+	RK_TRACE(MISC);
 
-	issueCommand(new RCommand("dev.set (" + QString::number(device_number) + ")\ndev.copy (device=rk.graph.on)\nrk.graph.off ()", RCommand::App | RCommand::CCOutput, i18n("Copy contents of graphics device number %1 to output", device_number)), error_dialog);
+	issueCommand(new RCommand(u"dev.set ("_s + QString::number(device_number) + u")\ndev.copy (device=rk.graph.on)\nrk.graph.off ()"_s,
+	                          RCommand::App | RCommand::CCOutput, i18n("Copy contents of graphics device number %1 to output", device_number)),
+	             error_dialog);
 }
 
-void RKCaughtX11Window::printDevice () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::printDevice() {
+	RK_TRACE(MISC);
 
 	QString printer_device;
-	if (RKSettingsModuleGraphics::kdePrintingEnabled ()) printer_device = QLatin1String("rk.printer.device");
-	issueCommand(new RCommand("dev.set (" + QString::number(device_number) + ")\ndev.print (" + printer_device + ')', RCommand::App, i18n("Print contents of graphics device number %1", device_number)), error_dialog);
+	if (RKSettingsModuleGraphics::kdePrintingEnabled()) printer_device = u"rk.printer.device"_s;
+	issueCommand(new RCommand(u"dev.set ("_s + QString::number(device_number) + u")\ndev.print ("_s + printer_device + u')', RCommand::App,
+	                          i18n("Print contents of graphics device number %1", device_number)),
+	             error_dialog);
 }
 
-void RKCaughtX11Window::copyDeviceToRObject () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::copyDeviceToRObject() {
+	RK_TRACE(MISC);
 
-// TODO: not very pretty, yet
-	QDialog *dialog = new QDialog (this);
-	dialog->setWindowTitle (i18n ("Specify R object"));
-	dialog->setModal (true);
-	QVBoxLayout *layout = new QVBoxLayout (dialog);
+	// TODO: not very pretty, yet
+	QDialog *dialog = new QDialog(this);
+	dialog->setWindowTitle(i18n("Specify R object"));
+	dialog->setModal(true);
+	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, QStringLiteral("my.plot"));
-	layout->addWidget (chooser);
+	layout->addWidget(new QLabel(i18n("Specify the R object name, you want to save the graph to"), dialog));
+	RKSaveObjectChooser *chooser = new RKSaveObjectChooser(dialog, QStringLiteral("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);
+	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);
 
-	connect (chooser, &RKSaveObjectChooser::changed, box->button (QDialogButtonBox::Ok), &QPushButton::setEnabled);
-	if (!chooser->isOk ()) box->button (QDialogButtonBox::Ok)->setEnabled (false);
+	connect(chooser, &RKSaveObjectChooser::changed, box->button(QDialogButtonBox::Ok), &QPushButton::setEnabled);
+	if (!chooser->isOk()) box->button(QDialogButtonBox::Ok)->setEnabled(false);
 
-	dialog->exec ();
+	dialog->exec();
 
-	if (dialog->result () == QDialog::Accepted) {
-		RK_ASSERT (chooser->isOk ());
+	if (dialog->result() == QDialog::Accepted) {
+		RK_ASSERT(chooser->isOk());
 
-		QString name = chooser->currentFullName ();
+		QString name = chooser->currentFullName();
 
-		issueCommand(new RCommand("dev.set (" + QString::number(device_number) + ")\n" + name + " <- recordPlot ()", RCommand::App | RCommand::ObjectListUpdate, i18n("Save contents of graphics device number %1 to object '%2'", device_number, name)), error_dialog);
+		issueCommand(new RCommand(u"dev.set ("_s + QString::number(device_number) + u")\n"_s + name + u" <- recordPlot ()"_s, RCommand::App | RCommand::ObjectListUpdate,
+		                          i18n("Save contents of graphics device number %1 to object '%2'", device_number, name)),
+		             error_dialog);
 	}
 
 	delete dialog;
 }
 
-void RKCaughtX11Window::duplicateDevice () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::duplicateDevice() {
+	RK_TRACE(MISC);
 
-	issueCommand(new RCommand("rk.duplicate.device (" + QString::number(device_number) + ')', RCommand::App, i18n("Duplicate graphics device number %1", device_number)), error_dialog);
+	issueCommand(
+	    new RCommand(u"rk.duplicate.device ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Duplicate graphics device number %1", device_number)),
+	    error_dialog);
 }
 
-void RKCaughtX11Window::nextPlot () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::nextPlot() {
+	RK_TRACE(MISC);
 
-	RCommand* c = new RCommand("rk.next.plot (" + QString::number(device_number) + ')', RCommand::App, i18n("Load next plot in device number %1", device_number));
-	setStatusMessage (i18n ("Loading plot from history"), c);
+	auto c = new RCommand(u"rk.next.plot ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Load next plot in device number %1", device_number));
+	setStatusMessage(i18n("Loading plot from history"), c);
 	issueCommand(c, error_dialog);
 }
 
-void RKCaughtX11Window::previousPlot () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::previousPlot() {
+	RK_TRACE(MISC);
 
-	RCommand* c = new RCommand("rk.previous.plot (" + QString::number(device_number) + ')', RCommand::App, i18n("Load previous plot in device number %1", device_number));
-	setStatusMessage (i18n ("Loading plot from history"), c);
+	auto c = new RCommand(u"rk.previous.plot ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Load previous plot in device number %1", device_number));
+	setStatusMessage(i18n("Loading plot from history"), c);
 	issueCommand(c, error_dialog);
 }
 
-void RKCaughtX11Window::firstPlot () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::firstPlot() {
+	RK_TRACE(MISC);
 
-	RCommand* c = new RCommand("rk.first.plot (" + QString::number(device_number) + ')', RCommand::App, i18n("Load first plot in device number %1", device_number));
-	setStatusMessage (i18n ("Loading plot from history"), c);
+	auto c = new RCommand(u"rk.first.plot ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Load first plot in device number %1", device_number));
+	setStatusMessage(i18n("Loading plot from history"), c);
 	issueCommand(c, error_dialog);
 }
 
-void RKCaughtX11Window::lastPlot () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::lastPlot() {
+	RK_TRACE(MISC);
 
-	RCommand* c = new RCommand("rk.last.plot (" + QString::number(device_number) + ')', RCommand::App, i18n("Load last plot in device number %1", device_number));
-	setStatusMessage (i18n ("Loading plot from history"), c);
+	auto c = new RCommand(u"rk.last.plot ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Load last plot in device number %1", device_number));
+	setStatusMessage(i18n("Loading plot from history"), c);
 	issueCommand(c, error_dialog);
 }
 
-void RKCaughtX11Window::gotoPlot (int index) {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::gotoPlot(int index) {
+	RK_TRACE(MISC);
 
-	RCommand* c = new RCommand("rk.goto.plot (" + QString::number(device_number) + ", " + QString::number(index+1) + ')', RCommand::App, i18n("Load plot %1 in device number %2", index, device_number));
-	setStatusMessage (i18n ("Loading plot from history"), c);
+	RCommand* c = new RCommand(u"rk.goto.plot ("_s + QString::number(device_number) + u", "_s + QString::number(index + 1) + u')', RCommand::App,
+	                           i18n("Load plot %1 in device number %2", index, device_number));
+	setStatusMessage(i18n("Loading plot from history"), c);
 	issueCommand(c, error_dialog);
 }
 
-void RKCaughtX11Window::forceAppendCurrentPlot () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::forceAppendCurrentPlot() {
+	RK_TRACE(MISC);
 
-	issueCommand(new RCommand("rk.force.append.plot (" + QString::number(device_number) + ')', RCommand::App, i18n("Append this plot to history (device number %1)", device_number)), error_dialog);
+	issueCommand(new RCommand(u"rk.force.append.plot ("_s + QString::number(device_number) + u')', RCommand::App,
+	                          i18n("Append this plot to history (device number %1)", device_number)),
+	             error_dialog);
 }
 
-void RKCaughtX11Window::removeCurrentPlot () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::removeCurrentPlot() {
+	RK_TRACE(MISC);
 
-	issueCommand(new RCommand("rk.removethis.plot (" + QString::number(device_number) + ')', RCommand::App, i18n("Remove current plot from history (device number %1)", device_number)), error_dialog);
+	issueCommand(new RCommand(u"rk.removethis.plot ("_s + QString::number(device_number) + u')', RCommand::App,
+	                          i18n("Remove current plot from history (device number %1)", device_number)),
+	             error_dialog);
 }
 
-void RKCaughtX11Window::clearHistory () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::clearHistory() {
+	RK_TRACE(MISC);
 
-	if (KMessageBox::warningContinueCancel (this, i18n ("This will clear the plot history for all device windows, not just this one. If this is not your intent, press cancel, below.")) != KMessageBox::Continue) return;
+	if (KMessageBox::warningContinueCancel(this, i18n("This will clear the plot history for all device windows, not just this one. If this is not your intent, press cancel, below.")) != KMessageBox::Continue) return;
 
 	issueCommand(new RCommand(QStringLiteral("rk.clear.plot.history ()"), RCommand::App, i18n("Clear plot history")), error_dialog);
 }
 
-void RKCaughtX11Window::showPlotInfo () {
-	RK_TRACE (MISC);
+void RKCaughtX11Window::showPlotInfo() {
+	RK_TRACE(MISC);
 
-	issueCommand(new RCommand("rk.show.plot.info (" + QString::number(device_number) + ')', RCommand::App, i18n("Plot properties (device number %1)", device_number)), error_dialog);
+	issueCommand(
+	    new RCommand(u"rk.show.plot.info ("_s + QString::number(device_number) + u')', RCommand::App, i18n("Plot properties (device number %1)", device_number)),
+	    error_dialog);
 }
 
 void RKCaughtX11Window::updateHistoryActions (int history_length, int position, const QStringList &labels) {
diff --git a/rkward/windows/rkworkplace.cpp b/rkward/windows/rkworkplace.cpp
index a5a72f399..6e7f3c4b8 100644
--- a/rkward/windows/rkworkplace.cpp
+++ b/rkward/windows/rkworkplace.cpp
@@ -136,11 +136,11 @@ void RKWorkplace::addMessageWidget (KMessageWidget* message) {
 	topLevelWidget ()->raise ();
 }
 
-QString workspaceConfigFileName (const QUrl &url) {
-	QString base_name = QString (QCryptographicHash::hash (url.toDisplayString ().toUtf8 (), QCryptographicHash::Md5).toHex());
-	QDir dir (QStandardPaths::writableLocation (QStandardPaths::GenericDataLocation));
-	dir.mkpath (QStringLiteral("rkward"));
-	return (dir.absoluteFilePath ("rkward/workspace_config_" + base_name));
+QString workspaceConfigFileName(const QUrl &url) {
+	QString base_name = QString::fromLatin1(QCryptographicHash::hash(url.toDisplayString().toUtf8(), QCryptographicHash::Md5).toHex());
+	QDir dir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
+	dir.mkpath(QStringLiteral("rkward"));
+	return (dir.absoluteFilePath(u"rkward/workspace_config_"_s + base_name));
 }
 
 KConfigBase *RKWorkplace::workspaceConfig () {
@@ -400,7 +400,7 @@ void RKWorkplace::namedWindowOwnerDestroyed (QObject* owner) {
 
 void RKWorkplace::openRKWardUrl(const QUrl &url) {
 	RK_TRACE(APP);
-	RK_ASSERT(url.scheme() == "rkward");
+	RK_ASSERT(url.scheme() == QLatin1String("rkward"));
 	RKHTMLWindow::handleRKWardURL(url);
 }
 
@@ -821,44 +821,45 @@ QUrl checkAdjustRestoredUrl (const QString &_url, const QString &old_base) {
 	return (url);
 }
 
-QString RKWorkplace::makeItemDescription (RKMDIWindow *win) const {
+QString RKWorkplace::makeItemDescription(RKMDIWindow *win) const {
 	QString type, specification;
 	QStringList params;
-	if (win->isType (RKMDIWindow::DataEditorWindow)) {
-		type = QLatin1String("data");
-		specification = static_cast<RKEditor*> (win)->getObject ()->getFullName ();
-	} else if (win->isType (RKMDIWindow::CommandEditorWindow)) {
-		type = QLatin1String("script");
-		specification = static_cast<RKCommandEditorWindow*> (win)->url ().url ();
-		if (specification.isEmpty ()) specification = static_cast<RKCommandEditorWindow*> (win)->id ();
-	} else if (win->isType (RKMDIWindow::OutputWindow)) {
+	if (win->isType(RKMDIWindow::DataEditorWindow)) {
+		type = u"data"_s;
+		specification = static_cast<RKEditor *>(win)->getObject()->getFullName();
+	} else if (win->isType(RKMDIWindow::CommandEditorWindow)) {
+		type = u"script"_s;
+		specification = static_cast<RKCommandEditorWindow *>(win)->url().url();
+		if (specification.isEmpty()) specification = static_cast<RKCommandEditorWindow *>(win)->id();
+	} else if (win->isType(RKMDIWindow::OutputWindow)) {
 		RKOutputDirectory *dir = RKOutputDirectory::findOutputByWindow(win);
 		if (dir) {
-			type = QLatin1String("rkoutput");
+			type = u"rkoutput"_s;
 			specification = QUrl::fromLocalFile(dir->filename()).url();
 			if (dir->isActive()) type.append(QStringLiteral(".active"));
 		} else {
 			// legacy support for rk.set.html.output.file()
-			type = QLatin1String("output");
-			specification = static_cast<RKHTMLWindow*> (win)->url ().url ();
+			type = u"output"_s;
+			specification = static_cast<RKHTMLWindow *>(win)->url().url();
 		}
-	} else if (win->isType (RKMDIWindow::HelpWindow)) {
-		type = QLatin1String("help");
-		specification = static_cast<RKHTMLWindow*> (win)->restorableUrl ().url ();
+	} else if (win->isType(RKMDIWindow::HelpWindow)) {
+		type = u"help"_s;
+		specification = static_cast<RKHTMLWindow *>(win)->restorableUrl().url();
 	} else if (win->isType(RKMDIWindow::PDFWindow)) {
-		type = QLatin1String("pdf");
-		specification = static_cast<RKPDFWindow*>(win)->url().url();
-	} else if (win->isToolWindow ()) {
-		type = RKToolWindowList::idOfWindow (win);
-	} else if (win->isType (RKMDIWindow::ObjectWindow)) {
-		type = QLatin1String("object");
-		specification = static_cast<RObjectViewer*> (win)->object ()->getFullName ();
+		type = u"pdf"_s;
+		specification = static_cast<RKPDFWindow *>(win)->url().url();
+	} else if (win->isToolWindow()) {
+		type = RKToolWindowList::idOfWindow(win);
+	} else if (win->isType(RKMDIWindow::ObjectWindow)) {
+		type = u"object"_s;
+		specification = static_cast<RObjectViewer *>(win)->object()->getFullName();
 	}
-	if (!type.isEmpty ()) {
-		if (!win->isAttached ()) {
-			params.append (QStringLiteral ("detached,") + QString::number (win->x ()) + ',' + QString::number (win->y ()) + ',' + QString::number (win->width ()) + ',' + QString::number (win->height ()));
+	if (!type.isEmpty()) {
+		if (!win->isAttached()) {
+			params.append(QStringLiteral("detached,") + QString::number(win->x()) + u',' + QString::number(win->y()) + u',' + QString::number(win->width()) +
+			              u',' + QString::number(win->height()));
 		}
-		if (win->isToolWindow ()) {
+		if (win->isToolWindow()) {
 			int sidebar = RKToolWindowList::Nowhere;
 			for (int i = 0; i < TOOL_WINDOW_BAR_COUNT; ++i) {
 				if (win->tool_window_bar == tool_window_bars[i]) {
@@ -866,12 +867,12 @@ QString RKWorkplace::makeItemDescription (RKMDIWindow *win) const {
 					break;
 				}
 			}
-			params.append (QStringLiteral ("sidebar,") + QString::number (sidebar));
+			params.append(QStringLiteral("sidebar,") + QString::number(sidebar));
 		}
-		return (type + "::" + params.join (QStringLiteral(":")) + "::" + specification);
+		return (type + u"::"_s + params.join(QStringLiteral(":")) + u"::"_s + specification);
 	}
 
-	return QString ();
+	return QString();
 }
 
 struct ItemSpecification {
@@ -880,27 +881,27 @@ struct ItemSpecification {
 	QStringList params;
 };
 
-ItemSpecification parseItemDescription (const QString &description) {
+ItemSpecification parseItemDescription(const QString &description) {
 	ItemSpecification ret;
 
 	// Item format for rkward <= 0.5.4: "type:specification"
 	// Item format for rkward <= 0.5.5: "type::[optional_params1[:optional_params2[:...]]]::specification"
-	int typeend = description.indexOf (':');
-	if ((typeend < 0) || (typeend >= (description.size () - 1))) {
-		RK_ASSERT (false);
+	int typeend = description.indexOf(u':');
+	if ((typeend < 0) || (typeend >= (description.size() - 1))) {
+		RK_ASSERT(false);
 		return ret;
 	}
-	ret.type = description.left (typeend);
-	if (description.at (typeend + 1) == ':') {	// rkward 0.5.5 or later
-		int specstart = description.indexOf (QLatin1String("::"), typeend + 2);
+	ret.type = description.left(typeend);
+	if (description.at(typeend + 1) == u':') {  // rkward 0.5.5 or later
+		int specstart = description.indexOf(QLatin1String("::"), typeend + 2);
 		if (specstart < typeend) {
-			RK_ASSERT (false);
+			RK_ASSERT(false);
 			return ret;
 		}
-		ret.params = description.mid (typeend + 2, specstart - typeend - 2).split (':', Qt::SkipEmptyParts);
-		ret.specification = description.mid (specstart + 2);
+		ret.params = description.mid(typeend + 2, specstart - typeend - 2).split(u':', Qt::SkipEmptyParts);
+		ret.specification = description.mid(specstart + 2);
 	} else {
-		ret.specification = description.mid (typeend + 1);
+		ret.specification = description.mid(typeend + 1);
 	}
 
 	return ret;
@@ -941,29 +942,29 @@ bool RKWorkplace::restoreDocumentWindow (const QString &description, const QStri
 	return (restoreDocumentWindowInternal(this, parseItemDescription(description), base) != nullptr);
 }
 
-QStringList RKWorkplace::makeWorkplaceDescription () {
-	RK_TRACE (APP);
+QStringList RKWorkplace::makeWorkplaceDescription() {
+	RK_TRACE(APP);
 
 	QStringList workplace_description;
 
 	// first, save the base directory of the workplace. This allows us to cope better with moved workspaces while restoring.
-	QUrl base_url = workspaceURL ().adjusted (QUrl::RemoveFilename);
-	if (base_url.isLocalFile () && !base_url.isEmpty ()) workplace_description.append ("base::::" + base_url.url ());
+	QUrl base_url = workspaceURL().adjusted(QUrl::RemoveFilename);
+	if (base_url.isLocalFile() && !base_url.isEmpty()) workplace_description.append(u"base::::"_s + base_url.url());
 
 	// window order in the workplace view may have changed with respect to our list. Thus we first generate a properly sorted list
-	const RKWorkplaceObjectList list = getObjectList (RKMDIWindow::DocumentWindow, RKMDIWindow::Detached);
+	const RKWorkplaceObjectList list = getObjectList(RKMDIWindow::DocumentWindow, RKMDIWindow::Detached);
 	for (RKMDIWindow *win : list) {
-		QString desc = makeItemDescription (win);
-		if (!desc.isEmpty ()) workplace_description.append (desc);
+		QString desc = makeItemDescription(win);
+		if (!desc.isEmpty()) workplace_description.append(desc);
 	}
 
-	workplace_description.append (QStringLiteral ("layout::::") + wview->listLayout ());
-	workplace_description.append (wview->listContents ());
+	workplace_description.append(QStringLiteral("layout::::") + wview->listLayout());
+	workplace_description.append(wview->listContents());
 
-	const auto objectList = getObjectList (RKMDIWindow::ToolWindow, RKMDIWindow::AnyWindowState);
+	const auto objectList = getObjectList(RKMDIWindow::ToolWindow, RKMDIWindow::AnyWindowState);
 	for (RKMDIWindow *win : objectList) {
-		QString desc = makeItemDescription (win);
-		if (!desc.isEmpty ()) workplace_description.append (desc);
+		QString desc = makeItemDescription(win);
+		if (!desc.isEmpty()) workplace_description.append(desc);
 	}
 	return workplace_description;
 }
@@ -976,58 +977,58 @@ void RKWorkplace::saveWorkplace(const QUrl& for_url, RCommandChain *chain) {
 
 	QString file_param;
 	if (!for_url.isEmpty()) file_param = QStringLiteral("file=") + RObject::rQuote(for_url.toLocalFile() + QStringLiteral(".rkworkplace")) + QStringLiteral(", ");
-	RInterface::issueCommand(new RCommand("rk.save.workplace(" + file_param + "description=" + RObject::rQuote(makeWorkplaceDescription().join(QStringLiteral("\n"))) + ')', RCommand::App, i18n("Save Workplace layout")), chain);
+	RInterface::issueCommand(new RCommand(u"rk.save.workplace("_s + file_param + u"description="_s + RObject::rQuote(makeWorkplaceDescription().join(u"\n"_s)) + u')', RCommand::App, i18n("Save Workplace layout")), chain);
 }
 
-void RKWorkplace::restoreWorkplace (RCommandChain *chain, bool merge) {
-	RK_TRACE (APP);
-	if (RKSettingsModuleGeneral::workplaceSaveMode () != RKSettingsModuleGeneral::SaveWorkplaceWithWorkspace) return;
+void RKWorkplace::restoreWorkplace(RCommandChain *chain, bool merge) {
+	RK_TRACE(APP);
+	if (RKSettingsModuleGeneral::workplaceSaveMode() != RKSettingsModuleGeneral::SaveWorkplaceWithWorkspace) return;
 
 	QString no_close_windows;
-	if (merge) no_close_windows = QLatin1String("close.windows = FALSE");
-	RInterface::issueCommand(new RCommand("rk.restore.workplace(" + no_close_windows + ')', RCommand::App, i18n ("Restore Workplace layout")), chain);
+	if (merge) no_close_windows = u"close.windows = FALSE"_s;
+	RInterface::issueCommand(new RCommand(u"rk.restore.workplace("_s + no_close_windows + u')', RCommand::App, i18n("Restore Workplace layout")), chain);
 }
 
-void RKWorkplace::restoreWorkplace (const QStringList &description) {
-	RK_TRACE (APP);
+void RKWorkplace::restoreWorkplace(const QStringList &description) {
+	RK_TRACE(APP);
 
-	RKWardMainWindow::getMain ()->lockGUIRebuild (true);
+	RKWardMainWindow::getMain()->lockGUIRebuild(true);
 	QString base;
-	for (int i = 0; i < description.size (); ++i) {
-		ItemSpecification spec = parseItemDescription (description[i]);
+	for (int i = 0; i < description.size(); ++i) {
+		ItemSpecification spec = parseItemDescription(description[i]);
 		RKMDIWindow *win = nullptr;
 		if (spec.type == QLatin1String("base")) {
-			RK_ASSERT (i == 0);
+			RK_ASSERT(i == 0);
 			base = spec.specification;
-		} else if (restoreDocumentWindowInternal (this, spec, base)) {
+		} else if (restoreDocumentWindowInternal(this, spec, base)) {
 			// it was restored. nothing else to do
 		} else if (spec.type == QLatin1String("layout")) {
-			view ()->restoreLayout (spec.specification);
+			view()->restoreLayout(spec.specification);
 		} else if (spec.type == QLatin1String("pane_end")) {
-			view ()->nextPane ();
+			view()->nextPane();
 		} else {
-			win = RKToolWindowList::findToolWindowById (spec.type);
-			RK_ASSERT (win);
+			win = RKToolWindowList::findToolWindowById(spec.type);
+			RK_ASSERT(win);
 		}
 
 		// apply generic window parameters
 		if (win) {
-			for (int p = 0; p < spec.params.size (); ++p) {
-				if (spec.params[p].startsWith (QLatin1String ("sidebar"))) {
-					int position = spec.params[p].section (',', 1).toInt ();
-					placeInToolWindowBar (win, position);
+			for (int p = 0; p < spec.params.size(); ++p) {
+				if (spec.params[p].startsWith(QLatin1String("sidebar"))) {
+					int position = spec.params[p].section(u',', 1).toInt();
+					placeInToolWindowBar(win, position);
 				}
-				if (spec.params[p].startsWith (QLatin1String ("detached"))) {
-					QStringList geom = spec.params[p].split (',');
-					win->hide ();
-					win->setGeometry (geom.value (1).toInt (), geom.value (2).toInt (), geom.value (3).toInt (), geom.value (4).toInt ());
-					detachWindow (win);
+				if (spec.params[p].startsWith(QLatin1String("detached"))) {
+					QStringList geom = spec.params[p].split(u',');
+					win->hide();
+					win->setGeometry(geom.value(1).toInt(), geom.value(2).toInt(), geom.value(3).toInt(), geom.value(4).toInt());
+					detachWindow(win);
 				}
 			}
 		}
 	}
-	view ()->purgeEmptyPanes ();
-	RKWardMainWindow::getMain ()->lockGUIRebuild (false);
+	view()->purgeEmptyPanes();
+	RKWardMainWindow::getMain()->lockGUIRebuild(false);
 }
 
 void RKWorkplace::splitAndAttachWindow (RKMDIWindow* source) {
diff --git a/rkward/windows/rkworkplaceview.cpp b/rkward/windows/rkworkplaceview.cpp
index cf012d016..c2eaefabf 100644
--- a/rkward/windows/rkworkplaceview.cpp
+++ b/rkward/windows/rkworkplaceview.cpp
@@ -495,77 +495,77 @@ void RKWorkplaceView::setCaption(const QString &caption) {
 }
 
 void RKWorkplaceView::restoreLayout(const QString& desc) {
-	RK_TRACE (APP);
+	RK_TRACE(APP);
 
-	bool old_updates_enabled = updatesEnabled ();
-	setUpdatesEnabled (false);
+	bool old_updates_enabled = updatesEnabled();
+	setUpdatesEnabled(false);
 
 	QList<RKMDIWindow*> windows_to_readd;
 	// It is probably not a good idea to restore the layout while merging workplaces, i.e. without closing existing windows, first.
 	// However, we'll do our best to cope... For this, we clear out all splitters, first.
-	for (int i = 0; i < panes.count (); ++i) {
-		while (panes[i]->count ()) {
-			RKMDIWindow *win = static_cast<RKMDIWindow*> (panes[i]->widget (0));
-			panes[i]->removeTab (0);
-			windows_to_readd.append (win);
+	for (int i = 0; i < panes.count(); ++i) {
+		while (panes[i]->count()) {
+			RKMDIWindow* win = static_cast<RKMDIWindow*>(panes[i]->widget(0));
+			panes[i]->removeTab(0);
+			windows_to_readd.append(win);
 			win->hide();
 			win->setParent(nullptr);
 		}
 	}
-	while (count ()) {
-		delete (widget (0));
+	while (count()) {
+		delete (widget(0));
 	}
-	panes.clear ();
+	panes.clear();
 
 	QList<QSplitter*> parents;
-	parents.append (this);
-	QStringList dl = desc.split ('-');
-	if (dl.value (0) == QStringLiteral ("col")) setOrientation (Qt::Vertical);
-	else setOrientation (Qt::Horizontal);
-
-	for (int i = 1; i < dl.size (); ++i) {
-		if (parents.isEmpty ()) {
-			RK_DEBUG (APP, DL_ERROR, "Bad specification while restoring workplace view layout");
+	parents.append(this);
+	QStringList dl = desc.split(u'-');
+	if (dl.value(0) == QStringLiteral("col")) setOrientation(Qt::Vertical);
+	else setOrientation(Qt::Horizontal);
+
+	for (int i = 1; i < dl.size(); ++i) {
+		if (parents.isEmpty()) {
+			RK_DEBUG(APP, DL_ERROR, "Bad specification while restoring workplace view layout");
 			break;
 		}
-		if (dl[i] == QStringLiteral ("p")) {
-			RKWorkplaceViewPane *pane = createPane ();
-			pane = createPane ();
-			panes.append (pane);
-			parents.last ()->addWidget (pane);
-		} else if (dl[i] == QStringLiteral ("row")) {
-			QSplitter* newsplit = createSplitter (Qt::Horizontal);
-			parents.last ()->addWidget (newsplit);
-			parents.append (newsplit);
-		} else if (dl[i] == QStringLiteral ("col")) {
-			QSplitter* newsplit = createSplitter (Qt::Vertical);
-			parents.last ()->addWidget (newsplit);
-			parents.append (newsplit);
+		if (dl[i] == QStringLiteral("p")) {
+			RKWorkplaceViewPane* pane = createPane();
+			pane = createPane();
+			panes.append(pane);
+			parents.last()->addWidget(pane);
+		} else if (dl[i] == QStringLiteral("row")) {
+			QSplitter* newsplit = createSplitter(Qt::Horizontal);
+			parents.last()->addWidget(newsplit);
+			parents.append(newsplit);
+		} else if (dl[i] == QStringLiteral("col")) {
+			QSplitter* newsplit = createSplitter(Qt::Vertical);
+			parents.last()->addWidget(newsplit);
+			parents.append(newsplit);
 		} else {
-			RK_ASSERT (dl[i].startsWith (QStringLiteral ("end")));
-			const QStringList s = dl[i].mid (4).split (',');
-			QList<int> sizes = parents.last ()->sizes ();  // simply to have an initialized list of the correct length
-			for (int i = 0; i < sizes.count (); ++i) {
-				int size = qMax (50, s.value (i).toInt ());  // avoid collapsed views in case of errors
+			RK_ASSERT(dl[i].startsWith(QStringLiteral("end")));
+			const QStringList s = dl[i].mid(4).split(u',');
+			QList<int> sizes = parents.last()->sizes();  // simply to have an initialized list of the correct length
+			for (int i = 0; i < sizes.count(); ++i) {
+				int size = qMax(50, s.value(i).toInt());  // avoid collapsed views in case of errors
 				sizes[i] = size;
 			}
-			parents.last ()->setSizes (sizes);
-			parents.pop_back ();
+			parents.last()->setSizes(sizes);
+			parents.pop_back();
 		}
 	}
 
-	if (panes.isEmpty ()) {
-		panes.append (createPane ());
-		addWidget (panes[0]);
+	if (panes.isEmpty()) {
+		panes.append(createPane());
+		addWidget(panes[0]);
 	}
 
-	newpane = panes.value (0);
+	newpane = panes.value(0);
 
-	for (int i = 0; i < windows_to_readd.count (); ++i) {
-		addWindow (windows_to_readd[i]);
+	for (int i = 0; i < windows_to_readd.count(); ++i) {
+		addWindow(windows_to_readd[i]);
 	}
 
-	setUpdatesEnabled (old_updates_enabled);
+	setUpdatesEnabled(old_updates_enabled);
 }
 
 void RKWorkplaceView::nextPane () {
@@ -590,26 +590,26 @@ void RKWorkplaceView::purgeEmptyPanes () {
 	}
 }
 
-QString listLayout (const QSplitter *parent) {
-	RK_TRACE (APP);
+QString listLayout(const QSplitter* parent) {
+	RK_TRACE(APP);
 
-	QString ret = (parent->orientation () == Qt::Horizontal ? QStringLiteral ("row") : QStringLiteral ("col"));
+	QString ret = (parent->orientation() == Qt::Horizontal ? QStringLiteral("row") : QStringLiteral("col"));
 
-	for (int i = 0; i < parent->count (); ++i) {
-		QWidget* w = parent->widget (i);
-		RKWorkplaceViewPane *pane = qobject_cast<RKWorkplaceViewPane*> (w);
+	for (int i = 0; i < parent->count(); ++i) {
+		QWidget* w = parent->widget(i);
+		RKWorkplaceViewPane* pane = qobject_cast<RKWorkplaceViewPane*>(w);
 		if (pane) {
-			ret.append (QStringLiteral ("-p"));
+			ret.append(QStringLiteral("-p"));
 		} else {
-			QSplitter* sub = qobject_cast<QSplitter*> (w);
-			ret.append ('-' + listLayout (sub));
+			QSplitter* sub = qobject_cast<QSplitter*>(w);
+			ret.append(u'-' + listLayout(sub));
 		}
 	}
 
-	ret.append (QStringLiteral ("-end"));
-	const QList<int> sizes = parent->sizes ();
-	for (int i = 0; i < sizes.count (); ++i) {
-		ret.append (',' + QString::number (sizes[i]));
+	ret.append(QStringLiteral("-end"));
+	const QList<int> sizes = parent->sizes();
+	for (int i = 0; i < sizes.count(); ++i) {
+		ret.append(u',' + QString::number(sizes[i]));
 	}
 
 	return ret;
diff --git a/rkward/windows/robjectbrowser.cpp b/rkward/windows/robjectbrowser.cpp
index e246da57d..2e47667b9 100644
--- a/rkward/windows/robjectbrowser.cpp
+++ b/rkward/windows/robjectbrowser.cpp
@@ -177,30 +177,32 @@ void RObjectBrowserInternal::popupEdit () {
 	if (list_view->menuObject ()) RKWorkplace::mainWorkplace ()->editObject (list_view->menuObject ());
 }
 
-void RObjectBrowserInternal::popupCopy () {
-	RK_TRACE (APP);
+void RObjectBrowserInternal::popupCopy() {
+	RK_TRACE(APP);
 
 	bool ok;
-	RObject *object = list_view->menuObject ();
-	QString suggested_name = RObjectList::getGlobalEnv ()->validizeName (object->getShortName ());
-	QString name = QInputDialog::getText (this, i18n ("Copy object"), i18n ("Enter the name to copy to"), QLineEdit::Normal, suggested_name, &ok);
+	RObject *object = list_view->menuObject();
+	QString suggested_name = RObjectList::getGlobalEnv()->validizeName(object->getShortName());
+	QString name = QInputDialog::getText(this, i18n("Copy object"), i18n("Enter the name to copy to"), QLineEdit::Normal, suggested_name, &ok);
 
 	if (ok) {
-		QString valid = RObjectList::getGlobalEnv ()->validizeName (name);
+		QString valid = RObjectList::getGlobalEnv()->validizeName(name);
 		if (valid != name) KMessageBox::error(this, i18n("The name you specified was already in use or not valid. Renamed to %1", valid), i18n("Invalid Name"));
-		RInterface::issueCommand (RObject::rQuote (valid) + " <- " + object->getFullName (), RCommand::App | RCommand::ObjectListUpdate);
+		RInterface::issueCommand(RObject::rQuote(valid) + u" <- "_s + object->getFullName(), RCommand::App | RCommand::ObjectListUpdate);
 	}
 }
 
-void RObjectBrowserInternal::popupCopyToGlobalEnv () {
-	RK_TRACE (APP);
+void RObjectBrowserInternal::popupCopyToGlobalEnv() {
+	RK_TRACE(APP);
 
-	const RObject *object = list_view->menuObject ();
-	QString name = object->getShortName ();
+	const RObject *object = list_view->menuObject();
+	QString name = object->getShortName();
 
-	QString valid = RObjectList::getGlobalEnv ()->validizeName (name);
-	if (valid != name) KMessageBox::error(this, i18n("An object named '%1' already exists in the GlobalEnv. Created the copy as '%2' instead.", name, valid), i18n("Name already in use"));
-	RInterface::issueCommand (RObject::rQuote (valid) + " <- " + object->getFullName (), RCommand::App | RCommand::ObjectListUpdate);
+	QString valid = RObjectList::getGlobalEnv()->validizeName(name);
+	if (valid != name)
+		KMessageBox::error(this, i18n("An object named '%1' already exists in the GlobalEnv. Created the copy as '%2' instead.", name, valid),
+		                   i18n("Name already in use"));
+	RInterface::issueCommand(RObject::rQuote(valid) + u" <- "_s + object->getFullName(), RCommand::App | RCommand::ObjectListUpdate);
 }
 
 void RObjectBrowserInternal::popupView () {


More information about the rkward-tracker mailing list