Change in kio[master]: Fix build failure on Qt 5.3

Jan Kundrát (Code Review) noreply at kde.org
Thu Aug 13 22:26:51 UTC 2015


Jan Kundrát has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/490

Change subject: Fix build failure on Qt 5.3
......................................................................

Fix build failure on Qt 5.3

This got introduced in commit 4ce4fbe22fdb385f6c07acfd746b31362a4d5d8a ;
QVector::removeOne is a 5.4 thing.

Change-Id: Ic45128e7ea1718b5a30d9fffacc7272592f93fba
---
M src/filewidgets/kfileplacesmodel.cpp
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/kio refs/changes/90/490/1

diff --git a/src/filewidgets/kfileplacesmodel.cpp b/src/filewidgets/kfileplacesmodel.cpp
index b7484c0..ba4fd50 100644
--- a/src/filewidgets/kfileplacesmodel.cpp
+++ b/src/filewidgets/kfileplacesmodel.cpp
@@ -333,7 +333,9 @@
 
 void KFilePlacesModel::Private::_k_deviceRemoved(const QString &udi)
 {
-    if (availableDevices.removeOne(udi)) {
+    QVector<QString>::iterator it = std::find(availableDevices.begin(), availableDevices.end(), udi);
+    if (it != availableDevices.end()) {
+        availableDevices.erase(it);
         _k_reloadBookmarks();
     }
 }
@@ -431,7 +433,11 @@
     while (!bookmark.isNull()) {
         QString udi = bookmark.metaDataItem("UDI");
         QString appName = bookmark.metaDataItem("OnlyInApp");
-        bool deviceAvailable = devices.removeOne(udi);
+        QVector<QString>::iterator it = std::find(devices.begin(), devices.end(), udi);
+        bool deviceAvailable = (it != devices.end());
+        if (it != devices.end()) {
+            devices.erase(it);
+        }
 
         bool allowedHere = appName.isEmpty() || (appName == QCoreApplication::instance()->applicationName());
 

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/490
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic45128e7ea1718b5a30d9fffacc7272592f93fba
Gerrit-PatchSet: 1
Gerrit-Project: kio
Gerrit-Branch: master
Gerrit-Owner: Jan Kundrát <jkt at kde.org>


More information about the Kde-frameworks-devel mailing list