┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/places/placesitemmodel.cpp
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <[email protected]>2017-12-20 15:26:35 -0300
committerRenato Araujo Oliveira Filho <[email protected]>2018-01-08 08:52:38 -0300
commit94b2b2a2dbd3b861f74277b273ab268f28e8678a (patch)
tree332e483d1b6a16ee4ff85bc17c98afad8a10e960 /src/panels/places/placesitemmodel.cpp
parenta6ed2e7b6b6499c32f47d484f8deb47c505cddbc (diff)
Fix PlacesItemModel loading with hidden devices
Summary: Make sure that hidden devices loaded after module initialization does not appear in the view. Check for item visibility before add it on the model. Test Plan: Unit test created Reviewers: franckarrecot Reviewed By: franckarrecot Subscribers: cfeck, ervin, #dolphin Differential Revision: https://phabricator.kde.org/D9441
Diffstat (limited to 'src/panels/places/placesitemmodel.cpp')
-rw-r--r--src/panels/places/placesitemmodel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp
index 577596c74..b23877629 100644
--- a/src/panels/places/placesitemmodel.cpp
+++ b/src/panels/places/placesitemmodel.cpp
@@ -392,6 +392,10 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData)
void PlacesItemModel::addItemFromSourceModel(const QModelIndex &index)
{
+ if (!m_hiddenItemsShown && m_sourceModel->isHidden(index)) {
+ return;
+ }
+
const KBookmark bookmark = m_sourceModel->bookmarkForIndex(index);
Q_ASSERT(!bookmark.isNull());
PlacesItem *item = new PlacesItem(bookmark);