Merge lp:~dobey/ubuntuone-client/nautilus-crash-fix into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: Elliot Murphy
Approved revision: 101
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntuone-client/nautilus-crash-fix
Merge into: lp:ubuntuone-client
Diff against target: None lines
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/nautilus-crash-fix
Reviewer Review Type Date Requested Status
Elliot Murphy (community) Approve
Joshua Blount (community) Approve
Review via email: mp+9220@code.launchpad.net

Commit message

[r=jblount, r=statik] Add some error checking to avoid crashing Nautilus on shutdown

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

This fixes a new crash which has apparently been occurring a lot in Karmic. It also disallows sharing of the "My Files" directory itself, as it is extremely easy to accidentally do so, do to a bug in current Nautilus.

Revision history for this message
Joshua Blount (jblount) wrote :

Looks fine, but I'm confused, how does this dis-allow sharing ~/Ubuntu One/My Files/ ? I don't see sharing options in the contextual menu when right clicking folders.

review: Approve
Revision history for this message
dobey (dobey) wrote :

On Fri, 2009-07-24 at 12:17 +0000, Joshua Blount wrote:
> Review: Approve
> Looks fine, but I'm confused, how does this dis-allow sharing ~/Ubuntu
> One/My Files/ ? I don't see sharing options in the contextual menu
> when right clicking folders.

31- myfiles = g_build_filename (uon->managed, "My Files", NULL);
32+ myfiles = g_build_filename (uon->managed, "My Files", G_DIR_SEPARATOR_S, NULL);

This change will require the comparison following it, to contain the
directory separator character after the "My Files" preventing the menu
being available on the "My Files" folder, but it will appear for folders
underneath "My Files" still.

Revision history for this message
Elliot Murphy (statik) wrote :

nice branch, less crashing is good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nautilus/ubuntuone-nautilus.c'
--- nautilus/ubuntuone-nautilus.c 2009-07-22 21:49:39 +0000
+++ nautilus/ubuntuone-nautilus.c 2009-07-23 20:14:46 +0000
@@ -279,11 +279,20 @@
279};279};
280280
281static void __share_cb_data_free (struct _ShareCBData * data) {281static void __share_cb_data_free (struct _ShareCBData * data) {
282 if (!data)
283 return;
284
282 data->uon = NULL;285 data->uon = NULL;
283 data->parent = NULL;286 data->parent = NULL;
284287
285 g_free (data->path);288 data->user_entry = NULL;
286 data->path = NULL;289 data->name_entry = NULL;
290 data->allow_mods = NULL;
291
292 if (data->path) {
293 g_free (data->path);
294 data->path = NULL;
295 }
287296
288 g_free (data);297 g_free (data);
289298
@@ -422,7 +431,7 @@
422 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);431 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
423432
424 shared = g_build_filename (uon->managed, "Shared with Me", NULL);433 shared = g_build_filename (uon->managed, "Shared with Me", NULL);
425 myfiles = g_build_filename (uon->managed, "My Files", NULL);434 myfiles = g_build_filename (uon->managed, "My Files", G_DIR_SEPARATOR_S, NULL);
426435
427 if (!path || !ubuntuone_is_storagefs (uon, path))436 if (!path || !ubuntuone_is_storagefs (uon, path))
428 goto done;437 goto done;
@@ -433,6 +442,9 @@
433 if (strncmp (path, myfiles, strlen (myfiles)) != 0)442 if (strncmp (path, myfiles, strlen (myfiles)) != 0)
434 goto done;443 goto done;
435444
445 if (uon->share_cb_data)
446 __share_cb_data_free (uon->share_cb_data);
447
436 share_cb_data = g_new0 (struct _ShareCBData, 1);448 share_cb_data = g_new0 (struct _ShareCBData, 1);
437 share_cb_data->uon = uon;449 share_cb_data->uon = uon;
438 share_cb_data->parent = window;450 share_cb_data->parent = window;

Subscribers

People subscribed via source and target branches