X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/9aee5d22513f0367febab54b38b3a7dc58d120bb..d094c8ffe64d226d5afef50693a3bb04b360ed7b:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 27ad19924..0830d4b8b 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -305,6 +305,7 @@ void DolphinContextMenu::openItemContextMenu() const QString text = selectedUrl.fileName(); PlacesItem* item = model.createPlacesItem(text, selectedUrl); model.appendItemToGroup(item); + model.saveBookmarks(); } } else if (activatedAction == openParentAction) { m_command = OpenParentFolder; @@ -370,6 +371,7 @@ void DolphinContextMenu::openViewportContextMenu() PlacesItem* item = model.createPlacesItem(container->placesText(), container->url()); model.appendItemToGroup(item); + model.saveBookmarks(); } } } @@ -425,16 +427,11 @@ void DolphinContextMenu::addShowMenuBarAction() bool DolphinContextMenu::placeExists(const QUrl& url) const { - PlacesItemModel model; - - const int count = model.count(); - for (int i = 0; i < count; ++i) { - const QUrl placeUrl = model.placesItem(i)->url(); - if (placeUrl.matches(url, QUrl::StripTrailingSlash)) { - return true; - } - } - + // Creating up a PlacesItemModel to find out if 'url' is one of the Places + // can be expensive because the model asks Solid for the devices which are + // available, which can take some time. + // TODO: Consider restoring this check if the handling of Places and devices + // will be decoupled in the future. return false; }