Merge lp:~ralsina/ubuntuone-client/fix_714976 into lp:ubuntuone-client

Proposed by Roberto Alsina
Status: Merged
Approved by: John O'Brien
Approved revision: 870
Merged at revision: 871
Proposed branch: lp:~ralsina/ubuntuone-client/fix_714976
Merge into: lp:ubuntuone-client
Diff against target: 51 lines (+11/-4)
2 files modified
libsyncdaemon/syncdaemon-daemon.c (+9/-2)
nautilus/ubuntuone-nautilus.c (+2/-2)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-client/fix_714976
Reviewer Review Type Date Requested Status
John O'Brien (community) Approve
dobey (community) Approve
Review via email: mp+49623@code.launchpad.net

Commit message

Fixes wrong path comparisons, so you can sync a folder named "~/Ubuntu One Music"

Description of the change

Fixes wrong path comparisons, so you can sync a folder named "~/Ubuntu One Music"

To fieldtest it, build it using these commands:

WARNING, this overwrites part of ubuntuone-client-gnome, you may need to reinstall it later

./autogen.sh --prefix=/usr
make
cd nautilus && sudo make install
cd ../libsyncdaemon && sudo make install
pkill nautilus
nautilus nautilus ~/Ubuntu\ One/Shared\ With\ Me/

Create a folder called "~/Ubuntu One Test"

Then check the context menus, the "Ubuntu One Test->Share" option should be disabled, and the "Synchronize" option, enabled.

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

18 + } else {
19 + root_with_slash = g_build_filename (root, G_DIR_SEPARATOR_S, NULL);
20
21 + if (g_str_has_prefix (path, root_with_slash)) {
22 + g_free(root_with_slash);
23 + return TRUE;
24 + }
25 + g_free(root_with_slash);
26 + }

The style is a bit messed up here. Tabs vs. spaces issues maybe?

review: Needs Fixing
870. By Roberto Alsina

Fixed indenting problem

Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
John O'Brien (jdobrien) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libsyncdaemon/syncdaemon-daemon.c'
2--- libsyncdaemon/syncdaemon-daemon.c 2010-11-19 09:19:15 +0000
3+++ libsyncdaemon/syncdaemon-daemon.c 2011-02-14 17:03:12 +0000
4@@ -920,6 +920,7 @@
5 syncdaemon_daemon_is_folder_enabled (SyncdaemonDaemon *daemon, const gchar *path, gboolean *is_root)
6 {
7 const gchar *root;
8+ gchar *root_with_slash;
9 gboolean managed = FALSE;
10 gchar *dirpath;
11 SyncdaemonInterface *interface;
12@@ -934,9 +935,15 @@
13 if (g_strcmp0 (path, root) == 0) {
14 *is_root = TRUE;
15 return TRUE;
16- } else if (g_str_has_prefix (path, root))
17- return TRUE;
18+ } else {
19+ root_with_slash = g_build_filename (root, G_DIR_SEPARATOR_S, NULL);
20
21+ if (g_str_has_prefix (path, root_with_slash)) {
22+ g_free(root_with_slash);
23+ return TRUE;
24+ }
25+ g_free(root_with_slash);
26+ }
27 /* Now check the 'Shared With Me' directory */
28 dirpath = g_build_filename (root, "Shared With Me", NULL);
29 if (g_strcmp0 (path, dirpath) == 0) {
30
31=== modified file 'nautilus/ubuntuone-nautilus.c'
32--- nautilus/ubuntuone-nautilus.c 2010-10-18 11:05:29 +0000
33+++ nautilus/ubuntuone-nautilus.c 2011-02-14 17:03:12 +0000
34@@ -183,7 +183,7 @@
35 uon->file_watcher = file_watcher_new (uon);
36
37 /* Default to ~/Ubuntu One for now, as it's all we really support */
38- uon->managed = g_build_filename (g_get_home_dir (), "Ubuntu One", NULL);
39+ uon->managed = g_build_filename (g_get_home_dir (), "Ubuntu One", G_DIR_SEPARATOR_S, NULL);
40 uon->gotroot = FALSE;
41 uon->gotudfs = FALSE;
42 }
43@@ -294,7 +294,7 @@
44
45 /* Get the root when we get a status change signal, if we haven't yet */
46 if (!uon->gotroot) {
47- uon->managed = g_strdup (syncdaemon_daemon_get_root_dir (uon->syncdaemon));
48+ uon->managed = g_build_filename (syncdaemon_daemon_get_root_dir (uon->syncdaemon), G_DIR_SEPARATOR_S, NULL);
49 if (uon->managed != NULL)
50 uon->gotroot = TRUE;
51 }

Subscribers

People subscribed via source and target branches