Re: [PATCH] - Fix for 155928 -Adds GTK2 Bookmarks to Nautilus



On Wed, 2005-06-22 at 18:34 +0100, Jamie McCracken wrote:
> Alexander Larsson wrote:
> 
> >>
> >>The function get_default_bookmark_name is slightly different to 
> >>compute_default_title (it truncates!) so I have not centralised that in 
> >>libnautilus-private.
> > 
> > 
> > No need to have a copy of everything for that, just call the general
> > code and then truncate it. That way changes and fixes in one place will
> > fix all places.
> 
> okay done - patch attached.

Thanks a lot. I commited this.

There were some issues, which I fixed:

+char *	 compute_default_title			     (const char *text_uri);
+

rename to get nautilus prefix (all global symbols should have this).
I picked: nautilus_compute_title_for_uri

+	char *name, *icon_name = NULL;
+	gboolean has_label = FALSE;
and
+        	char **lines = g_strsplit (contents, "\n", -1);
and
+ 				char *space, *label = NULL;

according to our coding style, no initialization at declaration time

+	if (NAUTILUS_BOOKMARK_LIST (object)->handle != NULL) {
+		gnome_vfs_monitor_cancel (NAUTILUS_BOOKMARK_LIST (object)->handle);
+	}

must null the handle, as destroy can be called multiple times

+
+	char *filename, *contents;
+
+	filename = nautilus_bookmark_list_get_file_path ();
+
 	clear (bookmarks);
 
-	if (!g_file_test (nautilus_bookmark_list_get_file_path (bookmarks),
+	if (!g_file_test (nautilus_bookmark_list_get_file_path (),
 			  G_FILE_TEST_EXISTS)) {
 		return;
 	}

leaks filename

diff -u -r1.15 nautilus-bookmark-parsing.c
...

Should remove the whole file, as its not needed anymore.

 static void
-update_bookmark_from_text (void)
+update_bookmark_from_text ()

eh?



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an uncontrollable overambitious librarian with a secret. She's a tortured 
paranoid research scientist trying to make a difference in a man's world. They 
fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]