From 12215d6f0f7768fc943347a349d9817844e0528a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 2 Jun 2012 15:02:34 +0200 Subject: Use PlacesItemModel instead of KFilePlacesModel This allows inserting items to the corresponding group. --- src/panels/places/placesitem.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/panels/places/placesitem.cpp') 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; } -- cgit v1.3.1