Bugzilla – Attachment 188157 Details for
Bug 349604
main-menu doesn't handle labeled bookmarks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Updated patch
gnome-main-menu-bnc349604-fix.patch (text/plain), 2.64 KB, created by
Forgotten User CRPsQFwJ3b
on 2007-12-19 01:05:16 UTC
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Forgotten User CRPsQFwJ3b
Created:
2007-12-19 01:05:16 UTC
Size:
2.64 KB
patch
obsolete
>Index: libslab/bookmark-agent.c >=================================================================== >--- libslab/bookmark-agent.c (revision 370) >+++ libslab/bookmark-agent.c (working copy) >@@ -590,6 +590,7 @@ > gint rank_corr = -1; > gboolean needs_update = FALSE; > gboolean store_corrupted = FALSE; >+ gchar *title = NULL; > > gint i; > >@@ -625,9 +626,14 @@ > if (priv->n_items != n_uris) > needs_update = TRUE; > >- for (i = 0; ! needs_update && uris_ordered && uris_ordered [i]; ++i) >- if (strcmp (priv->items [i]->uri, uris_ordered [i])) >+ for (i = 0; ! needs_update && uris_ordered && uris_ordered [i]; ++i) { >+ title = g_bookmark_file_get_title (priv->store, uris_ordered [i], NULL); >+ if (title != NULL && strcmp (priv->items [i]->title, title)) > needs_update = TRUE; >+ else if (strcmp (priv->items [i]->uri, uris_ordered [i])) >+ needs_update = TRUE; >+ g_free (title); >+ } > > if (needs_update) { > for (i = 0; priv->items && priv->items [i]; ++i) >@@ -777,13 +783,12 @@ > > gchar **uris; > gchar **groups; >- gchar **folders = NULL; >+ gchar **bookmarks = NULL; >+ >+ gchar *buf, *label, *uri; > >- gchar *buf; >+ gint i, j, bookmark_len; > >- gint i, j; >- >- > load_xbel_store (this); > > uris = g_bookmark_file_get_uris (priv->store, NULL); >@@ -807,18 +812,30 @@ > g_file_get_contents (priv->gtk_store_path, & buf, NULL, NULL); > > if (buf) { >- folders = g_strsplit (buf, "\n", -1); >+ bookmarks = g_strsplit (buf, "\n", -1); > g_free (buf); > } > >- for (i = 0; folders && folders [i]; ++i) { >- if (strlen (folders [i]) > 0) { >- g_bookmark_file_add_group (priv->store, folders [i], "gtk-bookmarks"); >- priv->create_item (this, folders [i]); >+ for (i = 0; bookmarks && bookmarks [i]; ++i) { >+ bookmark_len = strlen (bookmarks [i]); >+ if (bookmark_len > 0) { >+ label = strstr (bookmarks[i], " "); >+ if (label != NULL) >+ uri = g_strndup (bookmarks [i], bookmark_len - strlen (label)); >+ else >+ uri = bookmarks [i]; >+ g_bookmark_file_add_group (priv->store, uri, "gtk-bookmarks"); >+ priv->create_item (this, uri); >+ if (label != NULL) { >+ label++; >+ if (strlen (label) > 0) >+ g_bookmark_file_set_title (priv->store, uri, label); >+ g_free (uri); >+ } > } > } > >- g_strfreev (folders); >+ g_strfreev (bookmarks); > } > > static void >Index: libslab/ChangeLog >=================================================================== >--- libslab/ChangeLog (revision 370) >+++ libslab/ChangeLog (working copy) >@@ -1,3 +1,7 @@ >+2007-12-19 Ivan N. Zlatev <contact@i-nz.net> >+ >+ * bookmark-agent.c: Handle labels in .gtk-bookmarks >+ > 2007-09-16 Andre Klapper <a9016009@gmx.de> > > * system-tile.c: revert to svn revision 339 (=before
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 349604
:
188132
|
188137
|
188153
|
188154
|
188157
|
188159
|
192206