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
=== modified file 'nautilus/utils.c'
--- nautilus/utils.c 2012-02-20 16:45:35 +0000
+++ nautilus/utils.c 2012-04-16 19:50:26 +0000
@@ -1,3 +1,4 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
1/*2/*
2 * UbuntuOne Nautilus plugin3 * UbuntuOne Nautilus plugin
3 *4 *
@@ -40,6 +41,10 @@
40 SyncdaemonInterface *interface;41 SyncdaemonInterface *interface;
41 gboolean result = TRUE, has_shares = FALSE, has_published = FALSE;42 gboolean result = TRUE, has_shares = FALSE, has_published = FALSE;
42 GString *question = NULL;43 GString *question = NULL;
44 gchar *folder_path = NULL;
45
46 folder_path = g_build_filename (syncdaemon_folder_info_get_path (folder_info),
47 G_DIR_SEPARATOR_S, NULL);
4348
44 question = g_string_new (_("This folder contains shared folders and/or published files:\n\n"));49 question = g_string_new (_("This folder contains shared folders and/or published files:\n\n"));
4550
@@ -52,7 +57,7 @@
52 SyncdaemonShareInfo *share_info = SYNCDAEMON_SHARE_INFO (l->data);57 SyncdaemonShareInfo *share_info = SYNCDAEMON_SHARE_INFO (l->data);
5358
54 if (g_str_has_prefix (syncdaemon_share_info_get_path (share_info),59 if (g_str_has_prefix (syncdaemon_share_info_get_path (share_info),
55 syncdaemon_folder_info_get_path (folder_info))60 folder_path)
56 && syncdaemon_share_info_get_accepted (share_info)) {61 && syncdaemon_share_info_get_accepted (share_info)) {
57 has_shares = TRUE;62 has_shares = TRUE;
5863
@@ -75,7 +80,7 @@
75 const gchar *path;80 const gchar *path;
7681
77 path = syncdaemon_file_info_get_path (SYNCDAEMON_FILE_INFO (l->data));82 path = syncdaemon_file_info_get_path (SYNCDAEMON_FILE_INFO (l->data));
78 if (g_str_has_prefix (path, syncdaemon_folder_info_get_path (folder_info))) {83 if (g_str_has_prefix (path, folder_path)) {
79 has_published = TRUE;84 has_published = TRUE;
8085
81 question = g_string_append (question, "\t- ");86 question = g_string_append (question, "\t- ");
@@ -108,6 +113,7 @@
108113
109 /* Free memory */114 /* Free memory */
110 g_string_free (question, TRUE);115 g_string_free (question, TRUE);
116 g_free (folder_path);
111117
112 return result;118 return result;
113}119}

Subscribers

People subscribed via source and target branches

to all changes: