]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Explicitly pass iconNameForUrl when creating new places entry
authorKai Uwe Broulik <kde@privat.broulik.de>
Tue, 3 Jan 2017 08:46:43 +0000 (09:46 +0100)
committerKai Uwe Broulik <kde@privat.broulik.de>
Tue, 3 Jan 2017 08:46:43 +0000 (09:46 +0100)
Once KIO::iconNameForUrl returns special icons for standard paths (e.g. Video folder)
this will ensure when adding such a folder to places it will automatically get the proper icon.

Since KIO already depends on KBookmarks it can't depend the other way round, otherwise
this would have been fixed in KBookmarks directly.

Differential Revision: https://phabricator.kde.org/D3896

src/dolphincontextmenu.cpp

index ed3f64379ed0bc0a0025f3fbf38f7a9d03434691..666b81c8d6c17b5b16ffef2bc96fb1f3578a7428 100644 (file)
@@ -307,7 +307,7 @@ void DolphinContextMenu::openItemContextMenu()
             if (selectedUrl.isValid()) {
                 PlacesItemModel model;
                 const QString text = selectedUrl.fileName();
-                PlacesItem* item = model.createPlacesItem(text, selectedUrl);
+                PlacesItem* item = model.createPlacesItem(text, selectedUrl, KIO::iconNameForUrl(selectedUrl));
                 model.appendItemToGroup(item);
                 model.saveBookmarks();
             }
@@ -373,7 +373,8 @@ void DolphinContextMenu::openViewportContextMenu()
         if (container->url().isValid()) {
             PlacesItemModel model;
             PlacesItem* item = model.createPlacesItem(container->placesText(),
-                                                      container->url());
+                                                      container->url(),
+                                                      KIO::iconNameForUrl(container->url()));
             model.appendItemToGroup(item);
             model.saveBookmarks();
         }