Merge lp:~dobey/ubuntuone-client-gnome/fix-983144 into lp:ubuntuone-client-gnome

Proposed by dobey on 2012-04-16
Status: Merged
Approved by: dobey on 2012-04-16
Approved revision: 15
Merged at revision: 16
Proposed branch: lp:~dobey/ubuntuone-client-gnome/fix-983144
Merge into: lp:ubuntuone-client-gnome
Diff against target: 45 lines (+8/-2)
1 file modified
nautilus/utils.c (+8/-2)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client-gnome/fix-983144
Reviewer Review Type Date Requested Status
Roberto Alsina (community) 2012-04-16 Approve on 2012-04-16
Review via email: mp+102173@code.launchpad.net

Commit message

Ensure a trailing / on the folder path for use in comparisons

To post a comment you must log in.
Roberto Alsina (ralsina) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nautilus/utils.c'
2--- nautilus/utils.c 2012-02-20 16:45:35 +0000
3+++ nautilus/utils.c 2012-04-16 19:50:26 +0000
4@@ -1,3 +1,4 @@
5+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 /*
7 * UbuntuOne Nautilus plugin
8 *
9@@ -40,6 +41,10 @@
10 SyncdaemonInterface *interface;
11 gboolean result = TRUE, has_shares = FALSE, has_published = FALSE;
12 GString *question = NULL;
13+ gchar *folder_path = NULL;
14+
15+ folder_path = g_build_filename (syncdaemon_folder_info_get_path (folder_info),
16+ G_DIR_SEPARATOR_S, NULL);
17
18 question = g_string_new (_("This folder contains shared folders and/or published files:\n\n"));
19
20@@ -52,7 +57,7 @@
21 SyncdaemonShareInfo *share_info = SYNCDAEMON_SHARE_INFO (l->data);
22
23 if (g_str_has_prefix (syncdaemon_share_info_get_path (share_info),
24- syncdaemon_folder_info_get_path (folder_info))
25+ folder_path)
26 && syncdaemon_share_info_get_accepted (share_info)) {
27 has_shares = TRUE;
28
29@@ -75,7 +80,7 @@
30 const gchar *path;
31
32 path = syncdaemon_file_info_get_path (SYNCDAEMON_FILE_INFO (l->data));
33- if (g_str_has_prefix (path, syncdaemon_folder_info_get_path (folder_info))) {
34+ if (g_str_has_prefix (path, folder_path)) {
35 has_published = TRUE;
36
37 question = g_string_append (question, "\t- ");
38@@ -108,6 +113,7 @@
39
40 /* Free memory */
41 g_string_free (question, TRUE);
42+ g_free (folder_path);
43
44 return result;
45 }

Subscribers

People subscribed via source and target branches

to all changes: