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
1=== modified file 'nautilus/ubuntuone-nautilus.c'
2--- nautilus/ubuntuone-nautilus.c 2009-07-22 21:49:39 +0000
3+++ nautilus/ubuntuone-nautilus.c 2009-07-23 20:14:46 +0000
4@@ -279,11 +279,20 @@
5 };
6
7 static void __share_cb_data_free (struct _ShareCBData * data) {
8+ if (!data)
9+ return;
10+
11 data->uon = NULL;
12 data->parent = NULL;
13
14- g_free (data->path);
15- data->path = NULL;
16+ data->user_entry = NULL;
17+ data->name_entry = NULL;
18+ data->allow_mods = NULL;
19+
20+ if (data->path) {
21+ g_free (data->path);
22+ data->path = NULL;
23+ }
24
25 g_free (data);
26
27@@ -422,7 +431,7 @@
28 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
29
30 shared = g_build_filename (uon->managed, "Shared with Me", NULL);
31- myfiles = g_build_filename (uon->managed, "My Files", NULL);
32+ myfiles = g_build_filename (uon->managed, "My Files", G_DIR_SEPARATOR_S, NULL);
33
34 if (!path || !ubuntuone_is_storagefs (uon, path))
35 goto done;
36@@ -433,6 +442,9 @@
37 if (strncmp (path, myfiles, strlen (myfiles)) != 0)
38 goto done;
39
40+ if (uon->share_cb_data)
41+ __share_cb_data_free (uon->share_cb_data);
42+
43 share_cb_data = g_new0 (struct _ShareCBData, 1);
44 share_cb_data->uon = uon;
45 share_cb_data->parent = window;

Subscribers

People subscribed via source and target branches