Commit 46278bcf authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Fix compilation with clang13

parent c05be195
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -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 ());
}
......
......@@ -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));
}
......
......@@ -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;
......
......@@ -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 () + "\"");
......
......@@ -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)
......
......@@ -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
......
......@@ -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 ());
}
}
......
......@@ -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 ());
}
......
......@@ -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 ());
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment