[gitg] Use GResource for icons



commit 552bcc3dbea04bb8cdeab29edaf7e65571edbea7
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Oct 23 13:25:26 2012 +0200

    Use GResource for icons

 data/icons/Makefile.am            |    3 ---
 gitg/gitg-application.vala        |    4 ++--
 gitg/resources/gitg-resources.xml |    2 ++
 3 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index a3d3b72..92fc5c1 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -24,9 +24,6 @@ private_icons = \
 
 gtk_update_icon_cache = gtk-update-icon-cache -f -t
 
-iconsdir = $(datadir)/gitg/icons
-icons_DATA = $(private_icons)
-
 update-icon-cache:
 	@-if test -z "$(DESTDIR)"; then \
 		echo "Updating Gtk icon cache."; \
diff --git a/gitg/gitg-application.vala b/gitg/gitg-application.vala
index 0c72e6e..58b35dc 100644
--- a/gitg/gitg-application.vala
+++ b/gitg/gitg-application.vala
@@ -188,13 +188,13 @@ public class Application : Gtk.Application
 
 		try
 		{
-			logo = new Gdk.Pixbuf.from_file(Dirs.build_data_file("icons", "gitg.svg"));
+			logo = new Gdk.Pixbuf.from_resource("/org/gnome/gitg/icons/gitg.svg");
 		}
 		catch
 		{
 			try
 			{
-				logo = new Gdk.Pixbuf.from_file(Dirs.build_data_file("icons", "gitg128x128.png"));
+				logo = new Gdk.Pixbuf.from_resource("org/gnome/gitg/icons/gitg128x128.png");
 			}
 			catch {}
 		}
diff --git a/gitg/resources/gitg-resources.xml b/gitg/resources/gitg-resources.xml
index 54887b4..49f1f10 100644
--- a/gitg/resources/gitg-resources.xml
+++ b/gitg/resources/gitg-resources.xml
@@ -5,6 +5,8 @@
     <file>ui/gitg-menus.ui</file>
     <file>ui/style.css</file>
     <file>ui/gitg-preferences.ui</file>
+    <file alias="icons/gitg.svg" compressed="true" preprocess="xml-stripblanks">../../data/icons/gitg.svg</file>
+    <file alias="icons/gitg128x128.png">../../data/icons/gitg128x128.png</file>
   </gresource>
 </gresources>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]