diff --git a/panels/background/cc-background-item.c b/panels/background/cc-background-item.c index 14d5a4b68..fbf857cf0 100644 --- a/panels/background/cc-background-item.c +++ b/panels/background/cc-background-item.c @@ -754,6 +754,27 @@ cc_background_item_new (const char *filename) return CC_BACKGROUND_ITEM (object); } +CcBackgroundItem * +cc_background_item_copy (CcBackgroundItem *item) +{ + CcBackgroundItem *ret; + + ret = cc_background_item_new (item->priv->filename); + ret->priv->name = g_strdup (item->priv->name); + ret->priv->filename = g_strdup (item->priv->filename); + ret->priv->size = g_strdup (item->priv->size); + ret->priv->placement = item->priv->placement; + ret->priv->shading = item->priv->shading; + ret->priv->primary_color = g_strdup (item->priv->primary_color); + ret->priv->secondary_color = g_strdup (item->priv->secondary_color); + ret->priv->source_url = g_strdup (item->priv->source_url); + ret->priv->source_xml = g_strdup (item->priv->source_xml); + ret->priv->is_deleted = item->priv->is_deleted; + ret->priv->flags = item->priv->flags; + + return ret; +} + static const char * flags_to_str (CcBackgroundItemFlags flag) { diff --git a/panels/background/cc-background-item.h b/panels/background/cc-background-item.h index 31515e68b..55b1c29d6 100644 --- a/panels/background/cc-background-item.h +++ b/panels/background/cc-background-item.h @@ -67,6 +67,7 @@ typedef struct GType cc_background_item_get_type (void); CcBackgroundItem * cc_background_item_new (const char *filename); +CcBackgroundItem * cc_background_item_copy (CcBackgroundItem *item); gboolean cc_background_item_load (CcBackgroundItem *item, GFileInfo *info); gboolean cc_background_item_changes_with_time (CcBackgroundItem *item);