[cheese] Move PNG and SVG images into GResource
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] Move PNG and SVG images into GResource
- Date: Tue, 12 Nov 2013 09:47:09 +0000 (UTC)
commit 97fd866795443c168460d87e71dc97d0f2db1a8a
Author: David King <amigadave amigadave com>
Date: Tue Nov 12 09:44:07 2013 +0000
Move PNG and SVG images into GResource
Makefile.am | 14 ++---
data/cheese.gresource.xml | 1 +
data/pixmaps/camera-icon.svg | 144 -------------------------------------
src/thumbview/cheese-thumb-view.c | 15 ++--
src/thumbview/cheese-thumbnail.c | 9 ++-
5 files changed, 19 insertions(+), 164 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 9611891..eb21b4b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -200,7 +200,11 @@ noinst_resource_files = \
data/cheese-viewport.json \
data/cheese-appmenu.ui \
data/cheese-main-window.ui \
- data/cheese-prefs.ui
+ data/cheese-prefs.ui \
+ data/pixmaps/cheese-1.svg \
+ data/pixmaps/cheese-2.svg \
+ data/pixmaps/cheese-3.svg \
+ data/pixmaps/thumbnail-frame.png
src/cheese-resource.c src/cheese-resource.h: data/cheese.gresource.xml Makefile $(noinst_resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/data --generate --c-name
cheese $<
@@ -350,14 +354,6 @@ uninstall-update-icon-cache:
$(AM_V_at)$(POST_UNINSTALL)
test -n "$(DESTDIR)" || $(update_icon_cache) "$(iconthemedir)"
-pixmapsdir = $(pkgdatadir)/pixmaps
-dist_pixmaps_DATA = \
- data/pixmaps/thumbnail-frame.png \
- data/pixmaps/camera-icon.svg \
- data/pixmaps/cheese-1.svg \
- data/pixmaps/cheese-2.svg \
- data/pixmaps/cheese-3.svg
-
# Tests.
check_PROGRAMS = \
tests/test-libcheese \
diff --git a/data/cheese.gresource.xml b/data/cheese.gresource.xml
index 514c212..c21ecb1 100644
--- a/data/cheese.gresource.xml
+++ b/data/cheese.gresource.xml
@@ -6,6 +6,7 @@
<file preprocess="xml-stripblanks">cheese-appmenu.ui</file>
<file preprocess="xml-stripblanks">cheese-main-window.ui</file>
<file preprocess="xml-stripblanks">cheese-prefs.ui</file>
+ <file>pixmaps/thumbnail-frame.png</file>
</gresource>
</gresources>
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index 9976caf..585db99 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -265,14 +265,15 @@ cheese_thumb_view_append_item (CheeseThumbView *thumb_view, GFile *file)
g_free (filename);
}
- if (priv->multiplex_thumbnail_generator)
- {
- char *f;
+ if (priv->multiplex_thumbnail_generator)
+ {
+ gchar *f;
- f = g_strdup_printf ("%s/pixmaps/cheese-%i.svg", PACKAGE_DATADIR, g_random_int_range (1, 4));
- pixbuf = gdk_pixbuf_new_from_file (f, NULL);
- g_free (f);
- }
+ f = g_strdup_printf ("/org/gnome/Cheese/pixmaps/cheese-%i.svg",
+ g_random_int_range (1, 4));
+ pixbuf = gdk_pixbuf_new_from_resource (f, NULL);
+ g_free (f);
+ }
else
{
icon_theme = gtk_icon_theme_get_default ();
diff --git a/src/thumbview/cheese-thumbnail.c b/src/thumbview/cheese-thumbnail.c
index 40fe492..3e2f4a2 100644
--- a/src/thumbview/cheese-thumbnail.c
+++ b/src/thumbview/cheese-thumbnail.c
@@ -291,8 +291,9 @@ cheese_thumbnail_add_frame (GdkPixbuf **pixbuf)
void
cheese_thumbnail_init (void)
{
- if (frame == NULL)
- {
- frame = gdk_pixbuf_new_from_file (PACKAGE_DATADIR "/pixmaps/thumbnail-frame.png", NULL);
- }
+ if (frame == NULL)
+ {
+ frame = gdk_pixbuf_new_from_resource ("/org/gnome/Cheese/pixmaps/thumbnail-frame.png",
+ NULL);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]