[rkward] rkward: Replace single char string constants with char constants, where appropriate.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Feb 25 20:06:35 UTC 2015


Git commit 89e8a534af47b0aeeff69eadec2d14ce83c96824 by Thomas Friedrichsmeier.
Committed on 25/02/2015 at 20:04.
Pushed by tfry into branch 'master'.

Replace single char string constants with char constants, where appropriate.
Fixes 67 krazy warnings.

M  +1    -1    rkward/agents/rkloadagent.cpp
M  +2    -2    rkward/core/renvironmentobject.cpp
M  +4    -4    rkward/core/rkpseudoobjects.cpp
M  +1    -1    rkward/core/rkrownames.cpp
M  +6    -6    rkward/core/rkvariable.cpp
M  +1    -1    rkward/core/robjectlist.cpp
M  +2    -2    rkward/dialogs/rkloadlibsdialog.cpp
M  +1    -1    rkward/dialogs/rkrecoverdialog.cpp
M  +2    -2    rkward/misc/xmlhelper.cpp
M  +2    -2    rkward/plugin/rkabstractoptionselector.cpp
M  +3    -3    rkward/plugin/rkcomponent.cpp
M  +1    -1    rkward/plugin/rkcomponentmap.cpp
M  +6    -6    rkward/plugin/rkcomponentmeta.cpp
M  +2    -2    rkward/plugin/rkcomponentproperties.cpp
M  +1    -1    rkward/plugin/rkformula.cpp
M  +1    -1    rkward/plugin/rkmatrixinput.cpp
M  +2    -2    rkward/plugin/rkoptionset.cpp
M  +2    -2    rkward/plugin/rkvarslot.cpp
M  +1    -1    rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
M  +5    -5    rkward/rkconsole.cpp
M  +1    -1    rkward/rkward.cpp
M  +3    -3    rkward/rkward_startup_wrapper.cpp
M  +1    -1    rkward/robjectviewer.cpp
M  +1    -1    rkward/scriptbackends/simplebackend.cpp
M  +1    -1    rkward/settings/rksettingsmoduleplugins.cpp
M  +1    -1    rkward/settings/rksettingsmoduler.cpp
M  +1    -1    rkward/windows/detachedwindowcontainer.cpp
M  +1    -1    rkward/windows/rkcallstackviewer.cpp
M  +3    -3    rkward/windows/rkcommandeditorwindow.cpp
M  +1    -1    rkward/windows/rkdebugmessagewindow.cpp
M  +2    -2    rkward/windows/rkhelpsearchwindow.cpp
M  +4    -4    rkward/windows/rkwindowcatcher.cpp
M  +1    -1    rkward/windows/rkworkplace.cpp

http://commits.kde.org/rkward/89e8a534af47b0aeeff69eadec2d14ce83c96824

diff --git a/rkward/agents/rkloadagent.cpp b/rkward/agents/rkloadagent.cpp
index e0eb5c0..dd3cf0e 100644
--- a/rkward/agents/rkloadagent.cpp
+++ b/rkward/agents/rkloadagent.cpp
@@ -79,7 +79,7 @@ void RKLoadAgent::rCommandDone (RCommand *command) {
 			RKWorkplace::mainWorkplace ()->restoreWorkplace (0, _merge);
 			if (RKSettingsModuleGeneral::cdToWorkspaceOnLoad ()) {
 				if (RKWorkplace::mainWorkplace ()->workspaceURL ().isLocalFile ()) {
-					RKGlobals::rInterface ()->issueCommand ("setwd (" + RObject::rQuote (RKWorkplace::mainWorkplace ()->workspaceURL ().directory ()) + ")", RCommand::App);
+					RKGlobals::rInterface ()->issueCommand ("setwd (" + RObject::rQuote (RKWorkplace::mainWorkplace ()->workspaceURL ().directory ()) + ')', RCommand::App);
 				}
 			}
 			RKGlobals::rInterface ()->issueCommand (QString (), RCommand::EmptyCommand | RCommand::App, QString (), this, WORKSPACE_LOAD_COMPLETE_COMMAND);
diff --git a/rkward/core/renvironmentobject.cpp b/rkward/core/renvironmentobject.cpp
index 49695bf..f0ea919 100644
--- a/rkward/core/renvironmentobject.cpp
+++ b/rkward/core/renvironmentobject.cpp
@@ -57,7 +57,7 @@ QString REnvironmentObject::getFullName () const {
 	RK_TRACE (OBJECTS);
 
 	if (type & GlobalEnv) return name;	// .GlobalEnv
-	if (type & ToplevelEnv) return ("as.environment (" + rQuote (name) + ")");
+	if (type & ToplevelEnv) return ("as.environment (" + rQuote (name) + ')');
 	return parent->makeChildName (name, type & Misplaced);
 }
 
@@ -72,7 +72,7 @@ QString REnvironmentObject::makeChildName (const QString &short_child_name, bool
 	} else safe_name = short_child_name;
 
 	if (type & GlobalEnv) {		// don't print as ".GlobalEnv$something" unless childname needs fixing
-		if (irregular) return (getShortName () + "$" + safe_name);
+		if (irregular) return (getShortName () + '$' + safe_name);
 		return (safe_name);
 	}
 	if (type & ToplevelEnv) {
diff --git a/rkward/core/rkpseudoobjects.cpp b/rkward/core/rkpseudoobjects.cpp
index e15d56c..3aa1336 100644
--- a/rkward/core/rkpseudoobjects.cpp
+++ b/rkward/core/rkpseudoobjects.cpp
@@ -35,7 +35,7 @@ RSlotsPseudoObject::~RSlotsPseudoObject () {
 QString RSlotsPseudoObject::getFullName () const {
 	RK_TRACE (OBJECTS);
 
-	return (".rk.get.slots (" + parent->getFullName () + ")");
+	return (".rk.get.slots (" + parent->getFullName () + ')');
 }
 
 QString RSlotsPseudoObject::makeChildName (const QString &short_child_name, bool) const {
@@ -43,7 +43,7 @@ QString RSlotsPseudoObject::makeChildName (const QString &short_child_name, bool
 
 	QString safe_name = short_child_name;
 	if (irregularShortName (safe_name)) safe_name = rQuote (short_child_name);
-	return (parent->getFullName () + "@" + safe_name);
+	return (parent->getFullName () + '@' + safe_name);
 }
 
 RKNamespaceObject::RKNamespaceObject (REnvironmentObject* package, const QString name) : REnvironmentObject (package, name.isNull () ? "NAMESPACE" : name) {
@@ -61,7 +61,7 @@ RKNamespaceObject::~RKNamespaceObject () {
 
 QString RKNamespaceObject::getFullName () const {
 	RK_TRACE (OBJECTS);
-	return ("asNamespace (" + rQuote (namespace_name) + ")");
+	return ("asNamespace (" + rQuote (namespace_name) + ')');
 }
 
 QString RKNamespaceObject::makeChildName (const QString& short_child_name, bool) const {
@@ -99,7 +99,7 @@ QString RKOrphanNamespacesObject::getFullName () const {
 
 QString RKOrphanNamespacesObject::makeChildName (const QString& short_child_name, bool) const {
 	RK_TRACE (OBJECTS);
-	return ("asNamespace (" + rQuote (short_child_name) + ")");
+	return ("asNamespace (" + rQuote (short_child_name) + ')');
 }
 
 QString RKOrphanNamespacesObject::makeChildBaseName (const QString& short_child_name) const {
diff --git a/rkward/core/rkrownames.cpp b/rkward/core/rkrownames.cpp
index 2207b68..01efcd1 100644
--- a/rkward/core/rkrownames.cpp
+++ b/rkward/core/rkrownames.cpp
@@ -65,7 +65,7 @@ void RKRowNames::beginEdit () {
 QString RKRowNames::getFullName () const {
 //	RK_TRACE (OBJECTS);
 
-	return ("row.names (" + parent->getFullName () + ")");
+	return ("row.names (" + parent->getFullName () + ')');
 }
 
 void RKRowNames::writeData (int from_row, int to_row, RCommandChain *chain) {
diff --git a/rkward/core/rkvariable.cpp b/rkward/core/rkvariable.cpp
index 04fc947..788268a 100644
--- a/rkward/core/rkvariable.cpp
+++ b/rkward/core/rkvariable.cpp
@@ -96,7 +96,7 @@ void RKVariable::setVarType (RObject::RDataType new_type, bool sync) {
 			else if (new_type == RObject::DataNumeric) command += "as.numeric";
 			else if (new_type == RObject::DataLogical) command += "as.logical";
 			else if (new_type == RObject::DataFactor) command += "as.factor";
-			command += ")";
+			command += ')';
 			RKGlobals::rInterface ()->issueCommand (command, RCommand::App | RCommand::Sync, QString::null);
 			if (new_type == RObject::DataFactor) updateValueLabels ();	// as.factor resets the "levels"-attribute!
 
@@ -369,14 +369,14 @@ void RKVariable::writeInvalidFields (QList<int> rows, RCommandChain *chain) {
 
 	if (!set.isEmpty ()) {
 		set = "set=c(" + set + "), ";
-		values = "values=c(" + values + ")";
+		values = "values=c(" + values + ')';
 	}
 	if (!clear.isEmpty ()) {
-		clear = "clear=c(" + clear + ")";
+		clear = "clear=c(" + clear + ')';
 		if (!values.isEmpty ()) values.append (",");
 	}
 
-	RKGlobals::rInterface ()->issueCommand (".rk.set.invalid.fields (" + getFullName () + ", " + set + values + clear + ")", RCommand::App | RCommand::Sync, QString (), 0,0, chain);
+	RKGlobals::rInterface ()->issueCommand (".rk.set.invalid.fields (" + getFullName () + ", " + set + values + clear + ')', RCommand::App | RCommand::Sync, QString (), 0,0, chain);
 
 	if (data->previously_valid != data->invalid_fields.isEmpty ()) {
 		data->previously_valid = data->invalid_fields.isEmpty ();
@@ -770,7 +770,7 @@ void RKVariable::writeValueLabels (RCommandChain *chain) const {
 		level_string = "NULL";
 	}
 
-	RKGlobals::rInterface ()->issueCommand (".rk.set.levels (" + getFullName () + ", " + level_string + ")", RCommand::App | RCommand::Sync, QString::null, 0, 0, chain);
+	RKGlobals::rInterface ()->issueCommand (".rk.set.levels (" + getFullName () + ", " + level_string + ')', RCommand::App | RCommand::Sync, QString::null, 0, 0, chain);
 }
 
 QString RKVariable::getValueLabelString () const {
@@ -875,7 +875,7 @@ RKVariable::FormattingOptions RKVariable::parseFormattingOptionsString (const QS
 	formatting_options.precision = 0;
 	bool empty = true;
 
-	QStringList list = string.split ("#", QString::SkipEmptyParts);
+	QStringList list = string.split ('#', QString::SkipEmptyParts);
 	QString option, parameter;
 	for (QStringList::const_iterator it = list.constBegin (); it != list.constEnd (); ++it) {
 		option = (*it).section (':', 0, 0);
diff --git a/rkward/core/robjectlist.cpp b/rkward/core/robjectlist.cpp
index 5d4a494..d477d5b 100644
--- a/rkward/core/robjectlist.cpp
+++ b/rkward/core/robjectlist.cpp
@@ -88,7 +88,7 @@ QStringList RObjectList::detachPackages (const QStringList &packages, RCommandCh
 		}
 	}
 	for (int i = 0; i < remove.size (); ++i) {
-		RCommand *command = new RCommand ("detach (" + rQuote (remove[i]) + ")", RCommand::App | RCommand::ObjectListUpdate);
+		RCommand *command = new RCommand ("detach (" + rQuote (remove[i]) + ')', RCommand::App | RCommand::ObjectListUpdate);
 
 		if (control) control->addRCommand (command);
 		RKGlobals::rInterface()->issueCommand (command, chain);
diff --git a/rkward/dialogs/rkloadlibsdialog.cpp b/rkward/dialogs/rkloadlibsdialog.cpp
index 96493da..02262ff 100644
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@ -390,7 +390,7 @@ void RKLoadLibsDialog::processExited (int exitCode, QProcess::ExitStatus exitSta
 	RK_TRACE (DIALOGS);
 
 	if (exitCode || (exitStatus != QProcess::NormalExit)) {
-		installationError ("\n" + i18n ("Installation process died with exit code %1", exitCode));
+		installationError ('\n' + i18n ("Installation process died with exit code %1", exitCode));
 	}
 
 	emit (installationComplete ());
@@ -722,7 +722,7 @@ void InstallPackagesWidget::filterChanged () {
 	RK_TRACE (DIALOGS);
 
 	QString f = filter_edit->text ();
-	if (f.isEmpty ()) f = "*";
+	if (f.isEmpty ()) f = '*';
 	else {
 		if (!f.startsWith ('^')) f.prepend ('*');
 		if (!f.endsWith ('$')) f.append ('*');
diff --git a/rkward/dialogs/rkrecoverdialog.cpp b/rkward/dialogs/rkrecoverdialog.cpp
index e226773..1363a3e 100644
--- a/rkward/dialogs/rkrecoverdialog.cpp
+++ b/rkward/dialogs/rkrecoverdialog.cpp
@@ -84,7 +84,7 @@ QString RKRecoverDialog::saveFileFor (const QString& recovery_file) {
 	QString new_name;
 	for (int i = 0; i < 100; ++i) {	// If we just had more than 100 crashes per minutes, you'll excuse another small bug, at this point
 		QString num;
-		if (i > 0) num = "_" + QString::number (i+1);
+		if (i > 0) num = '_' + QString::number (i+1);
 		new_name = dir.absoluteFilePath ("recovered_workspace_" + mtime.toString ("yyyy-MM-dd_hh:mm") + num + ".RData");
 		if (!QFileInfo (new_name).exists ()) break;
 	}
diff --git a/rkward/misc/xmlhelper.cpp b/rkward/misc/xmlhelper.cpp
index fc8cd42..cce8892 100644
--- a/rkward/misc/xmlhelper.cpp
+++ b/rkward/misc/xmlhelper.cpp
@@ -129,7 +129,7 @@ QDomElement XMLHelper::resolveSnippets (QDomElement &from_doc) {
 	for (XMLChildList::const_iterator it = refs.constBegin (); it != refs.constEnd (); ++it) {
 		QDomElement ref = *it;
 		QString id = getStringAttribute (ref, "snippet", QString::null, DL_ERROR);
-		displayError (&ref, "resolving snippet '" + id + "'", DL_DEBUG, DL_DEBUG);
+		displayError (&ref, "resolving snippet '" + id + '\'', DL_DEBUG, DL_DEBUG);
 
 		// resolve the reference
 		QDomElement snippet;
@@ -140,7 +140,7 @@ QDomElement XMLHelper::resolveSnippets (QDomElement &from_doc) {
 			}
 		}
 		if (snippet.isNull ()) {
-			displayError (&ref, "no such snippet '" + id + "'", DL_ERROR, DL_ERROR);
+			displayError (&ref, "no such snippet '" + id + '\'', DL_ERROR, DL_ERROR);
 		}
 
 		// now insert it.
diff --git a/rkward/plugin/rkabstractoptionselector.cpp b/rkward/plugin/rkabstractoptionselector.cpp
index c8cd57d..68bf7c8 100644
--- a/rkward/plugin/rkabstractoptionselector.cpp
+++ b/rkward/plugin/rkabstractoptionselector.cpp
@@ -83,11 +83,11 @@ RKComponentBase* RKAbstractOptionSelector::lookupComponent (const QString &ident
 
 	if (identifier.isEmpty ()) return this;
 
-	QString name = identifier.section (".", 0, 0);
+	QString name = identifier.section ('.', 0, 0);
 	if (named_options.contains (name)) {
 		Option *opt = named_options[name];
 
-		QString mod = identifier.section (".", 1);
+		QString mod = identifier.section ('.', 1);
 		if (mod != "enabled") {
 			RK_DEBUG (PLUGIN, DL_DEBUG, "options do not have property '%s'", mod.toLatin1().data ());
 			return this;
diff --git a/rkward/plugin/rkcomponent.cpp b/rkward/plugin/rkcomponent.cpp
index eda0dcd..f071a6c 100644
--- a/rkward/plugin/rkcomponent.cpp
+++ b/rkward/plugin/rkcomponent.cpp
@@ -31,12 +31,12 @@ RKComponentBase* RKComponentBase::lookupComponent (const QString &identifier, QS
 	if (identifier.isEmpty ()) return this;
 	RK_DEBUG (PLUGIN, DL_DEBUG, "looking up '%s'", identifier.toLatin1 ().data ());
 
-	RKComponentBase *child = child_map.value (identifier.section (".", 0, 0));
+	RKComponentBase *child = child_map.value (identifier.section ('.', 0, 0));
 	if (!child) {	// if we do not have such a child, return this (and set remainder)
 		*remainder = identifier;
 		return this;
 	} else {	// else do recursive lookup
-		return child->lookupComponent (identifier.section (".", 1), remainder);
+		return child->lookupComponent (identifier.section ('.', 1), remainder);
 	}
 }
 
@@ -109,7 +109,7 @@ QString RKComponentBase::valueMapToString (const PropertyValueMap &map) {
 	QString out;
 	for (PropertyValueMap::const_iterator it = map.constBegin (); it != map.constEnd (); ++it) {
 		if (!out.isEmpty ()) out.append ("\n");
-		out.append (RKCommonFunctions::escape (it.key () + "=" + it.value ()));
+		out.append (RKCommonFunctions::escape (it.key () + '=' + it.value ()));
 	}
 	return out;
 }
diff --git a/rkward/plugin/rkcomponentmap.cpp b/rkward/plugin/rkcomponentmap.cpp
index e9128b9..e853630 100644
--- a/rkward/plugin/rkcomponentmap.cpp
+++ b/rkward/plugin/rkcomponentmap.cpp
@@ -101,7 +101,7 @@ void RKComponentGUIXML::resolveComponentLabelsAndSortMenu (Menu *menu, const QSt
 					component_menus.insert (entry->id, menu_path);
 				}
 			} else {
-				resolveComponentLabelsAndSortMenu (static_cast<Menu*> (entry), menu_path.isEmpty () ? entry->label : menu_path + "\t" + entry->label);
+				resolveComponentLabelsAndSortMenu (static_cast<Menu*> (entry), menu_path.isEmpty () ? entry->label : menu_path + '\t' + entry->label);
 			}
 		}
 		qSort (group->entries.begin (), group->entries.end (), compareMenuEntries);
diff --git a/rkward/plugin/rkcomponentmeta.cpp b/rkward/plugin/rkcomponentmeta.cpp
index 167c912..90bbd7f 100644
--- a/rkward/plugin/rkcomponentmeta.cpp
+++ b/rkward/plugin/rkcomponentmeta.cpp
@@ -55,7 +55,7 @@ RKComponentAboutData::RKComponentAboutData (const QDomElement& e, XMLHelper &xml
 		RKComponentAuthor author;
 		author.name = xml.i18nStringAttribute (ae, "name", QString (), DL_INFO);
 		if (author.name.isEmpty ()) {
-			author.name = xml.i18nStringAttribute (ae, "given", QString (), DL_WARNING) + " " + xml.i18nStringAttribute (ae, "family", QString (), DL_WARNING);
+			author.name = xml.i18nStringAttribute (ae, "given", QString (), DL_WARNING) + ' ' + xml.i18nStringAttribute (ae, "family", QString (), DL_WARNING);
 			
 		}
 		if (author.name.isEmpty ()) xml.displayError (&ae, "No author name specified", DL_WARNING);
@@ -81,8 +81,8 @@ QString RKComponentAboutData::toHtml () const {
 	RK_TRACE (PLUGIN);
 
 	QString ret = "<p><b>" + name + "</b>";
-	if (!version.isEmpty ()) ret.append (" " + version);
-	if (!releasedate.isEmpty ()) ret.append (" (" + releasedate + ")");
+	if (!version.isEmpty ()) ret.append (' ' + version);
+	if (!releasedate.isEmpty ()) ret.append (" (" + releasedate + ')');
 	if (!shortinfo.isEmpty ()) ret.append (":</p>\n<p>" + shortinfo);
 	ret.append ("</p>\n");
 	if (!url.isEmpty ()) ret.append ("URL: <a href=\"" + url + "\">" + url + "</a></p>\n<p>");
@@ -94,8 +94,8 @@ QString RKComponentAboutData::toHtml () const {
 		for (int i = 0; i < authors.size (); ++i) {
 			RKComponentAuthor a = authors[i];
 			ret.append ("<li>" + a.name);
-			if (!a.email.isEmpty ()) ret.append (" (" + a.email + ")");
-			if (!a.url.isEmpty ()) ret.append (" (" + a.url + ")");
+			if (!a.email.isEmpty ()) ret.append (" (" + a.email + ')');
+			if (!a.url.isEmpty ()) ret.append (" (" + a.url + ')');
 			if (!a.roles.isEmpty ()) ret.append ("<br/><i>" + i18nc ("Author roles (contributor, etc.)", "Roles") + "</i>: " + a.roles);
 		}
 		ret.append ("</ul></p>");
@@ -223,7 +223,7 @@ QString RKComponentDependency::depsToHtml (const QList <RKComponentDependency>&
 			if (dep.type == RKWardPluginmap) ret.append (i18n ("RKWard plugin map"));
 			else ret.append (i18n ("R package"));
 			ret.append (" \"" + dep.package + "\"");
-			if (!dep.source_info.isEmpty ()) ret.append (" (" + dep.source_info + ")");
+			if (!dep.source_info.isEmpty ()) ret.append (" (" + dep.source_info + ')');
 		}
 		if (dep.min_version > 0) ret.append (" >= " + numericVersionToString (dep.min_version));
 		if (dep.max_version < 0xFFFFFFFF) ret.append (" <= " + numericVersionToString (dep.max_version));
diff --git a/rkward/plugin/rkcomponentproperties.cpp b/rkward/plugin/rkcomponentproperties.cpp
index 4f10ba7..d779488 100644
--- a/rkward/plugin/rkcomponentproperties.cpp
+++ b/rkward/plugin/rkcomponentproperties.cpp
@@ -333,7 +333,7 @@ RKComponentBase* RKComponentPropertyBool::lookupComponent (const QString &identi
 	RKComponentBase *dummy = RKComponentPropertyBase::lookupComponent (identifier, remainder);
 	if (dummy != this) return dummy;
 
-	QString next = identifier.section (".", 0, 0);
+	QString next = identifier.section ('.', 0, 0);
 	if (next == "not") {
 		RKComponentPropertyBool *negated = new RKComponentPropertyBool (this, false, false, value_true, value_false);
 		negated->setInverted (true);
@@ -341,7 +341,7 @@ RKComponentBase* RKComponentPropertyBool::lookupComponent (const QString &identi
 		negated->connectToGovernor (this);
 		*remainder = QString::null;		// reset
 		addChild ("not", negated);		// so subsequent lookups will not recreate the negated property
-		return (negated->lookupComponent (identifier.section (".", 1), remainder));
+		return (negated->lookupComponent (identifier.section ('.', 1), remainder));
 	}
 
 	return (this);
diff --git a/rkward/plugin/rkformula.cpp b/rkward/plugin/rkformula.cpp
index ab7fc5a..5e43bce 100644
--- a/rkward/plugin/rkformula.cpp
+++ b/rkward/plugin/rkformula.cpp
@@ -412,7 +412,7 @@ QStringList RKFormula::getUiLabelPair () const {
 
 	QStringList ret (label_string);
 	QString m = stripAccelerators (type_selector->checkedButton ()->text ());
-	if (model_type == Custom) m.append (" " + model->value ().toString ());
+	if (model_type == Custom) m.append (' ' + model->value ().toString ());
 	ret.append (m);
 	return ret;
 }
diff --git a/rkward/plugin/rkmatrixinput.cpp b/rkward/plugin/rkmatrixinput.cpp
index 001b459..64dcd6f 100644
--- a/rkward/plugin/rkmatrixinput.cpp
+++ b/rkward/plugin/rkmatrixinput.cpp
@@ -125,7 +125,7 @@ QVariant RKMatrixInput::value (const QString& modifier) {
 	if (modifier.isEmpty () || (modifier == "cbind")) {
 		QStringList ret;
 		for (int i = 0; i < column_count->intValue (); ++i) {
-			ret.append ("\tc (" + makeColumnString (i, ", ") + ")");
+			ret.append ("\tc (" + makeColumnString (i, ", ") + ')');
 		}
 		return QString ("cbind (\n" + ret.join (",\n") + "\n)");
 	}
diff --git a/rkward/plugin/rkoptionset.cpp b/rkward/plugin/rkoptionset.cpp
index f38e814..a684951 100644
--- a/rkward/plugin/rkoptionset.cpp
+++ b/rkward/plugin/rkoptionset.cpp
@@ -99,7 +99,7 @@ RKOptionSet::RKOptionSet (const QDomElement &element, RKComponent *parent_compon
 
 		while (child_map.contains (id)) {
 			RK_DEBUG (PLUGIN, DL_ERROR, "optionset already contains a property named %s. Renaming to _%s", qPrintable (id), qPrintable (id));
-			id = "_" + id;
+			id = '_' + id;
 		}
 
 		ColumnInfo col_inf;
@@ -313,7 +313,7 @@ void RKOptionSet::serializationPropertyChanged (RKComponentPropertyBase* propert
 
 	QList<RowInfo> new_rows;
 	int row = 0;
-	QStringList items = fetchStringValue (property).split ("\n");
+	QStringList items = fetchStringValue (property).split ('\n');
 	bool keys_missing = (keycolumn != 0);
 	for (int i = 0; i < items.size (); ++i) {
 		const QString &item = items[i];
diff --git a/rkward/plugin/rkvarslot.cpp b/rkward/plugin/rkvarslot.cpp
index 83a4ca1..c72345b 100644
--- a/rkward/plugin/rkvarslot.cpp
+++ b/rkward/plugin/rkvarslot.cpp
@@ -100,8 +100,8 @@ RKVarSlot::RKVarSlot (const QDomElement &element, RKComponent *parent_component,
 
 	if (mode == Varslot) {
 		// initialize filters
-		static_cast<RKComponentPropertyRObjects*> (available)->setClassFilter (xml->getStringAttribute (element, "classes", QString (), DL_INFO).split (" ", QString::SkipEmptyParts));
-		static_cast<RKComponentPropertyRObjects*> (available)->setTypeFilter (xml->getStringAttribute (element, "types", QString::null, DL_INFO).split (" ", QString::SkipEmptyParts));
+		static_cast<RKComponentPropertyRObjects*> (available)->setClassFilter (xml->getStringAttribute (element, "classes", QString (), DL_INFO).split (' ', QString::SkipEmptyParts));
+		static_cast<RKComponentPropertyRObjects*> (available)->setTypeFilter (xml->getStringAttribute (element, "types", QString::null, DL_INFO).split (' ', QString::SkipEmptyParts));
 		static_cast<RKComponentPropertyRObjects*> (available)->setDimensionFilter (xml->getIntAttribute (element, "num_dimensions", 0, DL_INFO), xml->getIntAttribute (element, "min_length", 0, DL_INFO), xml->getIntAttribute (element, "max_length", INT_MAX, DL_INFO));
 	}
 	available->setStripDuplicates (!xml->getBoolAttribute (element, "allow_duplicates", false, DL_INFO));
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
index 7ade4d4..9997238 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
@@ -97,7 +97,7 @@ void RKGraphicsDevice::updateNow () {
 void RKGraphicsDevice::checkSize() {
 	RK_TRACE (GRAPHICS_DEVICE);
 	if (view->size () != area.size ()) {
-		RKGlobals::rInterface ()->issueCommand (new RCommand ("rkward:::RK.resize (" + QString::number (devices.key (this) + 1) + ")", RCommand::PriorityCommand));
+		RKGlobals::rInterface ()->issueCommand (new RCommand ("rkward:::RK.resize (" + QString::number (devices.key (this) + 1) + ')', RCommand::PriorityCommand));
 	}
 }
 
diff --git a/rkward/rkconsole.cpp b/rkward/rkconsole.cpp
index 13ae4a6..949ae33 100644
--- a/rkward/rkconsole.cpp
+++ b/rkward/rkconsole.cpp
@@ -368,7 +368,7 @@ QString RKConsole::provideContext (int line_rev) {
 	QString ret;
 	if (line_rev == 0) ret = currentEditingLine ().left (currentCursorPositionInCommand ()); 
 	else if (!incomplete_command.isEmpty ()) {
-		QStringList lines = incomplete_command.split ("\n");
+		QStringList lines = incomplete_command.split ('\n');
 		if (lines.size () > line_rev) {
 			ret = lines[lines.size () - line_rev - 1];
 		}
@@ -458,7 +458,7 @@ void RKConsole::doTabCompletion () {
 	QString current_symbol = current_line.mid (word_start, word_end - word_start);
 
 	// 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 (current_symbol.startsWith ("\"") || current_symbol.startsWith ("\'") || current_symbol.startsWith ("`")) {
+	if (current_symbol.startsWith ('\"') || current_symbol.startsWith ('\'') || current_symbol.startsWith ('`')) {
 		KUrlCompletion comp (KUrlCompletion::FileCompletion);
 		comp.setDir (QDir::currentPath ());
 		comp.makeCompletion (current_symbol.mid (1));
@@ -792,7 +792,7 @@ void RKConsole::userSaveHistory (const KUrl &_url) {
 
 	KTemporaryFile tempfile;
 	tempfile.open ();
-	tempfile.write (QString (commandHistory ().join ("\n") + "\n").toLocal8Bit ().data ());
+	tempfile.write (QString (commandHistory ().join ("\n") + '\n').toLocal8Bit ().data ());
 	tempfile.close ();
 
 	KIO::NetAccess::upload (tempfile.fileName (), url, this);
@@ -803,7 +803,7 @@ QString RKConsole::cleanSelection (const QString &origin) {
 
 	QString ret;
 	ret.reserve (origin.length ());
-	QStringList lines = origin.split ("\n");
+	QStringList lines = origin.split ('\n');
 	foreach (QString line, lines) {
 		if (line.startsWith (nprefix)) {
 			ret.append (line.mid (nprefix.length ()));
@@ -825,7 +825,7 @@ void RKConsole::copyCommands () {
 	if (!sel.isValid ()) return;
 
 	// we use this somewhat cumbersome (and inefficient) approach as it should also be correct in case of blockwise selections
-	QStringList command_lines = view->selectionText ().split ("\n");
+	QStringList command_lines = view->selectionText ().split ('\n');
 	int i = 0;
 	for (int l = sel.start ().line (); l <= sel.end ().line (); ++l) {
 		QString line = doc->line (l);
diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 7a8f68b..40b2186 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -822,7 +822,7 @@ void RKWardMainWindow::slotSetStatusBarText (const QString &text) {
 
 //KDE4: still needed?
 	QString ntext = text.trimmed ();
-	ntext.replace ("<qt>", "");	// WORKAROUND: what the ?!? is going on? The KTHMLPart seems to post such messages.
+	ntext.replace ("<qt>", QString ());	// WORKAROUND: what the ?!? is going on? The KTHMLPart seems to post such messages.
 	if (ntext.isEmpty ()) {
 		statusBar ()->clearMessage ();
 	} else {
diff --git a/rkward/rkward_startup_wrapper.cpp b/rkward/rkward_startup_wrapper.cpp
index 2a723d5..da843e8 100644
--- a/rkward/rkward_startup_wrapper.cpp
+++ b/rkward/rkward_startup_wrapper.cpp
@@ -179,9 +179,9 @@ int main (int argc, char *argv[]) {
 	if (kde4_config_exe.isNull ()) kde4_config_exe = findExeAtPath ("kde4-config", QDir (app.applicationDirPath ()).filePath ("KDE/bin"));
 	if (kde4_config_exe.isNull ()) {
 #ifdef Q_WS_WIN
-	QStringList syspath = QString (qgetenv ("PATH")).split (";");
+	QStringList syspath = QString (qgetenv ("PATH")).split (';');
 #else
-	QStringList syspath = QString (qgetenv ("PATH")).split (":");
+	QStringList syspath = QString (qgetenv ("PATH")).split (':');
 #endif
 		for (int i = 0; i < syspath.size (); ++i) {
 			kde4_config_exe = findExeAtPath ("kde4-config", syspath[i]);
@@ -199,7 +199,7 @@ int main (int argc, char *argv[]) {
 	QString kde_dir_safe_path = quoteCommand (kde_dir.path ());
 #ifdef Q_WS_WIN
 	QString kdeinit4_exe = findExeAtPath ("kdeinit4", kde_dir.path ());
-	qputenv ("PATH", QString (kde_dir_safe_path + ";" + qgetenv ("PATH")).toLocal8Bit ());
+	qputenv ("PATH", QString (kde_dir_safe_path + ';' + qgetenv ("PATH")).toLocal8Bit ());
 	if (debug_level > 3) qDebug ("Adding %s to the system path", qPrintable (kde_dir_safe_path));
 #endif
 	// important if RKWard is not in KDEPREFIX/bin but e.g. KDEPREFIX/lib/libexec
diff --git a/rkward/robjectviewer.cpp b/rkward/robjectviewer.cpp
index d23d1a9..f35bb0c 100644
--- a/rkward/robjectviewer.cpp
+++ b/rkward/robjectviewer.cpp
@@ -314,7 +314,7 @@ void RObjectStructureWidget::update () {
 
 	RObjectViewerWidget::update ();
 
-	RCommand *command = new RCommand ("str(" + _object->getFullName () + ")", RCommand::App, QString (), this);
+	RCommand *command = new RCommand ("str(" + _object->getFullName () + ')', RCommand::App, QString (), this);
 	RKGlobals::rInterface ()->issueCommand (command, 0);
 }
 
diff --git a/rkward/scriptbackends/simplebackend.cpp b/rkward/scriptbackends/simplebackend.cpp
index a27d3cd..823d74a 100644
--- a/rkward/scriptbackends/simplebackend.cpp
+++ b/rkward/scriptbackends/simplebackend.cpp
@@ -134,7 +134,7 @@ void SimpleBackend::finishCall (const QString &conditions) {
 	QString conds = conditions;
 	int repl = current_values.count();
 	for (int i = repl; i > 0; --i) {
-		QString placeholder = "%" + QString::number (i);
+		QString placeholder = '%' + QString::number (i);
 		QString replacement = current_values[i-1].toString ();
 		conds.replace (placeholder, replacement);
 	}
diff --git a/rkward/settings/rksettingsmoduleplugins.cpp b/rkward/settings/rksettingsmoduleplugins.cpp
index 9f9ea79..1a21f50 100644
--- a/rkward/settings/rksettingsmoduleplugins.cpp
+++ b/rkward/settings/rksettingsmoduleplugins.cpp
@@ -246,7 +246,7 @@ QString RKSettingsModulePlugins::findPluginMapById (const QString &id) {
 	}
 	// for "rkward::" namespace, try a little harded:
 	if (id.startsWith ("rkward::")) {
-		QFileInfo info (RKCommonFunctions::getRKWardDataDir () + "/" + id.mid (8));
+		QFileInfo info (RKCommonFunctions::getRKWardDataDir () + '/' + id.mid (8));
 		if (info.isReadable ()) return info.absoluteFilePath ();
 	}
 
diff --git a/rkward/settings/rksettingsmoduler.cpp b/rkward/settings/rksettingsmoduler.cpp
index af9b75e..35a2266 100644
--- a/rkward/settings/rksettingsmoduler.cpp
+++ b/rkward/settings/rksettingsmoduler.cpp
@@ -267,7 +267,7 @@ QStringList RKSettingsModuleR::makeRRunTimeOptionCommands () {
 	else list.append ("options (editor=\"" + options_editor + "\")\n");
 	if (options_pager == builtin_editor) list.append ("options (pager=rk.show.files)\n");
 	else list.append ("options (pager=\"" + options_pager + "\")\n");
-	if (!options_further.isEmpty ()) list.append (options_further + "\n");
+	if (!options_further.isEmpty ()) list.append (options_further + '\n');
 #ifdef Q_WS_WIN
 	list.append (QString ("setInternet2 (") + (options_internet2 ? "TRUE)\n" : "FALSE)\n"));
 #endif
diff --git a/rkward/windows/detachedwindowcontainer.cpp b/rkward/windows/detachedwindowcontainer.cpp
index abab05d..76edeec 100644
--- a/rkward/windows/detachedwindowcontainer.cpp
+++ b/rkward/windows/detachedwindowcontainer.cpp
@@ -133,7 +133,7 @@ void DetachedWindowContainer::slotSetStatusBarText (const QString &text) {
 	RK_TRACE (APP);
 
 	QString ntext = text.trimmed ();
-	ntext.replace ("<qt>", "");	// WORKAROUND: what the ?!? is going on? The KTHMLPart seems to post such messages.
+	ntext.replace ("<qt>", QString ());	// WORKAROUND: what the ?!? is going on? The KTHMLPart seems to post such messages.
 
 	statusBar ()->showMessage (ntext);
 	statusBar ()->show ();
diff --git a/rkward/windows/rkcallstackviewer.cpp b/rkward/windows/rkcallstackviewer.cpp
index fc0a44b..bfc05be 100644
--- a/rkward/windows/rkcallstackviewer.cpp
+++ b/rkward/windows/rkcallstackviewer.cpp
@@ -145,7 +145,7 @@ void RKCallstackViewerWidget::frameChanged (int frame_number) {
 									Qt::escape (RKDebugHandler::instance ()->calls ().value (frame_number)),
 									Qt::escape (RKDebugHandler::instance ()->environments ().value (frame_number)),
 									Qt::escape (RKDebugHandler::instance ()->locals ().value (frame_number).split ('\n').join (", "))));
-	frame_source->setText (RKDebugHandler::instance ()->functions ().value (frame_number) + "\n");
+	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) {
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index c9c50c9..e0c4d3a 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -460,7 +460,7 @@ void RKCommandEditorWindow::doAutoSave () {
 	KUrl backup_autosave_url;
 	if (previous_autosave_url.isValid ()) {
 		backup_autosave_url = previous_autosave_url;
-		backup_autosave_url.setFileName (backup_autosave_url.fileName () + "~");
+		backup_autosave_url.setFileName (backup_autosave_url.fileName () + '~');
 		if (previous_autosave_url.isLocalFile ()) {
 			QFile::remove (backup_autosave_url.toLocalFile ());
 			QFile::copy (previous_autosave_url.toLocalFile (), backup_autosave_url.toLocalFile ());
@@ -1172,7 +1172,7 @@ QString RKCommandHighlighter::commandToHTML (const QString r_command, Highlighti
 	if (!iface) return (QString ("<pre>") + r_command + "</pre>");
 
 	doc->setText (r_command);
-	if (r_command.endsWith ("\n")) doc->removeLine (doc->lines () - 1);
+	if (r_command.endsWith ('\n')) doc->removeLine (doc->lines () - 1);
 	setHighlighting (doc, mode);
 	QString ret;
 
@@ -1216,7 +1216,7 @@ QString RKCommandHighlighter::commandToHTML (const QString r_command, Highlighti
 					ret.append (opening.arg ("output_normal"));
 					previous_chunk = Output;
 				}
-				ret.append (Qt::escape (line) + "\n");	// don't copy output "highlighting". It is set using CSS, instead
+				ret.append (Qt::escape (line) + '\n');	// don't copy output "highlighting". It is set using CSS, instead
 				continue;
 			}
 		}
diff --git a/rkward/windows/rkdebugmessagewindow.cpp b/rkward/windows/rkdebugmessagewindow.cpp
index 23cb71f..ce2599f 100644
--- a/rkward/windows/rkdebugmessagewindow.cpp
+++ b/rkward/windows/rkdebugmessagewindow.cpp
@@ -137,6 +137,6 @@ void RKDebugMessageWindowWidget::newMessage (const int flags, const int level, c
 	}
 	message_viewer->setTextColor (Qt::black);
 
-	message_viewer->insertPlainText (message + "\n");
+	message_viewer->insertPlainText (message + '\n');
 }
 
diff --git a/rkward/windows/rkhelpsearchwindow.cpp b/rkward/windows/rkhelpsearchwindow.cpp
index e6f9e7e..3038bb1 100644
--- a/rkward/windows/rkhelpsearchwindow.cpp
+++ b/rkward/windows/rkhelpsearchwindow.cpp
@@ -199,7 +199,7 @@ void RKHelpSearchWindow::slotFindButtonClicked () {
 
 	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 = ".rk.get.search.results (" + RObject::rQuote (field->currentText ()) + ", agrep=" + agrep + ", ignore.case=" + ignoreCase + package + ", fields=" + fields + ')';
 	
 	RKGlobals::rInterface ()->issueCommand (s, RCommand::App | RCommand::Sync | RCommand::GetStringVector, QString::null, this, HELP_SEARCH, 0);
 	setEnabled (false);
@@ -255,7 +255,7 @@ void RKHelpSearchWindow::rCommandDone (RCommand *command) {
 		setEnabled(true);
 	} else if (command->getFlags () == GET_HELP) {
 		if (command->failed ()) {
-			KMessageBox::sorry (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"));
+			KMessageBox::sorry (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"));
 		}
 	} else {
 		RK_ASSERT (false);
diff --git a/rkward/windows/rkwindowcatcher.cpp b/rkward/windows/rkwindowcatcher.cpp
index d0fa9e1..333462b 100644
--- a/rkward/windows/rkwindowcatcher.cpp
+++ b/rkward/windows/rkwindowcatcher.cpp
@@ -445,7 +445,7 @@ void RKCaughtX11Window::setFixedSizeManual () {
 void RKCaughtX11Window::activateDevice () {
 	RK_TRACE (MISC);
 
-	RKGlobals::rInterface ()->issueCommand ("dev.set (" + QString::number (device_number) + ")", RCommand::App, i18n ("Activate graphics device number %1", device_number), error_dialog);
+	RKGlobals::rInterface ()->issueCommand ("dev.set (" + QString::number (device_number) + ')', RCommand::App, i18n ("Activate graphics device number %1", device_number), error_dialog);
 }
 
 void RKCaughtX11Window::copyDeviceToOutput () {
@@ -459,7 +459,7 @@ void RKCaughtX11Window::printDevice () {
 
 	QString printer_device;
 	if (RKSettingsModuleGraphics::kdePrintingEnabled ()) printer_device = "rk.printer.device";
-	RKGlobals::rInterface ()->issueCommand ("dev.set (" + QString::number (device_number) + ")\ndev.print (" + printer_device + ")", RCommand::App, i18n ("Print contents of graphics device number %1", device_number), error_dialog);
+	RKGlobals::rInterface ()->issueCommand ("dev.set (" + QString::number (device_number) + ")\ndev.print (" + printer_device + ')', RCommand::App, i18n ("Print contents of graphics device number %1", device_number), error_dialog);
 }
 
 void RKCaughtX11Window::copyDeviceToRObject () {
@@ -494,7 +494,7 @@ void RKCaughtX11Window::copyDeviceToRObject () {
 void RKCaughtX11Window::duplicateDevice () {
 	RK_TRACE (MISC);
 
-	RKGlobals::rInterface ()->issueCommand ("rk.duplicate.device (" + QString::number (device_number) + ")", RCommand::App, i18n ("Duplicate graphics device number %1", device_number), error_dialog);
+	RKGlobals::rInterface ()->issueCommand ("rk.duplicate.device (" + QString::number (device_number) + ')', RCommand::App, i18n ("Duplicate graphics device number %1", device_number), error_dialog);
 }
 
 void RKCaughtX11Window::nextPlot () {
@@ -560,7 +560,7 @@ void RKCaughtX11Window::clearHistory () {
 void RKCaughtX11Window::showPlotInfo () {
 	RK_TRACE (MISC);
 
-	RKGlobals::rInterface ()->issueCommand ("rk.show.plot.info (" + QString::number (device_number) + ")", RCommand::App, i18n ("Plot properties (device number %1)", device_number), error_dialog);
+	RKGlobals::rInterface ()->issueCommand ("rk.show.plot.info (" + QString::number (device_number) + ')', 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 40f7985..ea3ffd5 100644
--- a/rkward/windows/rkworkplace.cpp
+++ b/rkward/windows/rkworkplace.cpp
@@ -619,7 +619,7 @@ void RKWorkplace::saveWorkplace (RCommandChain *chain) {
 // standard KConfig format.
 	if (RKSettingsModuleGeneral::workplaceSaveMode () != RKSettingsModuleGeneral::SaveWorkplaceWithWorkspace) return;
 
-	RKGlobals::rInterface ()->issueCommand ("rk.save.workplace(description=" + RObject::rQuote (makeWorkplaceDescription().join ("\n")) + ")", RCommand::App, i18n ("Save Workplace layout"), 0, 0, chain);
+	RKGlobals::rInterface ()->issueCommand ("rk.save.workplace(description=" + RObject::rQuote (makeWorkplaceDescription().join ("\n")) + ')', RCommand::App, i18n ("Save Workplace layout"), 0, 0, chain);
 }
 
 void RKWorkplace::restoreWorkplace (RCommandChain *chain, bool merge) {



More information about the rkward-tracker mailing list