From kde-commits Wed Sep 30 23:17:14 2009 From: David Faure Date: Wed, 30 Sep 2009 23:17:14 +0000 To: kde-commits Subject: playground/utils Message-Id: <1254352634.985243.5617.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125435264421817 SVN commit 1029869 by dfaure: strict iterators fixes (prevents unwanted detaching) M +1 -1 filelight/src/part/remoteLister.cpp M +2 -2 kconfigeditor/src/kconfigeditorsearchline.cpp M +2 -2 kconfigeditor/src/propertyeditor/multiproperty.cpp M +2 -2 kconfigeditor/src/propertyeditor/pcombobox.cpp M +2 -2 kconfigeditor/src/propertyeditor/propertylist.cpp --- trunk/playground/utils/filelight/src/part/remoteLister.cpp #1029868:1029869 @@ -128,7 +128,7 @@ { //m_directory is set to the directory we should operate on - KFileItemList items = KDirLister::items(); + const KFileItemList items = KDirLister::items(); for (KFileItemList::ConstIterator it = items.begin(), end = items.end(); it != end; ++it) { if (it->isDir()) --- trunk/playground/utils/kconfigeditor/src/kconfigeditorsearchline.cpp #1029868:1029869 @@ -188,8 +188,8 @@ // specifified. If it is empty default to searching all of the columns. if (!d->searchColumns.isEmpty()) { - QList::ConstIterator it = d->searchColumns.begin(); - for (; it != d->searchColumns.end(); ++it) { + QList::ConstIterator it = d->searchColumns.constBegin(); + for (; it != d->searchColumns.constEnd(); ++it) { if (*it < item->listView()->columns() && item->text(*it).indexOf(s, 0, d->caseSensitive) >= 0) return true; --- trunk/playground/utils/kconfigeditor/src/propertyeditor/multiproperty.cpp #1029868:1029869 @@ -223,7 +223,7 @@ if (type() != Property::ValueFromList) return val; QMap vl = valueList(); - for (QMap::const_iterator it = vl.begin(); it != vl.end(); ++ it) { + for (QMap::const_iterator it = vl.constBegin(); it != vl.constEnd(); ++ it) { if (*it == val) return it.key(); } @@ -235,7 +235,7 @@ if (type() != Property::ValueFromList) return val; QMap vl = valueList(); - for (QMap::const_iterator it = vl.begin(); it != vl.end(); ++ it) { + for (QMap::const_iterator it = vl.constBegin(); it != vl.constEnd(); ++ it) { if (*it == val) return it.key(); } --- trunk/playground/utils/kconfigeditor/src/propertyeditor/pcombobox.cpp #1029868:1029869 @@ -55,7 +55,7 @@ void PComboBox::fillBox() { - for (QMap::const_iterator it = m_valueList.begin(); it != m_valueList.end(); it++) { + for (QMap::const_iterator it = m_valueList.constBegin(); it != m_valueList.constEnd(); it++) { m_edit->addItem(it.key()); } } @@ -86,7 +86,7 @@ QString PComboBox::findDescription(const QVariant &value) { - for (QMap::const_iterator it = m_valueList.begin(); it != m_valueList.end(); ++ it) { + for (QMap::const_iterator it = m_valueList.constBegin(); it != m_valueList.constEnd(); ++ it) { if (*it == value) return it.key(); } --- trunk/playground/utils/kconfigeditor/src/propertyeditor/propertylist.cpp #1029868:1029869 @@ -215,8 +215,8 @@ : PropertyList(false) { //deep copy of m_list - for (QMap::const_iterator it = list->m_list.begin(); - it != list->m_list.end(); ++it) { + for (QMap::const_iterator it = list->m_list.constBegin(); + it != list->m_list.constEnd(); ++it) { MultiProperty *mp = new MultiProperty(*(it.value())); mp->m_propertyList = this; addToGroup(list->m_groupOfProperty[*it], mp);