summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/designer/src/lib/shared/qtresourcemodel.cpp4
-rw-r--r--src/designer/src/lib/shared/qtresourceview.cpp7
2 files changed, 6 insertions, 5 deletions
diff --git a/src/designer/src/lib/shared/qtresourcemodel.cpp b/src/designer/src/lib/shared/qtresourcemodel.cpp
index 92c15cd36..4b08f3670 100644
--- a/src/designer/src/lib/shared/qtresourcemodel.cpp
+++ b/src/designer/src/lib/shared/qtresourcemodel.cpp
@@ -473,7 +473,7 @@ QStringList QtResourceModel::loadedQrcFiles() const
bool QtResourceModel::isModified(const QString &path) const
{
- QMap<QString, bool>::const_iterator it = d_ptr->m_pathToModified.find(path);
+ QMap<QString, bool>::const_iterator it = d_ptr->m_pathToModified.constFind(path);
if (it != d_ptr->m_pathToModified.constEnd())
return it.value();
return true;
@@ -481,7 +481,7 @@ bool QtResourceModel::isModified(const QString &path) const
void QtResourceModel::setModified(const QString &path)
{
- QMap<QString, bool>::const_iterator itMod = d_ptr->m_pathToModified.find(path);
+ QMap<QString, bool>::const_iterator itMod = d_ptr->m_pathToModified.constFind(path);
if (itMod == d_ptr->m_pathToModified.constEnd())
return;
diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp
index a64b99000..00a656410 100644
--- a/src/designer/src/lib/shared/qtresourceview.cpp
+++ b/src/designer/src/lib/shared/qtresourceview.cpp
@@ -658,13 +658,14 @@ void QtResourceView::selectResource(const QString &resource)
if (fi.isDir())
dir = QDir(resource);
QString dirPath = dir.absolutePath();
- QMap<QString, QTreeWidgetItem *>::const_iterator it;
- while ((it = d_ptr->m_pathToItem.find(dirPath)) == d_ptr->m_pathToItem.constEnd()) {
+ const auto cend = d_ptr->m_pathToItem.constEnd();
+ auto it = cend;
+ while ((it = d_ptr->m_pathToItem.constFind(dirPath)) == cend) {
if (!dir.cdUp())
break;
dirPath = dir.absolutePath();
}
- if (it != d_ptr->m_pathToItem.constEnd()) {
+ if (it != cend) {
QTreeWidgetItem *treeItem = it.value();
d_ptr->m_treeWidget->setCurrentItem(treeItem);
d_ptr->m_treeWidget->scrollToItem(treeItem);