background: Remove some unneeded allocations
This commit is contained in:
parent
7f9f1cabe0
commit
eb5b455097
1 changed files with 4 additions and 14 deletions
|
@ -123,7 +123,6 @@ static void gnome_wp_xml_load_xml (GnomeWpXml *data,
|
||||||
if (!strcmp ((gchar *)list->name, "wallpaper")) {
|
if (!strcmp ((gchar *)list->name, "wallpaper")) {
|
||||||
CcBackgroundItem * item;
|
CcBackgroundItem * item;
|
||||||
CcBackgroundItemFlags flags = 0;
|
CcBackgroundItemFlags flags = 0;
|
||||||
gchar *pcolor = NULL, *scolor = NULL;
|
|
||||||
|
|
||||||
item = cc_background_item_new (NULL);
|
item = cc_background_item_new (NULL);
|
||||||
|
|
||||||
|
@ -193,12 +192,14 @@ static void gnome_wp_xml_load_xml (GnomeWpXml *data,
|
||||||
}
|
}
|
||||||
} else if (!strcmp ((gchar *)wpa->name, "pcolor")) {
|
} else if (!strcmp ((gchar *)wpa->name, "pcolor")) {
|
||||||
if (wpa->last != NULL) {
|
if (wpa->last != NULL) {
|
||||||
pcolor = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
g_object_set (G_OBJECT (item), "primary-color",
|
||||||
|
g_strstrip ((gchar *)wpa->last->content), NULL);
|
||||||
SET_FLAG(CC_BACKGROUND_ITEM_HAS_PCOLOR);
|
SET_FLAG(CC_BACKGROUND_ITEM_HAS_PCOLOR);
|
||||||
}
|
}
|
||||||
} else if (!strcmp ((gchar *)wpa->name, "scolor")) {
|
} else if (!strcmp ((gchar *)wpa->name, "scolor")) {
|
||||||
if (wpa->last != NULL) {
|
if (wpa->last != NULL) {
|
||||||
scolor = g_strdup (g_strstrip ((gchar *)wpa->last->content));
|
g_object_set (G_OBJECT (item), "secondary-color",
|
||||||
|
g_strstrip ((gchar *)wpa->last->content), NULL);
|
||||||
SET_FLAG(CC_BACKGROUND_ITEM_HAS_SCOLOR);
|
SET_FLAG(CC_BACKGROUND_ITEM_HAS_SCOLOR);
|
||||||
}
|
}
|
||||||
} else if (!strcmp ((gchar *)wpa->name, "text")) {
|
} else if (!strcmp ((gchar *)wpa->name, "text")) {
|
||||||
|
@ -213,22 +214,11 @@ static void gnome_wp_xml_load_xml (GnomeWpXml *data,
|
||||||
g_hash_table_lookup (data->wp_hash, fname) != NULL) {
|
g_hash_table_lookup (data->wp_hash, fname) != NULL) {
|
||||||
|
|
||||||
g_object_unref (item);
|
g_object_unref (item);
|
||||||
g_free (pcolor);
|
|
||||||
g_free (scolor);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verify the colors and alloc some GdkColors here */
|
|
||||||
if (pcolor)
|
|
||||||
g_object_set (G_OBJECT (item), "primary-color", pcolor, NULL);
|
|
||||||
if (scolor)
|
|
||||||
g_object_set (G_OBJECT (item), "secondary-color", scolor, NULL);
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (item), "flags", flags, NULL);
|
g_object_set (G_OBJECT (item), "flags", flags, NULL);
|
||||||
|
|
||||||
g_free (pcolor);
|
|
||||||
g_free (scolor);
|
|
||||||
|
|
||||||
if (fname != NULL) {
|
if (fname != NULL) {
|
||||||
#if 0
|
#if 0
|
||||||
cc_background_item_ensure_gnome_bg (wp);
|
cc_background_item_ensure_gnome_bg (wp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue