┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2012-09-20 17:56:00 +0200
committerEmmanuel Pescosta <[email protected]>2012-09-20 17:56:00 +0200
commit4855b582b48beafd99c13f591bb9c814807c812d (patch)
tree55a27bf81f73e7b575937842d2a3a44997c473e8 /src
parent580bcae62c1b0de6b7c6be42f68ead5c6d6c9d19 (diff)
Fixes Bug 304878 - Dolphin shows "ghost" folders in places after autofs umount nfs shares
BUG: 304878 REVIEW: 106456 FIXED-IN: 4.9.2
Diffstat (limited to 'src')
-rw-r--r--src/panels/places/placesitemmodel.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp
index bd50c9a4b..706092bc7 100644
--- a/src/panels/places/placesitemmodel.cpp
+++ b/src/panels/places/placesitemmodel.cpp
@@ -659,11 +659,22 @@ void PlacesItemModel::updateBookmarks()
}
if (!found) {
- PlacesItem* item = new PlacesItem(newBookmark);
- if (item->isHidden() && !m_hiddenItemsShown) {
- m_bookmarkedItems.append(item);
- } else {
- appendItemToGroup(item);
+ const QString udi = newBookmark.metaDataItem("UDI");
+
+ /*
+ * See Bug 304878
+ * Only add a new places item, if the item text is not empty
+ * and if the device is available. Fixes the strange behaviour -
+ * add a places item without text in the Places section - when you
+ * remove a device (e.g. a usb stick) without unmounting.
+ */
+ if (udi.isEmpty() || Solid::Device(udi).isValid()) {
+ PlacesItem* item = new PlacesItem(newBookmark);
+ if (item->isHidden() && !m_hiddenItemsShown) {
+ m_bookmarkedItems.append(item);
+ } else {
+ appendItemToGroup(item);
+ }
}
}
}