[packagekit] The patch to enable title with uri in update viewer
Zhu, Peter J
peter.j.zhu at intel.com
Tue Jun 16 05:50:05 PDT 2009
Richard Hughes wrote on Tuesday, June 16, 2009 4:24 PM
> On Tue, Jun 16, 2009 at 8:58 AM, Zhu, Peter
> J<peter.j.zhu at intel.com> wrote:
>> diff --git a/src/gpk-update-viewer2.c
>> b/src/gpk-update-viewer2.c index d4b3589..6d5da69 100644
>> --- a/src/gpk-update-viewer2.c +++
>> b/src/gpk-update-viewer2.c
>
> Is this against git master?
>
Very sorry, I made a mistake, please don't merge previous patch but below one
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index 598ccd2..b46113d 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -1140,13 +1140,15 @@ gpk_update_viewer_add_description_link_item (GtkTextBuffer *buffer, GtkTextIter
{
GtkTextTag *tag;
const gchar *uri;
+ const gchar *text;
gint i;
/* insert at end */
gtk_text_buffer_insert_with_tags_by_name (buffer, iter, title, -1, "para", NULL);
- for (i=0; i<array->len; i++) {
+ for (i=0; i<array->len; i+=2) {
uri = g_ptr_array_index (array, i);
+ text = g_ptr_array_index (array, i+1);
gtk_text_buffer_insert (buffer, iter, "\n", -1);
gtk_text_buffer_insert (buffer, iter, "* ", -1);
tag = gtk_text_buffer_create_tag (buffer, NULL,
@@ -1154,7 +1156,7 @@ gpk_update_viewer_add_description_link_item (GtkTextBuffer *buffer, GtkTextIter
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
g_object_set_data (G_OBJECT (tag), "href", g_strdup (uri));
- gtk_text_buffer_insert_with_tags (buffer, iter, uri, -1, tag, NULL);
+ gtk_text_buffer_insert_with_tags (buffer, iter, text, -1, tag, NULL);
gtk_text_buffer_insert (buffer, iter, ".", -1);
}
gtk_text_buffer_insert (buffer, iter, "\n", -1);
@@ -1183,7 +1185,7 @@ gpk_update_viewer_get_uris (const gchar *url_string)
}
/* copy into array */
- for (i=0; i<length; i+=2)
+ for (i=0; i<length; i++)
g_ptr_array_add (array, g_strdup (urls[i]));
return array;
More information about the PackageKit
mailing list