diff options
| author | Peter Penz <[email protected]> | 2012-06-02 15:02:34 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-06-02 15:03:22 +0200 |
| commit | 12215d6f0f7768fc943347a349d9817844e0528a (patch) | |
| tree | 76db3b0f6c32900b397246de3c8f731c703708f3 /src/panels/places/placesitem.cpp | |
| parent | 665c44821e32ba4bdfcd94889eb17e08ac25a315 (diff) | |
Use PlacesItemModel instead of KFilePlacesModel
This allows inserting items to the corresponding group.
Diffstat (limited to 'src/panels/places/placesitem.cpp')
| -rw-r--r-- | src/panels/places/placesitem.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index 7a5daff8e..191f8b277 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -125,6 +125,7 @@ void PlacesItem::setBookmark(const KBookmark& bookmark) delete m_volume; delete m_disc; + const QString udi = bookmark.metaDataItem("UDI"); if (udi.isEmpty()) { setIcon(bookmark.icon()); @@ -134,7 +135,18 @@ void PlacesItem::setBookmark(const KBookmark& bookmark) initializeDevice(udi); } - switch (groupType()) { + const GroupType type = groupType(); + if (icon().isEmpty()) { + switch (type) { + case RecentlyAccessedType: setIcon("package_utility_time"); break; + case SearchForType: setIcon("nepomuk"); break; + case PlacesType: + default: setIcon("folder"); + } + + } + + switch (type) { case PlacesType: setGroup(i18nc("@item", "Places")); break; case RecentlyAccessedType: setGroup(i18nc("@item", "Recently Accessed")); break; case SearchForType: setGroup(i18nc("@item", "Search For")); break; @@ -158,7 +170,7 @@ PlacesItem::GroupType PlacesItem::groupType() const return RecentlyAccessedType; } - if (protocol == QLatin1String("search")) { + if (protocol.contains(QLatin1String("search"))) { return SearchForType; } |
