[education/rkward] rkward: Fix compilation with clang13
Waqar Ahmed
null at kde.org
Fri Mar 18 06:23:43 GMT 2022
Git commit 46278bcff55b83f63fcc8d5d7536c3c00dc2b4d2 by Waqar Ahmed.
Committed on 18/03/2022 at 05:26.
Pushed by tfry into branch 'master'.
Fix compilation with clang13
M +1 -1 rkward/misc/rkprogresscontrol.cpp
M +2 -2 rkward/misc/rkxmlguisyncer.cpp
M +5 -5 rkward/plugin/rkabstractoptionselector.cpp
M +5 -5 rkward/plugin/rkcomponentmap.cpp
M +1 -1 rkward/plugin/rkcomponentproperties.cpp
M +8 -8 rkward/plugin/rkformula.cpp
M +2 -2 rkward/plugin/rkoptionset.cpp
M +1 -1 rkward/rbackend/rkrinterface.cpp
M +1 -1 rkward/settings/rksettingsmodulegraphics.cpp
M +1 -1 rkward/settings/rksettingsmoduleoutput.cpp
M +2 -2 rkward/settings/rksettingsmoduler.cpp
https://invent.kde.org/education/rkward/commit/46278bcff55b83f63fcc8d5d7536c3c00dc2b4d2
diff --git a/rkward/misc/rkprogresscontrol.cpp b/rkward/misc/rkprogresscontrol.cpp
index 8fc3c726..068ee148 100644
--- a/rkward/misc/rkprogresscontrol.cpp
+++ b/rkward/misc/rkprogresscontrol.cpp
@@ -169,7 +169,7 @@ void RKProgressControl::dialogDestroyed () {
if ((!is_done) && (mode & AllowCancel)) {
is_done = true;
if (mode & AutoCancelCommands) {
- for (RCommandList::const_iterator it = outstanding_commands.begin (); it != outstanding_commands.end (); ++it) {
+ for (RCommandList::const_iterator it = outstanding_commands.cbegin (); it != outstanding_commands.cend (); ++it) {
RKGlobals::rInterface ()->cancelCommand (*it);
}
}
diff --git a/rkward/misc/rkxmlguisyncer.cpp b/rkward/misc/rkxmlguisyncer.cpp
index 02c41496..766d06be 100644
--- a/rkward/misc/rkxmlguisyncer.cpp
+++ b/rkward/misc/rkxmlguisyncer.cpp
@@ -85,7 +85,7 @@ void RKXMLGUISyncerPrivate::uiRcFileChanged (const QString &path) {
RK_ASSERT (client_map.contains (path));
// find affected clients and reload them
- QMultiHash<QString, KActionCollection*>::const_iterator i = client_map.find(path);
+ QMultiHash<QString, KActionCollection*>::const_iterator i = client_map.constFind(path);
while (i != client_map.constEnd() && i.key() == path) {
KXMLGUIClient *client = const_cast<KXMLGUIClient*> (i.value ()->parentGUIClient ());
if (!client) {
@@ -101,7 +101,7 @@ void RKXMLGUISyncerPrivate::uiRcFileChanged (const QString &path) {
}
// find notifiers listening for this client
- QMultiHash<KActionCollection*, RKXMLGUISyncerNotifier*>::const_iterator n = notifier_map.find(i.value ());
+ QMultiHash<KActionCollection*, RKXMLGUISyncerNotifier*>::const_iterator n = notifier_map.constFind(i.value ());
while (n != notifier_map.constEnd() && n.key() == i.value ()) {
n.value ()->emitChangeSignal (client);
++n;
diff --git a/rkward/plugin/rkabstractoptionselector.cpp b/rkward/plugin/rkabstractoptionselector.cpp
index d9b7ce6e..c87569c9 100644
--- a/rkward/plugin/rkabstractoptionselector.cpp
+++ b/rkward/plugin/rkabstractoptionselector.cpp
@@ -36,7 +36,7 @@ RKAbstractOptionSelector::RKAbstractOptionSelector (RKComponent *parent_componen
RKAbstractOptionSelector::~RKAbstractOptionSelector(){
RK_TRACE (PLUGIN);
- for (OptionsMap::const_iterator it = options.begin(); it != options.end(); ++it) {
+ for (OptionsMap::const_iterator it = options.cbegin(); it != options.cend(); ++it) {
delete (it.value ());
}
}
@@ -51,7 +51,7 @@ void RKAbstractOptionSelector::addOptionsAndInit (const QDomElement &element) {
XMLChildList option_elements = xml->getChildElements (element, "option", DL_ERROR);
int selected = 0;
int i = 0;
- for (XMLChildList::const_iterator it = option_elements.begin (); it != option_elements.end (); ++it) {
+ for (XMLChildList::const_iterator it = option_elements.cbegin (); it != option_elements.cend (); ++it) {
QString label = xml->i18nStringAttribute (*it, "label", QString (), DL_ERROR);
QString value = xml->getStringAttribute (*it, "value", QString (), DL_WARNING);
QString name = xml->getStringAttribute (*it, "id", QString (), DL_INFO);
@@ -145,7 +145,7 @@ void RKAbstractOptionSelector::ItemPropertyChanged (RKComponentPropertyBase *pro
Option *opt = 0;
int id = -1;
- for (OptionsMap::const_iterator it = options.begin(); it != options.end(); ++it) {
+ for (OptionsMap::const_iterator it = options.cbegin(); it != options.cend(); ++it) {
RK_ASSERT (it.value ());
if (it.value ()->enabledness_prop == property) {
opt = it.value ();
@@ -165,7 +165,7 @@ void RKAbstractOptionSelector::ItemPropertyChanged (RKComponentPropertyBase *pro
if (!enabled) {
if (id == number->intValue ()) { // current item was disabled
int settable_opt = -1;
- for (OptionsMap::const_iterator it = options.begin(); it != options.end(); ++it) {
+ for (OptionsMap::const_iterator it = options.cbegin(); it != options.cend(); ++it) {
RK_ASSERT (it.value ());
if ((!(it.value ()->enabledness_prop)) || (it.value ()->enabledness_prop->boolValue ())) {
@@ -195,7 +195,7 @@ void RKAbstractOptionSelector::itemSelected (int id) {
int RKAbstractOptionSelector::findOption (const QString &option_string) {
RK_TRACE (PLUGIN);
- for (OptionsMap::const_iterator it = options.begin(); it != options.end(); ++it) {
+ for (OptionsMap::const_iterator it = options.cbegin(); it != options.cend(); ++it) {
RK_ASSERT (it.value ());
if (it.value ()->value == option_string) return (it.key ());
}
diff --git a/rkward/plugin/rkcomponentmap.cpp b/rkward/plugin/rkcomponentmap.cpp
index 8ef774b3..ad674e9b 100644
--- a/rkward/plugin/rkcomponentmap.cpp
+++ b/rkward/plugin/rkcomponentmap.cpp
@@ -641,7 +641,7 @@ RKPluginMapParseResult RKComponentMap::addPluginMap (const QString& plugin_map_f
QSet<QString> local_components;
QSet<QString> depfailed_local_components;
- for (XMLChildList::const_iterator it=list.begin (); it != list.end (); ++it) {
+ for (XMLChildList::const_iterator it=list.cbegin (); it != list.cend (); ++it) {
QString id = cnamespace + xml.getStringAttribute((*it), "id", QString (), DL_WARNING);
// check dependencies, first
@@ -670,7 +670,7 @@ RKPluginMapParseResult RKComponentMap::addPluginMap (const QString& plugin_map_f
// create and initialize component handle
RKComponentHandle *handle = new RKComponentHandle (pluginmap_file_desc, filename, label);
XMLChildList attributes_list = xml.getChildElements (*it, "attribute", DL_DEBUG);
- for (XMLChildList::const_iterator ait=attributes_list.begin (); ait != attributes_list.end (); ++ait) {
+ for (XMLChildList::const_iterator ait=attributes_list.cbegin (); ait != attributes_list.cend (); ++ait) {
handle->addAttribute (xml.getStringAttribute (*ait, "id", "noid", DL_WARNING), xml.getStringAttribute (*ait, "value", QString (), DL_ERROR), xml.i18nStringAttribute (*ait, "label", QString (), DL_ERROR));
}
if (!cdependencies.isNull ()) handle->addDependencies (RKComponentDependency::parseDependencies (cdependencies, xml));
@@ -800,7 +800,7 @@ RKStandardComponent *RKComponentHandle::invoke (RKComponent *parent_component, Q
QString RKComponentHandle::getAttributeValue (const QString &attribute_id) {
RK_TRACE (PLUGIN);
- QMap<QString, RKComponentMap::AttributeValueMap>::const_iterator it = RKComponentMap::getMap ()->component_attributes.find (attribute_id);
+ QMap<QString, RKComponentMap::AttributeValueMap>::const_iterator it = RKComponentMap::getMap ()->component_attributes.constFind (attribute_id);
if (it == RKComponentMap::getMap ()->component_attributes.constEnd ()) return QString ();
return (*it).valuemap.value (this);
}
@@ -808,7 +808,7 @@ QString RKComponentHandle::getAttributeValue (const QString &attribute_id) {
QString RKComponentHandle::getAttributeLabel (const QString &attribute_id) {
RK_TRACE (PLUGIN);
- QMap<QString, RKComponentMap::AttributeValueMap>::const_iterator it = RKComponentMap::getMap ()->component_attributes.find (attribute_id);
+ QMap<QString, RKComponentMap::AttributeValueMap>::const_iterator it = RKComponentMap::getMap ()->component_attributes.constFind (attribute_id);
if (it == RKComponentMap::getMap ()->component_attributes.constEnd ()) return QString ();
return (*it).labelmap.value (this);
}
@@ -832,7 +832,7 @@ QList <RKComponentDependency> RKComponentHandle::getDependencies () {
RK_TRACE (PLUGIN);
QList <RKComponentDependency> ret = plugin_map->getDependencies ();
- QHash<RKComponentHandle*, QList<RKComponentDependency> >::const_iterator it = RKComponentMap::getMap ()->component_dependencies.find (this);
+ QHash<RKComponentHandle*, QList<RKComponentDependency> >::const_iterator it = RKComponentMap::getMap ()->component_dependencies.constFind (this);
if (it == RKComponentMap::getMap ()->component_dependencies.constEnd ()) return ret;
return (ret + (*it));
}
diff --git a/rkward/plugin/rkcomponentproperties.cpp b/rkward/plugin/rkcomponentproperties.cpp
index 4aa3699d..b043f04e 100644
--- a/rkward/plugin/rkcomponentproperties.cpp
+++ b/rkward/plugin/rkcomponentproperties.cpp
@@ -1022,7 +1022,7 @@ bool RKComponentPropertyRObjects::isStringValid (const QString &value) {
QStringList slist = value.split (sep, QString::SkipEmptyParts);
- for (QStringList::const_iterator it = slist.begin (); it != slist.end (); ++it) {
+ for (QStringList::const_iterator it = slist.cbegin (); it != slist.cend (); ++it) {
RObject *obj = RObjectList::getObjectList ()->findObject (*it);
if (!(obj && checkObjectProblems (obj).isEmpty ())) {
return false;
diff --git a/rkward/plugin/rkformula.cpp b/rkward/plugin/rkformula.cpp
index 280f4e4d..350fab22 100644
--- a/rkward/plugin/rkformula.cpp
+++ b/rkward/plugin/rkformula.cpp
@@ -173,7 +173,7 @@ void RKFormula::makeModelString () {
} else if (!vlist.empty ()) {
container = vlist.first ()->parentObject ();
}
- for (RObject::ObjectList::const_iterator it = vlist.begin (); it != vlist.end (); ++it) {
+ for (RObject::ObjectList::const_iterator it = vlist.cbegin (); it != vlist.cend (); ++it) {
if ((*it)->parentObject () != container) {
multitable = true;
break;
@@ -182,7 +182,7 @@ void RKFormula::makeModelString () {
if (multitable) {
table_string = "data.frame (";
if (dep_var) table_string.append (mangleName (dep_var) + '=' + dep_var->getFullName ());
- for (RObject::ObjectList::const_iterator it = vlist.begin (); it != vlist.end (); ++it) {
+ for (RObject::ObjectList::const_iterator it = vlist.cbegin (); it != vlist.cend (); ++it) {
table_string.append (", " + mangleName ((*it)) + '=' + (*it)->getFullName ());
}
table_string.append (")");
@@ -193,13 +193,13 @@ void RKFormula::makeModelString () {
// construct model string
model_string = mangleName (dep_var) + " ~ ";
if (model_type == FullModel) {
- for (RObject::ObjectList::const_iterator it = vlist.begin (); it != vlist.end (); ++it) {
- if (it != vlist.begin ()) model_string.append (" * ");
+ for (RObject::ObjectList::const_iterator it = vlist.cbegin (); it != vlist.cend (); ++it) {
+ if (it != vlist.cbegin ()) model_string.append (" * ");
model_string.append (mangleName (*it));
}
} else if (model_type == MainEffects) {
- for (RObject::ObjectList::const_iterator it = vlist.begin (); it != vlist.end (); ++it) {
- if (it != vlist.begin ()) model_string.append (" + ");
+ for (RObject::ObjectList::const_iterator it = vlist.cbegin (); it != vlist.cend (); ++it) {
+ if (it != vlist.cbegin ()) model_string.append (" + ");
model_string.append (mangleName (*it));
}
} else if (model_type == Custom) {
@@ -220,8 +220,8 @@ void RKFormula::makeModelString () {
// labels
labels_string = "list (";
MangledNames::const_iterator it;
- for (it = mangled_names.begin (); it != mangled_names.end (); ++it) {
- if (it != mangled_names.begin ()) {
+ for (it = mangled_names.cbegin (); it != mangled_names.cend (); ++it) {
+ if (it != mangled_names.cbegin ()) {
labels_string.append (", ");
}
labels_string.append (it.key () + "=\"" + it.value ()->getDescription () + "\"");
diff --git a/rkward/plugin/rkoptionset.cpp b/rkward/plugin/rkoptionset.cpp
index 9348e21e..5cbd129d 100644
--- a/rkward/plugin/rkoptionset.cpp
+++ b/rkward/plugin/rkoptionset.cpp
@@ -609,7 +609,7 @@ void RKOptionSet::handleKeycolumnUpdate () {
// adjust all positions that have changed
for (int pos = 0; pos < new_keys.size (); ++pos) {
- QMap<int, int>::const_iterator pit = position_changes.find (pos);
+ QMap<int, int>::const_iterator pit = position_changes.constFind (pos);
if (pit != position_changes.constEnd ()) { // some change
int old_pos = pit.value ();
if (old_pos < 0) { // a new key
@@ -630,7 +630,7 @@ void RKOptionSet::handleKeycolumnUpdate () {
QList<RowInfo> new_row_info = rows;
for (int i = (new_keys.size () - new_row_info.size ()); i > 0; --i) new_row_info.append (RowInfo (default_row_state));
for (int pos = 0; pos < new_keys.size (); ++pos) {
- QMap<int, int>::const_iterator pit = position_changes.find (pos);
+ QMap<int, int>::const_iterator pit = position_changes.constFind (pos);
if (pit != position_changes.constEnd ()) { // some change
int old_pos = pit.value ();
if (old_pos < 0) { // a new key (but it might have been known, formerly)
diff --git a/rkward/rbackend/rkrinterface.cpp b/rkward/rbackend/rkrinterface.cpp
index 310c00ab..0310e267 100644
--- a/rkward/rbackend/rkrinterface.cpp
+++ b/rkward/rbackend/rkrinterface.cpp
@@ -314,7 +314,7 @@ void RInterface::rCommandDone (RCommand *command) {
// apply user configurable run time options
QStringList commands = RKSettingsModuleR::makeRRunTimeOptionCommands () + RKSettingsModuleRPackages::makeRRunTimeOptionCommands () + RKSettingsModuleOutput::makeRRunTimeOptionCommands () + RKSettingsModuleGraphics::makeRRunTimeOptionCommands ();
- for (QStringList::const_iterator it = commands.begin (); it != commands.end (); ++it) {
+ for (QStringList::const_iterator it = commands.cbegin (); it != commands.cend (); ++it) {
issueCommand (*it, RCommand::App | RCommand::Sync, QString (), this, SET_RUNTIME_OPTS, chain);
}
// initialize output file
diff --git a/rkward/settings/rksettingsmodulegraphics.cpp b/rkward/settings/rksettingsmodulegraphics.cpp
index d408ea62..6de26533 100644
--- a/rkward/settings/rksettingsmodulegraphics.cpp
+++ b/rkward/settings/rksettingsmodulegraphics.cpp
@@ -179,7 +179,7 @@ void RKSettingsModuleGraphics::applyChanges () {
graphics_hist_enable = graphics_hist_box->isChecked ();
QStringList commands = makeRRunTimeOptionCommands ();
- for (QStringList::const_iterator it = commands.begin (); it != commands.end (); ++it) {
+ for (QStringList::const_iterator it = commands.cbegin (); it != commands.cend (); ++it) {
RKGlobals::rInterface ()->issueCommand (*it, RCommand::App, QString (), 0, 0, commandChain ());
}
}
diff --git a/rkward/settings/rksettingsmoduleoutput.cpp b/rkward/settings/rksettingsmoduleoutput.cpp
index b8031c95..0df899e3 100644
--- a/rkward/settings/rksettingsmoduleoutput.cpp
+++ b/rkward/settings/rksettingsmoduleoutput.cpp
@@ -208,7 +208,7 @@ void RKSettingsModuleOutput::applyChanges () {
graphics_type = graphics_type_box->itemData (graphics_type_box->currentIndex ()).toString ();
QStringList commands = makeRRunTimeOptionCommands ();
- for (QStringList::const_iterator it = commands.begin (); it != commands.end (); ++it) {
+ for (QStringList::const_iterator it = commands.cbegin (); it != commands.cend (); ++it) {
RKGlobals::rInterface ()->issueCommand (*it, RCommand::App, QString (), 0, 0, commandChain ());
}
diff --git a/rkward/settings/rksettingsmoduler.cpp b/rkward/settings/rksettingsmoduler.cpp
index c4636ff2..89690cd6 100755
--- a/rkward/settings/rksettingsmoduler.cpp
+++ b/rkward/settings/rksettingsmoduler.cpp
@@ -204,7 +204,7 @@ void RKSettingsModuleR::applyChanges () {
// apply run time options in R
QStringList commands = makeRRunTimeOptionCommands ();
- for (QStringList::const_iterator it = commands.begin (); it != commands.end (); ++it) {
+ for (QStringList::const_iterator it = commands.cbegin (); it != commands.cend (); ++it) {
RKGlobals::rInterface ()->issueCommand (*it, RCommand::App, QString (), 0, 0, commandChain ());
}
}
@@ -564,7 +564,7 @@ void RKSettingsModuleRPackages::applyChanges () {
// apply options in R
QStringList commands = makeRRunTimeOptionCommands ();
- for (QStringList::const_iterator it = commands.begin (); it != commands.end (); ++it) {
+ for (QStringList::const_iterator it = commands.cbegin (); it != commands.cend (); ++it) {
RKGlobals::rInterface ()->issueCommand (*it, RCommand::App, QString (), 0, 0, commandChain ());
}
}
More information about the rkward-tracker
mailing list