Always save KatzeItem::icon as meta data

This gives us saving of the icon in XML for free.
This commit is contained in:
Christian Dywan 2010-05-09 00:56:03 +02:00
parent d522efa23c
commit af29dcf304
2 changed files with 4 additions and 7 deletions

View file

@ -189,7 +189,6 @@ katze_item_finalize (GObject* object)
g_free (item->name); g_free (item->name);
g_free (item->text); g_free (item->text);
g_free (item->uri); g_free (item->uri);
g_free (item->icon);
g_free (item->token); g_free (item->token);
g_hash_table_unref (item->metadata); g_hash_table_unref (item->metadata);
@ -217,7 +216,7 @@ katze_item_set_property (GObject* object,
katze_assign (item->uri, g_value_dup_string (value)); katze_assign (item->uri, g_value_dup_string (value));
break; break;
case PROP_ICON: case PROP_ICON:
katze_assign (item->icon, g_value_dup_string (value)); katze_item_set_icon (item, g_value_get_string (value));
break; break;
case PROP_TOKEN: case PROP_TOKEN:
katze_assign (item->token, g_value_dup_string (value)); katze_assign (item->token, g_value_dup_string (value));
@ -254,7 +253,7 @@ katze_item_get_property (GObject* object,
g_value_set_string (value, item->uri); g_value_set_string (value, item->uri);
break; break;
case PROP_ICON: case PROP_ICON:
g_value_set_string (value, item->icon); g_value_set_string (value, katze_item_get_icon (item));
break; break;
case PROP_TOKEN: case PROP_TOKEN:
g_value_set_string (value, item->token); g_value_set_string (value, item->token);
@ -398,7 +397,7 @@ katze_item_get_icon (KatzeItem* item)
{ {
g_return_val_if_fail (KATZE_IS_ITEM (item), NULL); g_return_val_if_fail (KATZE_IS_ITEM (item), NULL);
return item->icon; return katze_item_get_meta_string (item, "icon");
} }
/** /**
@ -414,7 +413,7 @@ katze_item_set_icon (KatzeItem* item,
{ {
g_return_if_fail (KATZE_IS_ITEM (item)); g_return_if_fail (KATZE_IS_ITEM (item));
katze_assign (item->icon, g_strdup (icon)); katze_item_set_meta_string (item, "icon", icon);
g_object_notify (G_OBJECT (item), "icon"); g_object_notify (G_OBJECT (item), "icon");
} }
@ -698,7 +697,6 @@ katze_item_copy (KatzeItem* item)
"name", item->name, "name", item->name,
"text", item->text, "text", item->text,
"uri", item->uri, "uri", item->uri,
"icon", item->icon,
"token", item->token, "token", item->token,
"added", item->added, "added", item->added,
"parent", item->parent, "parent", item->parent,

View file

@ -39,7 +39,6 @@ struct _KatzeItem
gchar* name; gchar* name;
gchar* text; gchar* text;
gchar* uri; gchar* uri;
gchar* icon;
gchar* token; gchar* token;
gint64 added; gint64 added;
GHashTable* metadata; GHashTable* metadata;