Merge lp:~jeremywootten/pantheon-files/fix-1046336 into lp:~elementary-apps/pantheon-files/trunk
- fix-1046336
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Julián Unrrein | ||||||||
Approved revision: | 1282 | ||||||||
Merged at revision: | 1293 | ||||||||
Proposed branch: | lp:~jeremywootten/pantheon-files/fix-1046336 | ||||||||
Merge into: | lp:~elementary-apps/pantheon-files/trunk | ||||||||
Diff against target: |
314 lines (+50/-51) 3 files modified
libcore/marlin-abstract-sidebar.c (+12/-12) src/marlin-bookmark-list.c (+0/-1) src/marlin-places-sidebar.c (+38/-38) |
||||||||
To merge this branch: | bzr merge lp:~jeremywootten/pantheon-files/fix-1046336 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julián Unrrein (community) | Approve | ||
Review via email: mp+178420@code.launchpad.net |
Commit message
Fix and enable the function to rename a bookmark to fix bug #108376. Fix the situation where some users were not able to drag folders to the sidebar to create bookmarks to fix bug #1046336. In the last situation, also fix not being able to reorder bookmarks by dragging them around.
Description of the change
1) Create bookmarks by dragging and dropping folders onto the side bar.
2) Re-order bookmarks by dragging and dropping within the sidebar
3) Right-clicking on bookmark gives options to remove or rename.
4) Bookmarks that point to non-existent folders are automatically permanently removed NOTE: It should be considered whether this is the desired behaviour. Alternative options are to hide the bookmark or leave it alone.
Julián Unrrein (junrrein) wrote : | # |
Julián Unrrein (junrrein) wrote : | # |
2) I didn't notice this before, but I can re-order bookmarks in current trunk code. Was this not working for you?
Julián Unrrein (junrrein) wrote : | # |
Only code comment:
Diff line 189: Why was PlaceType changed to gint?
Jeremy Wootten (jeremywootten) wrote : | # |
Thanks for the review Julián. No, none of this works for me in the current
trunk (last tried last week-end - revision 1280). I noticed in the comment
to the bug that bookmark creation worked for some and not others -
something to do with 32 bit vs 64 bit users?? I am still on 32 bit :(
I changed PlaceType to gint because the treestore holds the data as gint
and I was getting strange errors comparing the retrieved data with the
placetype otherwise. That's why I introduced the boolean is_bookmark - to
avoid keep making the comparison.
Sorry to have included too many changes - I'll break them up more in future.
On 6 August 2013 20:38, Julián Unrrein <email address hidden> wrote:
> Hi Jeremy
>
> After some testing I can say the following about the implemented features:
>
> 1) Was this feature not working for you before? How did you test this?
> Should we get people from the bug report to test this?
>
> 2) Works as intended. No problems.
>
> 3) Works as intended too.
>
> 4) Bookmarks pointing to non-existent folders are removed only when the
> bookmark list changes (on bookmark creation and deletion).
> I guess your other branch (lp:~jeremywootten/pantheon-files/fix-1207655)
> solves this properly.
> We still have to get confirmation from the design team that this is the
> intended behavior.
>
> Overall, these are nice little things that were sorely needed!
>
> Code review is coming later.
>
> PS: Come on Jeremy, 4 fixes packed in 1 branch? You know our guidelines
> are against that. We will let you get by, one more time :)
>
>
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1046336.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
- 1281. By Jeremy Wootten
-
Disable automatic removal of bookmarks
Jeremy Wootten (jeremywootten) wrote : | # |
On reflection I decided to disable the automatic removal of "non-existent"
bookmarks from the bookmark list, at least for the time being, because it
may not be appropriate to remove bookmarks linked to folders on unmounted
filesystems and, at present, the code does not distinguish between folders
that have truly been deleted and those that are temporarily inaccessible.
Such bookmarks are not hidden now either so that they are not forgotten. I
think it is better to let the used decide whether to keep or remove a
bookmark. I have pushed a new revision.
I'll change the other branch (lp:~jeremywootten/pantheon-files/fix-1207655)
accordingly later.
On 6 August 2013 20:38, Julián Unrrein <email address hidden> wrote:
> Hi Jeremy
>
> After some testing I can say the following about the implemented features:
>
> 1) Was this feature not working for you before? How did you test this?
> Should we get people from the bug report to test this?
>
> 2) Works as intended. No problems.
>
> 3) Works as intended too.
>
> 4) Bookmarks pointing to non-existent folders are removed only when the
> bookmark list changes (on bookmark creation and deletion).
> I guess your other branch (lp:~jeremywootten/pantheon-files/fix-1207655)
> solves this properly.
> We still have to get confirmation from the design team that this is the
> intended behavior.
>
> Overall, these are nice little things that were sorely needed!
>
> Code review is coming later.
>
> PS: Come on Jeremy, 4 fixes packed in 1 branch? You know our guidelines
> are against that. We will let you get by, one more time :)
>
>
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1046336.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
Julián Unrrein (junrrein) wrote : | # |
The issue of not being able to drag bookmarks to the sidebar has been here for a lot of time. As you saw in the bug report, that affects some (but not all) of the users, independently of architecture. The fact that you found out have to fix this is awesome. The PlaceType thing you explained me might be related to the issue.
About the automatic bookmark removal, I understand your concern, but that change doesn't belong in this branch. There shouldn't be anything else aside from fixing the linked bugs.
Please reinstate the existing behavior (diff lines 79-81) and we will leave this issue to the other branch.
Cody Garver (codygarver) wrote : | # |
This is ready to go?
Julián Unrrein (junrrein) wrote : | # |
No. From my previous comment:
"Please reinstate the existing behavior (diff lines 79-81) and we will leave this issue to the other branch."
- 1282. By Jeremy Wootten
-
Reinstate hiding of unavailable bookmarks
Jeremy Wootten (jeremywootten) wrote : | # |
OK, I have reinstated the existing behaviour.
This branch now only address the adding of bookmarks by drag and drop and
the manual removal and editing of bookmarks using the context menu.
There are still flaws in the behaviour when a folder is renamed. The
corresponding bookmark name does not immediately change although it does
change if you restart the program. Also if you reorder the bookmark list
after renaming a folder (but before restarting the program) the
corresponding bookmark will show garbage for about a second and then be
correctly renamed after the automatic saving and reloading of the bookmark
list has completed. Bookmarks that have been manually renamed behave
differently - they become "unavailable" so they are hidden when the
bookmark list is reordered or reloaded.
I will try to address these issues in the other branch.
On 7 August 2013 22:31, Julián Unrrein <email address hidden> wrote:
> The issue of not being able to drag bookmarks to the sidebar has been here
> for a lot of time. As you saw in the bug report, that affects some (but not
> all) of the users, independently of architecture. The fact that you found
> out have to fix this is awesome. The PlaceType thing you explained me might
> be related to the issue.
>
> About the automatic bookmark removal, I understand your concern, but that
> change doesn't belong in this branch. There shouldn't be anything else
> aside from fixing the linked bugs.
>
> Please reinstate the existing behavior (diff lines 79-81) and we will
> leave this issue to the other branch.
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1046336.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
Julián Unrrein (junrrein) wrote : | # |
I tested again. My comments about the "rename folder" functionality:
When a folder is renamed, the bookmark name doesn't change, and clicking on it leads to a non-existent folder.
However, the bookmark item is updated under the conditions you described (restarting Files, or reordering bookmarks).
I agree with you that this is faulty behavior, but the tradeoffs are very much worth it.
Thanks for your work!
Preview Diff
1 | === modified file 'libcore/marlin-abstract-sidebar.c' |
2 | --- libcore/marlin-abstract-sidebar.c 2012-11-06 17:21:39 +0000 |
3 | +++ libcore/marlin-abstract-sidebar.c 2013-08-10 16:49:01 +0000 |
4 | @@ -60,19 +60,19 @@ |
5 | { |
6 | /* this is required to set the category cells to bold and higher than the other ones */ |
7 | self->store = gtk_tree_store_new ((gint) PLACES_SIDEBAR_COLUMN_COUNT, |
8 | - G_TYPE_INT, |
9 | - G_TYPE_STRING, |
10 | + G_TYPE_INT, /* row type */ |
11 | + G_TYPE_STRING, /* uri */ |
12 | G_TYPE_DRIVE, |
13 | G_TYPE_VOLUME, |
14 | G_TYPE_MOUNT, |
15 | - G_TYPE_STRING, |
16 | - G_TYPE_ICON, /* Primary icon */ |
17 | - G_TYPE_INT, |
18 | - G_TYPE_BOOLEAN, |
19 | - G_TYPE_BOOLEAN, |
20 | - G_TYPE_BOOLEAN, |
21 | - G_TYPE_STRING, |
22 | - G_TYPE_ICON, /* Action icon (e.g. eject button) */ |
23 | - G_TYPE_UINT64, /* Free space */ |
24 | - G_TYPE_UINT64); /* For disks, total size */ |
25 | + G_TYPE_STRING, /* name */ |
26 | + G_TYPE_ICON, /* Primary icon */ |
27 | + G_TYPE_INT, /* index */ |
28 | + G_TYPE_BOOLEAN, /* eject */ |
29 | + G_TYPE_BOOLEAN, /* no eject */ |
30 | + G_TYPE_BOOLEAN, /* is bookmark */ |
31 | + G_TYPE_STRING, /* tool tip */ |
32 | + G_TYPE_ICON, /* Action icon (e.g. eject button) */ |
33 | + G_TYPE_UINT64, /* Free space */ |
34 | + G_TYPE_UINT64); /* For disks, total size */ |
35 | } |
36 | |
37 | === modified file 'src/marlin-bookmark-list.c' |
38 | --- src/marlin-bookmark-list.c 2011-11-01 12:09:26 +0000 |
39 | +++ src/marlin-bookmark-list.c 2013-08-10 16:49:01 +0000 |
40 | @@ -520,7 +520,6 @@ |
41 | GList *files = marlin_bookmark_list_get_gof_files (bookmarks); |
42 | gof_call_when_ready_new (files, bookmark_list_content_changed, bookmarks); |
43 | g_list_free (files); |
44 | - |
45 | g_signal_emit (bookmarks, signals[CONTENTS_CHANGED], 0); |
46 | } else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { |
47 | g_warning ("Could not load bookmark file: %s\n", error->message); |
48 | |
49 | === modified file 'src/marlin-places-sidebar.c' |
50 | --- src/marlin-places-sidebar.c 2013-08-01 22:11:56 +0000 |
51 | +++ src/marlin-places-sidebar.c 2013-08-10 16:49:01 +0000 |
52 | @@ -154,7 +154,7 @@ |
53 | MarlinZoomLevel zoom; |
54 | gboolean show_eject, show_unmount; |
55 | gboolean show_eject_button; |
56 | - |
57 | + |
58 | g_object_get (sidebar, "zoom-level", &zoom, NULL); |
59 | |
60 | GtkIconSize stock_size = marlin_zoom_level_to_stock_icon_size (zoom); |
61 | @@ -190,12 +190,12 @@ |
62 | GError* error = NULL; |
63 | gchar* converted_name = g_locale_to_utf8 (name, -1, NULL, NULL, &error); |
64 | if (error != NULL) { |
65 | - g_warning ("Couldn't convert the bookmark name: %s With error: %s", name, error->message); |
66 | + g_warning ("%s - Couldn't convert the bookmark name: %s With error: %s", G_STRFUNC, name, error->message); |
67 | converted_name = name; |
68 | } |
69 | |
70 | gtk_tree_store_append (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store, &iter, parent); |
71 | - gtk_tree_store_set (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store, &iter, |
72 | + gtk_tree_store_set (MARLIN_ABSTRACT_SIDEBAR (sidebar)->store, &iter, |
73 | PLACES_SIDEBAR_COLUMN_ICON, pixbuf, |
74 | PLACES_SIDEBAR_COLUMN_NAME, converted_name, |
75 | PLACES_SIDEBAR_COLUMN_URI, uri, |
76 | @@ -206,13 +206,12 @@ |
77 | PLACES_SIDEBAR_COLUMN_INDEX, index, |
78 | PLACES_SIDEBAR_COLUMN_EJECT, show_eject_button, |
79 | PLACES_SIDEBAR_COLUMN_NO_EJECT, !show_eject_button, |
80 | - PLACES_SIDEBAR_COLUMN_BOOKMARK, place_type != PLACES_BOOKMARK, |
81 | + PLACES_SIDEBAR_COLUMN_BOOKMARK, place_type == PLACES_BOOKMARK, |
82 | PLACES_SIDEBAR_COLUMN_TOOLTIP, tooltip, |
83 | PLACES_SIDEBAR_COLUMN_EJECT_ICON, eject, |
84 | PLACES_SIDEBAR_COLUMN_FREE_SPACE, 0, |
85 | PLACES_SIDEBAR_COLUMN_DISK_SIZE, 0, |
86 | -1, -1); |
87 | - |
88 | return iter; |
89 | } |
90 | |
91 | @@ -321,11 +320,12 @@ |
92 | bookmark_count = marlin_bookmark_list_length (sidebar->bookmarks); |
93 | for (index = 0; index < bookmark_count; index++) { |
94 | bookmark = marlin_bookmark_list_item_at (sidebar->bookmarks, index); |
95 | - |
96 | if (marlin_bookmark_uri_known_not_to_exist (bookmark)) { |
97 | + /* do not show bookmarks that are (currently) unavailable |
98 | + * note: these remain in the bookmark list |
99 | + */ |
100 | continue; |
101 | } |
102 | - |
103 | name = marlin_bookmark_get_name (bookmark); |
104 | icon = marlin_bookmark_get_icon (bookmark); |
105 | mount_uri = marlin_bookmark_get_uri (bookmark); |
106 | @@ -338,7 +338,7 @@ |
107 | compare_for_selection (sidebar, |
108 | location, mount_uri, last_uri, |
109 | &last_iter, &select_path); |
110 | - //printf ("bookmark: %d %s\n", index, mount_uri); |
111 | + g_debug ("%s - bookmark: %d %s", G_STRFUNC, index, mount_uri); |
112 | g_free (name); |
113 | g_object_unref (root); |
114 | g_object_unref (icon); |
115 | @@ -914,13 +914,13 @@ |
116 | /*gtk_tree_model_get_iter_first (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store), &iter); |
117 | num_rows = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store), &iter);*/ |
118 | //printf ("num rows %d\n", num_rows); |
119 | - |
120 | + |
121 | if (!gtk_tree_view_get_dest_row_at_pos (tree_view, |
122 | x, |
123 | y, |
124 | path, |
125 | pos)) { |
126 | - //printf ("dest_row_at_pos UNKNOWN\n"); |
127 | + g_warning ("%s - dest_row_at_pos UNKNOWN\n", G_STRFUNC); |
128 | //row = num_rows - 1; |
129 | // *path = gtk_tree_path_new_from_indices (row, -1); |
130 | /*gtk_tree_view_get_path_at_pos(tree_view, x, y, path, NULL, NULL, NULL); |
131 | @@ -929,11 +929,11 @@ |
132 | *pos = -1; |
133 | return; |
134 | } |
135 | - //printf ("TEST path %s\n", gtk_tree_path_to_string (*path)); |
136 | + g_debug ("%s - TEST path %s", G_STRFUNC, gtk_tree_path_to_string (*path)); |
137 | row = *gtk_tree_path_get_indices (*path); |
138 | /*gint *idxs = gtk_tree_path_get_indices (*path); |
139 | row = idxs[1];*/ |
140 | - //printf ("row indice %d\n", row); |
141 | + g_debug ("%s - row indice %d", G_STRFUNC, row); |
142 | |
143 | gtk_tree_path_free (*path); |
144 | |
145 | @@ -1183,7 +1183,7 @@ |
146 | MarlinPlacesSidebar *sidebar) |
147 | { |
148 | //amtest drag |
149 | - printf ("%s\n", G_STRFUNC); |
150 | + g_debug ("%s", G_STRFUNC); |
151 | free_drag_data (sidebar); |
152 | gtk_tree_view_set_drag_dest_row (tree_view, NULL, GTK_TREE_VIEW_DROP_BEFORE); |
153 | g_signal_stop_emission_by_name (tree_view, "drag-leave"); |
154 | @@ -1207,7 +1207,7 @@ |
155 | |
156 | if (position < 0) |
157 | position = 0; |
158 | - printf ("%s\n", G_STRFUNC); |
159 | + g_debug ("%s - position is %i", G_STRFUNC, position); |
160 | |
161 | for (i = 0; uris[i]; i++) { |
162 | uri = uris[i]; |
163 | @@ -1241,7 +1241,7 @@ |
164 | return FALSE; |
165 | } |
166 | //amtest |
167 | - //printf ("TEST %s: %s\n", G_STRFUNC, gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store), iter)); |
168 | + g_debug ("TEST %s: %s", G_STRFUNC, gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR (sidebar)->store), iter)); |
169 | return TRUE; |
170 | } |
171 | |
172 | @@ -1253,6 +1253,7 @@ |
173 | PlaceType type; |
174 | int old_position; |
175 | GtkTreeSelection *selection; |
176 | + gboolean is_bookmark; |
177 | |
178 | /* Get the selected path */ |
179 | if (!get_selected_iter (sidebar, &iter)) { |
180 | @@ -1260,14 +1261,14 @@ |
181 | //g_assert_not_reached (); |
182 | } |
183 | |
184 | - gtk_tree_model_get (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store), &iter, |
185 | - PLACES_SIDEBAR_COLUMN_ROW_TYPE, &type, |
186 | + gtk_tree_model_get (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR (sidebar)->store), &iter, |
187 | + PLACES_SIDEBAR_COLUMN_BOOKMARK, &is_bookmark, |
188 | PLACES_SIDEBAR_COLUMN_INDEX, &old_position, |
189 | -1); |
190 | |
191 | //printf("%s: old_pos: %d new_pos: %d\n", G_STRFUNC, old_position, new_position); |
192 | old_position = old_position -sidebar->n_builtins_before; |
193 | - if (type != PLACES_BOOKMARK || |
194 | + if (!is_bookmark || |
195 | old_position < 0 || |
196 | old_position >= marlin_bookmark_list_length (sidebar->bookmarks)) { |
197 | return; |
198 | @@ -1299,7 +1300,7 @@ |
199 | int position; |
200 | GtkTreeModel *model; |
201 | char *drop_uri; |
202 | - PlaceType type; |
203 | + gint type; |
204 | gboolean success; |
205 | |
206 | tree_view = GTK_TREE_VIEW (widget); |
207 | @@ -1339,7 +1340,7 @@ |
208 | PLACES_SIDEBAR_COLUMN_INDEX, &position, |
209 | -1); |
210 | |
211 | - if (!(type == PLACES_BOOKMARK || type == PLACES_BUILT_IN)) { |
212 | + if (type >= 0 && !(type == PLACES_BOOKMARK || type == PLACES_BUILT_IN)) { |
213 | goto out; |
214 | } |
215 | |
216 | @@ -1541,6 +1542,7 @@ |
217 | gboolean show_empty_trash; |
218 | gboolean show_connect_server; |
219 | char *uri = NULL; |
220 | + gboolean is_bookmark; |
221 | |
222 | type = PLACES_BUILT_IN; |
223 | |
224 | @@ -1555,19 +1557,20 @@ |
225 | PLACES_SIDEBAR_COLUMN_VOLUME, &volume, |
226 | PLACES_SIDEBAR_COLUMN_MOUNT, &mount, |
227 | PLACES_SIDEBAR_COLUMN_URI, &uri, |
228 | + PLACES_SIDEBAR_COLUMN_BOOKMARK, &is_bookmark, |
229 | -1); |
230 | } |
231 | |
232 | gtk_widget_show (sidebar->popup_menu_open_in_new_tab_item); |
233 | |
234 | - /*gtk_widget_set_sensitive (sidebar->popup_menu_remove_item, (type == PLACES_BOOKMARK)); |
235 | - gtk_widget_set_sensitive (sidebar->popup_menu_rename_item, (type == PLACES_BOOKMARK));*/ |
236 | - eel_gtk_widget_set_shown (sidebar->popup_menu_remove_item, (type == PLACES_BOOKMARK)); |
237 | + //gtk_widget_set_sensitive (sidebar->popup_menu_remove_item, (type == PLACES_BOOKMARK)); |
238 | + //gtk_widget_set_sensitive (sidebar->popup_menu_rename_item, (type == PLACES_BOOKMARK)); |
239 | + |
240 | + |
241 | //TODO add the possibility to rename volume later |
242 | - eel_gtk_widget_set_shown (sidebar->popup_menu_rename_item, (type == PLACES_BOOKMARK)); |
243 | - eel_gtk_widget_set_shown (sidebar->popup_menu_separator_item1, (type == PLACES_BOOKMARK)); |
244 | - |
245 | - gtk_widget_set_sensitive (sidebar->popup_menu_empty_trash_item, !marlin_trash_monitor_is_empty ()); |
246 | + eel_gtk_widget_set_shown (sidebar->popup_menu_remove_item, is_bookmark); |
247 | + eel_gtk_widget_set_shown (sidebar->popup_menu_rename_item, is_bookmark); |
248 | + eel_gtk_widget_set_shown (sidebar->popup_menu_separator_item1, is_bookmark); |
249 | |
250 | check_visibility (mount, volume, drive, |
251 | &show_mount, &show_unmount, &show_eject, &show_rescan, &show_format, &show_start, &show_stop); |
252 | @@ -1589,6 +1592,7 @@ |
253 | eel_gtk_widget_set_shown (sidebar->popup_menu_start_item, show_start); |
254 | eel_gtk_widget_set_shown (sidebar->popup_menu_stop_item, show_stop);*/ |
255 | eel_gtk_widget_set_shown (sidebar->popup_menu_empty_trash_item, show_empty_trash); |
256 | + gtk_widget_set_sensitive (sidebar->popup_menu_empty_trash_item, !marlin_trash_monitor_is_empty ()); |
257 | eel_gtk_widget_set_shown (sidebar->popup_menu_connect_server_item, show_connect_server); |
258 | |
259 | //TODO check this |
260 | @@ -1832,7 +1836,7 @@ |
261 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store), &iter); |
262 | column = gtk_tree_view_get_column (GTK_TREE_VIEW (sidebar->tree_view), 0); |
263 | renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column)); |
264 | - cell = g_list_nth_data (renderers, 4); |
265 | + cell = g_list_nth_data (renderers, 5); |
266 | g_list_free (renderers); |
267 | g_object_set (cell, "editable", TRUE, NULL); |
268 | gtk_tree_view_set_cursor_on_cell (GTK_TREE_VIEW (sidebar->tree_view), |
269 | @@ -1852,21 +1856,20 @@ |
270 | static void |
271 | remove_selected_bookmarks (MarlinPlacesSidebar *sidebar) |
272 | { |
273 | - GtkTreeIter iter; |
274 | - PlaceType type; |
275 | - int index; |
276 | + GtkTreeIter iter; |
277 | + gint index; |
278 | + gboolean is_bookmark; |
279 | |
280 | if (!get_selected_iter (sidebar, &iter)) { |
281 | return; |
282 | } |
283 | |
284 | gtk_tree_model_get (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store), &iter, |
285 | - PLACES_SIDEBAR_COLUMN_ROW_TYPE, &type, |
286 | + PLACES_SIDEBAR_COLUMN_BOOKMARK, &is_bookmark, |
287 | -1); |
288 | |
289 | - if (type != PLACES_BOOKMARK) { |
290 | + if (!is_bookmark) |
291 | return; |
292 | - } |
293 | |
294 | gtk_tree_model_get (GTK_TREE_MODEL (MARLIN_ABSTRACT_SIDEBAR(sidebar)->store), &iter, |
295 | PLACES_SIDEBAR_COLUMN_INDEX, &index, |
296 | @@ -2427,8 +2430,7 @@ |
297 | g_signal_connect (item, "activate", |
298 | G_CALLBACK (rename_shortcut_cb), sidebar); |
299 | gtk_widget_show (item); |
300 | - // Omit broken "Rename..." from the sidebar |
301 | - // gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->popup_menu), item); |
302 | + gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->popup_menu), item); |
303 | |
304 | /* Mount/Unmount/Eject menu items */ |
305 | |
306 | @@ -2464,8 +2466,6 @@ |
307 | gtk_widget_show (item); |
308 | gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->popup_menu), item); |
309 | |
310 | - bookmarks_check_popup_sensitivity (sidebar); |
311 | - |
312 | /* Connect to server menu item */ |
313 | item = gtk_menu_item_new_with_mnemonic (_("Connect to Server…")); |
314 | sidebar->popup_menu_connect_server_item = item; |
Hi Jeremy
After some testing I can say the following about the implemented features:
1) Was this feature not working for you before? How did you test this? Should we get people from the bug report to test this?
2) Works as intended. No problems.
3) Works as intended too.
4) Bookmarks pointing to non-existent folders are removed only when the bookmark list changes (on bookmark creation and deletion).
I guess your other branch (lp:~jeremywootten/pantheon-files/fix-1207655) solves this properly.
We still have to get confirmation from the design team that this is the intended behavior.
Overall, these are nice little things that were sorely needed!
Code review is coming later.
PS: Come on Jeremy, 4 fixes packed in 1 branch? You know our guidelines are against that. We will let you get by, one more time :)