[gnome-control-center] background: Rename gnome-wp-item to cc-background-item
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Rename gnome-wp-item to cc-background-item
- Date: Thu, 10 Feb 2011 20:35:21 +0000 (UTC)
commit 9a209fa181bd2b480317228e5e847e946c50d190
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 10 12:29:29 2011 +0000
background: Rename gnome-wp-item to cc-background-item
panels/background/Makefile.am | 6 +++-
panels/background/bg-colors-source.c | 6 ++--
panels/background/bg-flickr-source.c | 4 +-
panels/background/bg-pictures-source.c | 8 +++---
panels/background/bg-source.c | 4 +-
panels/background/bg-wallpapers-source.c | 8 +++---
.../{gnome-wp-item.c => cc-background-item.c} | 28 ++++++++++----------
.../{gnome-wp-item.h => cc-background-item.h} | 14 +++++-----
panels/background/cc-background-panel.c | 16 +++++-----
panels/background/gnome-wp-xml.c | 12 ++++----
10 files changed, 54 insertions(+), 52 deletions(-)
---
diff --git a/panels/background/Makefile.am b/panels/background/Makefile.am
index 3291cd8..cba8746 100644
--- a/panels/background/Makefile.am
+++ b/panels/background/Makefile.am
@@ -32,6 +32,8 @@ libbackground_la_SOURCES = \
background-module.c \
cc-background-panel.c \
cc-background-panel.h \
+ cc-background-item.c \
+ cc-background-item.h \
bg-source.c \
bg-source.h \
bg-pictures-source.c \
@@ -40,8 +42,8 @@ libbackground_la_SOURCES = \
bg-wallpapers-source.h \
bg-colors-source.c \
bg-colors-source.h \
- gnome-wp-info.c gnome-wp-item.c gnome-wp-xml.c \
- gnome-wp-info.h gnome-wp-item.h gnome-wp-xml.h
+ gnome-wp-info.c gnome-wp-xml.c \
+ gnome-wp-info.h gnome-wp-xml.h
libbackground_la_LIBADD = \
diff --git a/panels/background/bg-colors-source.c b/panels/background/bg-colors-source.c
index 848e19a..0d4622a 100644
--- a/panels/background/bg-colors-source.c
+++ b/panels/background/bg-colors-source.c
@@ -23,7 +23,7 @@
#include <config.h>
#include "bg-colors-source.h"
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
#include <glib/gi18n-lib.h>
@@ -79,10 +79,10 @@ bg_colors_source_init (BgColorsSource *self)
item->shade_type = items[i].type;
- gnome_wp_item_ensure_gnome_bg (item);
+ cc_background_item_ensure_gnome_bg (item);
/* insert the item into the liststore */
- pixbuf = gnome_wp_item_get_thumbnail (item,
+ pixbuf = cc_background_item_get_thumbnail (item,
thumb_factory,
THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT);
gtk_list_store_insert_with_values (store, NULL, 0,
diff --git a/panels/background/bg-flickr-source.c b/panels/background/bg-flickr-source.c
index 2e164e6..8f9f401 100644
--- a/panels/background/bg-flickr-source.c
+++ b/panels/background/bg-flickr-source.c
@@ -26,7 +26,7 @@
#include <libsocialweb-client/sw-item.h>
#include <libsocialweb-client/sw-client-service.h>
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
G_DEFINE_TYPE (BgFlickrSource, bg_flickr_source, BG_TYPE_SOURCE)
@@ -106,7 +106,7 @@ _view_items_added_cb (SwClientItemView *item_view,
item->shade_type = G_DESKTOP_BACKGROUND_SHADING_SOLID;
- gnome_wp_item_ensure_gnome_bg (item);
+ cc_background_item_ensure_gnome_bg (item);
/* insert the item into the liststore */
thumb_url = sw_item_get_value (sw_item, "thumbnail");
diff --git a/panels/background/bg-pictures-source.c b/panels/background/bg-pictures-source.c
index 13700e6..234e785 100644
--- a/panels/background/bg-pictures-source.c
+++ b/panels/background/bg-pictures-source.c
@@ -22,7 +22,7 @@
#include "bg-pictures-source.h"
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
#include <string.h>
#include <gio/gio.h>
@@ -138,7 +138,7 @@ picture_scaled (GObject *source_object,
{
g_warning ("Failed to load image: %s", error->message);
g_error_free (error);
- gnome_wp_item_free (item);
+ cc_background_item_free (item);
return;
}
@@ -176,7 +176,7 @@ picture_opened_for_read (GObject *source_object,
g_warning ("Failed to load picture '%s': %s", filename, error->message);
g_free (filename);
g_error_free (error);
- gnome_wp_item_free (item);
+ cc_background_item_free (item);
return;
}
@@ -241,7 +241,7 @@ file_info_async_ready (GObject *source,
filename = g_build_filename (path, g_file_info_get_name (info), NULL);
/* create a new GnomeWpItem */
- item = gnome_wp_item_new (filename, NULL,
+ item = cc_background_item_new (filename, NULL,
info,
priv->thumb_factory);
diff --git a/panels/background/bg-source.c b/panels/background/bg-source.c
index ba447fb..23f6262 100644
--- a/panels/background/bg-source.c
+++ b/panels/background/bg-source.c
@@ -20,7 +20,7 @@
*/
#include "bg-source.h"
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
G_DEFINE_ABSTRACT_TYPE (BgSource, bg_source, G_TYPE_OBJECT)
@@ -81,7 +81,7 @@ free_tree_model_items (GtkTreeModel *model,
gtk_tree_model_get (model, iter, 1, &item, -1);
if (item)
- gnome_wp_item_free (item);
+ cc_background_item_free (item);
return FALSE;
}
diff --git a/panels/background/bg-wallpapers-source.c b/panels/background/bg-wallpapers-source.c
index c9a95d5..7a5a703 100644
--- a/panels/background/bg-wallpapers-source.c
+++ b/panels/background/bg-wallpapers-source.c
@@ -23,7 +23,7 @@
#include "bg-wallpapers-source.h"
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
#include "gnome-wp-xml.h"
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
@@ -142,7 +142,7 @@ item_changed_cb (GnomeBG *bg,
g_signal_handlers_block_by_func (bg, G_CALLBACK (item_changed_cb), data);
- pixbuf = gnome_wp_item_get_thumbnail (item,
+ pixbuf = cc_background_item_get_thumbnail (item,
data->thumb_factory,
data->thumb_width,
data->thumb_height);
@@ -177,9 +177,9 @@ load_wallpapers (gchar *key,
gtk_list_store_append (store, &iter);
- pixbuf = gnome_wp_item_get_thumbnail (item, priv->thumb_factory,
+ pixbuf = cc_background_item_get_thumbnail (item, priv->thumb_factory,
THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT);
- gnome_wp_item_update_size (item, NULL);
+ cc_background_item_update_size (item, NULL);
gtk_list_store_set (store, &iter,
0, pixbuf,
diff --git a/panels/background/gnome-wp-item.c b/panels/background/cc-background-item.c
similarity index 87%
rename from panels/background/gnome-wp-item.c
rename to panels/background/cc-background-item.c
index 56ddefa..6fe2969 100644
--- a/panels/background/gnome-wp-item.c
+++ b/panels/background/cc-background-item.c
@@ -22,7 +22,7 @@
#include <glib/gi18n.h>
#include <string.h>
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
static void set_bg_properties (GnomeWPItem *item)
{
@@ -36,17 +36,17 @@ static void set_bg_properties (GnomeWPItem *item)
gnome_bg_set_placement (item->bg, item->options);
}
-void gnome_wp_item_ensure_gnome_bg (GnomeWPItem *item)
+void cc_background_item_ensure_gnome_bg (GnomeWPItem *item)
{
if (!item->bg)
item->bg = gnome_bg_new ();
- g_object_set_data (G_OBJECT (item->bg), "gnome-wp-item", item);
+ g_object_set_data (G_OBJECT (item->bg), "cc-background-item", item);
set_bg_properties (item);
}
-void gnome_wp_item_update (GnomeWPItem *item) {
+void cc_background_item_update (GnomeWPItem *item) {
GSettings *settings;
GdkColor color1 = { 0, 0, 0, 0 }, color2 = { 0, 0, 0, 0 };
gchar *s;
@@ -82,7 +82,7 @@ void gnome_wp_item_update (GnomeWPItem *item) {
set_bg_properties (item);
}
-GnomeWPItem * gnome_wp_item_new (const gchar * filename,
+GnomeWPItem * cc_background_item_new (const gchar * filename,
GHashTable * wallpapers,
GFileInfo * file_info,
GnomeDesktopThumbnailFactory * thumbnails) {
@@ -101,21 +101,21 @@ GnomeWPItem * gnome_wp_item_new (const gchar * filename,
item->name = g_filename_to_utf8 (item->fileinfo->name, -1, NULL,
NULL, NULL);
- gnome_wp_item_update (item);
- gnome_wp_item_ensure_gnome_bg (item);
- gnome_wp_item_update_size (item, NULL);
+ cc_background_item_update (item);
+ cc_background_item_ensure_gnome_bg (item);
+ cc_background_item_update_size (item, NULL);
if (wallpapers)
g_hash_table_insert (wallpapers, item->filename, item);
} else {
- gnome_wp_item_free (item);
+ cc_background_item_free (item);
item = NULL;
}
return item;
}
-void gnome_wp_item_free (GnomeWPItem * item) {
+void cc_background_item_free (GnomeWPItem * item) {
if (item == NULL) {
return;
}
@@ -153,7 +153,7 @@ get_slideshow_icon (void)
return emblem;
}
-GIcon * gnome_wp_item_get_frame_thumbnail (GnomeWPItem * item,
+GIcon * cc_background_item_get_frame_thumbnail (GnomeWPItem * item,
GnomeDesktopThumbnailFactory * thumbs,
int width,
int height,
@@ -188,14 +188,14 @@ GIcon * gnome_wp_item_get_frame_thumbnail (GnomeWPItem * item,
}
-GIcon * gnome_wp_item_get_thumbnail (GnomeWPItem * item,
+GIcon * cc_background_item_get_thumbnail (GnomeWPItem * item,
GnomeDesktopThumbnailFactory * thumbs,
gint width,
gint height) {
- return gnome_wp_item_get_frame_thumbnail (item, thumbs, width, height, -1);
+ return cc_background_item_get_frame_thumbnail (item, thumbs, width, height, -1);
}
-void gnome_wp_item_update_size (GnomeWPItem * item,
+void cc_background_item_update_size (GnomeWPItem * item,
GnomeDesktopThumbnailFactory * thumbs) {
g_free (item->size);
item->size = NULL;
diff --git a/panels/background/gnome-wp-item.h b/panels/background/cc-background-item.h
similarity index 83%
rename from panels/background/gnome-wp-item.h
rename to panels/background/cc-background-item.h
index c820269..99b55ea 100644
--- a/panels/background/gnome-wp-item.h
+++ b/panels/background/cc-background-item.h
@@ -67,23 +67,23 @@ struct _GnomeWPItem {
gint height;
};
-GnomeWPItem * gnome_wp_item_new (const gchar *filename,
+GnomeWPItem * cc_background_item_new (const gchar *filename,
GHashTable *wallpapers,
GFileInfo *file_info,
GnomeDesktopThumbnailFactory *thumbnails);
-void gnome_wp_item_free (GnomeWPItem *item);
-GIcon * gnome_wp_item_get_thumbnail (GnomeWPItem *item,
+void cc_background_item_free (GnomeWPItem *item);
+GIcon * cc_background_item_get_thumbnail (GnomeWPItem *item,
GnomeDesktopThumbnailFactory *thumbs,
gint width,
gint height);
-GIcon * gnome_wp_item_get_frame_thumbnail (GnomeWPItem *item,
+GIcon * cc_background_item_get_frame_thumbnail (GnomeWPItem *item,
GnomeDesktopThumbnailFactory *thumbs,
gint width,
gint height,
gint frame);
-void gnome_wp_item_update (GnomeWPItem *item);
-void gnome_wp_item_update_size (GnomeWPItem *item, GnomeDesktopThumbnailFactory *thumbs);
-void gnome_wp_item_ensure_gnome_bg (GnomeWPItem *item);
+void cc_background_item_update (GnomeWPItem *item);
+void cc_background_item_update_size (GnomeWPItem *item, GnomeDesktopThumbnailFactory *thumbs);
+void cc_background_item_ensure_gnome_bg (GnomeWPItem *item);
#endif
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index feacab3..b1f351f 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -31,7 +31,7 @@
#endif
#include "gnome-wp-xml.h"
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
#include <string.h>
#include <glib/gi18n-lib.h>
@@ -198,7 +198,7 @@ cc_background_panel_finalize (GObject *object)
if (priv->current_background)
{
- gnome_wp_item_free (priv->current_background);
+ cc_background_item_free (priv->current_background);
priv->current_background = NULL;
}
@@ -391,8 +391,8 @@ update_preview (CcBackgroundPanelPrivate *priv,
priv->current_background->height = item->height;
priv->current_background->width = item->width;
- gnome_wp_item_ensure_gnome_bg (priv->current_background);
- gnome_wp_item_update_size (priv->current_background, priv->thumb_factory);
+ cc_background_item_ensure_gnome_bg (priv->current_background);
+ cc_background_item_update_size (priv->current_background, priv->thumb_factory);
}
source_update_edit_box (priv);
@@ -593,7 +593,7 @@ preview_draw_cb (GtkWidget *widget,
if (priv->current_background)
{
GIcon *icon;
- icon = gnome_wp_item_get_frame_thumbnail (priv->current_background,
+ icon = cc_background_item_get_frame_thumbnail (priv->current_background,
priv->thumb_factory,
preview_width,
preview_height,
@@ -832,9 +832,9 @@ cc_background_panel_init (CcBackgroundPanel *self)
priv->current_background->filename = filename;
priv->current_background->name = g_strdup (_("Current background"));
- gnome_wp_item_update (priv->current_background);
- gnome_wp_item_ensure_gnome_bg (priv->current_background);
- gnome_wp_item_update_size (priv->current_background, priv->thumb_factory);
+ cc_background_item_update (priv->current_background);
+ cc_background_item_ensure_gnome_bg (priv->current_background);
+ cc_background_item_update_size (priv->current_background, priv->thumb_factory);
update_preview (priv, NULL, TRUE);
diff --git a/panels/background/gnome-wp-xml.c b/panels/background/gnome-wp-xml.c
index 2783226..fd77fdc 100644
--- a/panels/background/gnome-wp-xml.c
+++ b/panels/background/gnome-wp-xml.c
@@ -18,7 +18,7 @@
*
*/
-#include "gnome-wp-item.h"
+#include "cc-background-item.h"
#include "gnome-wp-xml.h"
#include <gio/gio.h>
#include <string.h>
@@ -159,7 +159,7 @@ static void gnome_wp_xml_load_xml (GnomeWpXml *data,
if (wp->filename == NULL ||
g_hash_table_lookup (data->wp_hash, wp->filename) != NULL) {
- gnome_wp_item_free (wp);
+ cc_background_item_free (wp);
g_free (pcolor);
g_free (scolor);
continue;
@@ -198,11 +198,11 @@ static void gnome_wp_xml_load_xml (GnomeWpXml *data,
wp->name = g_strdup (wp->fileinfo->name);
}
- gnome_wp_item_ensure_gnome_bg (wp);
- gnome_wp_item_update_size (wp, NULL);
+ cc_background_item_ensure_gnome_bg (wp);
+ cc_background_item_update_size (wp, NULL);
g_hash_table_insert (data->wp_hash, wp->filename, wp);
} else {
- gnome_wp_item_free (wp);
+ cc_background_item_free (wp);
wp = NULL;
}
}
@@ -418,7 +418,7 @@ void gnome_wp_xml_save_list (GnomeWpXml *data) {
g_free (filename);
list = g_slist_delete_link (list, list);
- gnome_wp_item_free (wpitem);
+ cc_background_item_free (wpitem);
}
xmlSaveFormatFile (wpfile, wplist, 1);
xmlFreeDoc (wplist);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]