mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Mod clazy checks range-loop
you're using C++11 range-loops with non-const Qt containers (potential detach). adding missing &
This commit is contained in:
@@ -282,9 +282,8 @@ void FileElementCollectionItem::setUpData()
|
||||
ElementsLocation loc(collectionPath());
|
||||
DiagramContext context = loc.elementInformations();
|
||||
QStringList search_list;
|
||||
for (QString key : context.keys()) {
|
||||
search_list.append(context.value(key).toString());
|
||||
}
|
||||
for (QString& key : context.keys())
|
||||
{ search_list.append(context.value(key).toString()); }
|
||||
search_list.append(localName(loc));
|
||||
setData(search_list.join(" "));
|
||||
}
|
||||
@@ -352,8 +351,8 @@ void FileElementCollectionItem::populate(bool set_data, bool hide_element)
|
||||
QDir dir (fileSystemPath());
|
||||
|
||||
//Get all directory in this directory.
|
||||
for(auto str : dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot,
|
||||
QDir::Name))
|
||||
for (auto& str :
|
||||
dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name))
|
||||
{
|
||||
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
||||
appendRow(feci);
|
||||
@@ -367,8 +366,8 @@ void FileElementCollectionItem::populate(bool set_data, bool hide_element)
|
||||
|
||||
//Get all elmt file in this directory
|
||||
dir.setNameFilters(QStringList() << "*.elmt");
|
||||
for(auto str : dir.entryList(QDir::Files | QDir::NoDotAndDotDot,
|
||||
QDir::Name))
|
||||
for (auto& str :
|
||||
dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name))
|
||||
{
|
||||
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
||||
appendRow(feci);
|
||||
|
||||
Reference in New Issue
Block a user