@@ -1204,7 +1204,7 @@ namespace Files {
12041204 location = slot. directory. file. get_target_location ();
12051205 }
12061206
1207- window . bookmark_uri ( location. get_uri ());
1207+ BookmarkList . get_instance () . insert_uri_at_end ( location. get_uri (), " " );
12081208 }
12091209
12101210 /* * Background actions */
@@ -2055,6 +2055,9 @@ namespace Files {
20552055 ));
20562056 }
20572057
2058+ var bookmark_action = (SimpleAction ) common_actions. lookup_action (" bookmark" );
2059+ var bookmark_list = BookmarkList . get_instance ();
2060+
20582061 if (get_selected_files () != null ) { // Add selection actions
20592062 var cut_menuitem = new Gtk .MenuItem ();
20602063 cut_menuitem. add (new Granite .AccelLabel (
@@ -2210,10 +2213,12 @@ namespace Files {
22102213 menu. add (rename_menuitem);
22112214 }
22122215
2213- /* Do not offer to bookmark if location is already bookmarked */
2214- if (common_actions . get_action_enabled ( " bookmark " ) &&
2215- window . can_bookmark_uri (selected_files . data . uri)) {
2216+ var already_bookmarked = bookmark_list . contains (
2217+ new Bookmark .from_uri (selected_files . data . uri, " " )
2218+ );
22162219
2220+ /* Do not offer to bookmark if location is already bookmarked */
2221+ if (common_actions. get_action_enabled (" bookmark" ) && ! already_bookmarked) {
22172222 menu. add (bookmark_menuitem);
22182223 }
22192224
@@ -2270,9 +2275,12 @@ namespace Files {
22702275 menu. add (new SortSubMenuItem ());
22712276 }
22722277
2278+ var already_bookmarked = bookmark_list. contains (
2279+ new Bookmark .from_uri (slot. directory. file. uri, " " )
2280+ );
2281+
22732282 /* Do not offer to bookmark if location is already bookmarked */
2274- if (common_actions. get_action_enabled (" bookmark" ) &&
2275- window. can_bookmark_uri (slot. directory. file. uri)) {
2283+ if (common_actions. get_action_enabled (" bookmark" ) && ! already_bookmarked) {
22762284
22772285 menu. add (bookmark_menuitem);
22782286 }
0 commit comments