Merge lp:~junrrein/pantheon-files/fix-1035144 into lp:~elementary-apps/pantheon-files/trunk

Proposed by Julián Unrrein
Status: Merged
Merged at revision: 1097
Proposed branch: lp:~junrrein/pantheon-files/fix-1035144
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 22 lines (+12/-0)
1 file modified
src/fm-directory-view.c (+12/-0)
To merge this branch: bzr merge lp:~junrrein/pantheon-files/fix-1035144
Reviewer Review Type Date Requested Status
Victor Martinez (community) Approve
Review via email: mp+147238@code.launchpad.net

Description of the change

[List View] No longer crash when dragging items to the blank space under an expanded empty folder. Fixes bug #1035144.

When testing this branch, keep in mind bug #1017094.

To post a comment you must log in.
Revision history for this message
Victor Martinez (victored) wrote :

Thanks for the fix Julián!

I was fearing that this code would introduce problems to the icon view, but since this portion of code is guarded by "if (G_LIKELY (path != NULL)) { .. }" it has no side effects for the case where a file is being dragged into a blank area of the icon view, so this is fine (this comment is mostly a self-reminder).

review: Approve
Revision history for this message
Julián Unrrein (junrrein) wrote :

Thanks for the review and for the insight!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/fm-directory-view.c'
2--- src/fm-directory-view.c 2013-02-05 14:13:21 +0000
3+++ src/fm-directory-view.c 2013-02-07 22:05:24 +0000
4@@ -992,6 +992,18 @@
5 //printf ("%s path %s\n", G_STRFUNC, gtk_tree_path_to_string (path));
6 /* determine the file for the path */
7 file = fm_list_model_file_for_path (view->model, path);
8+
9+ /* If file == NULL, it means that the path in question is a blank path,
10+ * which can only exist under an expanded empty folder.
11+ * In this case, we set the destination target to that folder. */
12+ if (file == NULL) {
13+ /* The original path isn't modified. The graphical results are
14+ * more pleasant in this way. */
15+ GtkTreePath *folder_path = gtk_tree_path_copy (path);
16+ gtk_tree_path_up (folder_path);
17+ file = fm_list_model_file_for_path (view->model, folder_path);
18+ }
19+
20 printf ("%s %s\n", G_STRFUNC, file->uri);
21
22 /* we can only drop to directories and executable files */

Subscribers

People subscribed via source and target branches

to all changes: