gnome-build r608 - in trunk: . src/gbf



Author: jhs
Date: Wed Sep  3 06:20:36 2008
New Revision: 608
URL: http://svn.gnome.org/viewvc/gnome-build?rev=608&view=rev

Log:
2008-09-03  Johannes Schmid  <jhs idefix>

	* configure.in:
	* src/gbf/gbf-project-util.c (build_types_store):
	* src/gbf/gbf-project-view.c (destroy), (get_icon), (set_pixbuf),
	(gbf_project_view_instance_init):
	#550514 â gdl does not build

Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/gbf/gbf-project-util.c
   trunk/src/gbf/gbf-project-view.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Wed Sep  3 06:20:36 2008
@@ -45,7 +45,8 @@
 XML_REQUIRED=2.5.8
 VFS_REQUIRED=2.3.5
 LIBGLADE_REQUIRED=2.0.1
-GDL_REQUIRED=0.7.0
+GDL_REQUIRED=2.23.0
+GIO_REQUIRED=2.16.0
 
 AC_SUBST(GTK_REQUIRED)
 AC_SUBST(GNOME_REQUIRED)
@@ -54,6 +55,7 @@
 AC_SUBST(VFS_REQUIRED)
 AC_SUBST(LIBGLADE_REQUIRED)
 AC_SUBST(GDL_REQUIRED)
+AC_SUBST(GIO_REQUIRED)
 
 AC_PATH_PROG(PKG_CONFIG, pkg-config,no)
 if test x$PKG_CONFIG = xno; then
@@ -72,10 +74,8 @@
 	libglade-2.0 >= $LIBGLADE_REQUIRED
 	libbonoboui-2.0 >= $LIBBONOBOUI_REQUIRED
 	libxml-2.0 >= $XML_REQUIRED
-	gnome-vfs-2.0 >= $VFS_REQUIRED
-	gdl-1.0 >= $GDL_REQUIRED
-	gdl-gnome-1.0 >= $GDL_REQUIRED
-	gnome-vfs-module-2.0 >= $VFS_REQUIRED)
+	gio-2.0 >= $GIO_REQUIRED
+	gdl-1.0 >= $GDL_REQUIRED)
 AC_SUBST(GBF_CFLAGS)
 AC_SUBST(GBF_LIBS)
 

Modified: trunk/src/gbf/gbf-project-util.c
==============================================================================
--- trunk/src/gbf/gbf-project-util.c	(original)
+++ trunk/src/gbf/gbf-project-util.c	Wed Sep  3 06:20:36 2008
@@ -31,7 +31,6 @@
 #include <libgnomevfs/gnome-vfs-uri.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <bonobo/bonobo-file-selector-util.h>
-#include <gdl/gdl-icons.h>
 
 #include "gbf-i18n.h"
 #include "gbf-tree-data.h"
@@ -40,6 +39,7 @@
 #include "gbf-project-model.h"
 #include "gbf-project-util.h"
 
+#define ICON_SIZE 16
 
 #define GLADE_FILE GBF_GLADEDIR "/create_dialogs.glade"
 
@@ -304,23 +304,23 @@
     GtkTreeIter iter;
     gchar **types;
     gint i;
-    GdlIcons *icons;
     
     types = gbf_project_get_types (project);
     store = gtk_list_store_new (TARGET_TYPE_N_COLUMNS,
                                 G_TYPE_STRING,
                                 G_TYPE_STRING,
                                 GDK_TYPE_PIXBUF);
-
-    icons = gdl_icons_new (16);
     
     for (i = 0; types [i]; i++) {
         GdkPixbuf *pixbuf;
         const gchar *name;
 
         name = gbf_project_name_for_type (project, types [i]);
-        pixbuf = gdl_icons_get_mime_icon (icons,
-                                          gbf_project_mimetype_for_type (project, types [i]));
+        pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
+                                           GTK_STOCK_CONVERT,
+                                           ICON_SIZE,
+                                           GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+                                           NULL);
 
         gtk_list_store_append (store, &iter);
         gtk_list_store_set (store, &iter,
@@ -333,7 +333,6 @@
             g_object_unref (pixbuf);
     }
 
-    g_object_unref (icons);
     g_strfreev (types);
 
     return store;

Modified: trunk/src/gbf/gbf-project-view.c
==============================================================================
--- trunk/src/gbf/gbf-project-view.c	(original)
+++ trunk/src/gbf/gbf-project-view.c	Wed Sep  3 06:20:36 2008
@@ -27,16 +27,10 @@
 #endif
 
 #include <gdk/gdk.h>
-#include <gtk/gtkcellrendererpixbuf.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtktreeselection.h>
-#include <libgnomevfs/gnome-vfs-types.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
+#include <gtk/gtk.h>
 #include <libgnome/gnome-macros.h>
-#include <libgnomeui/gnome-icon-lookup.h>
+#include <gio/gio.h>
 #include <string.h>
-#include <gdl/gdl-icons.h>
 
 #include "gbf-i18n.h"
 #include "gbf-tree-data.h"
@@ -44,8 +38,10 @@
 #include "gbf-project-model.h"
 #include "gbf-project-view.h"
 
+#define ICON_SIZE 16
+
 struct _GbfProjectViewPrivate {	
-	GdlIcons *icons;
+
 };
 
 enum {
@@ -125,7 +121,6 @@
 	priv = tree->priv;
 	
 	if (priv) {
-		g_object_unref (priv->icons);
 		g_free (priv);
 		tree->priv = NULL;
 	}
@@ -134,6 +129,35 @@
 		(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
 }
 
+static GdkPixbuf*
+get_icon (const gchar* uri)
+{
+	const gchar** icon_names;
+	GtkIconInfo* icon_info;
+	GIcon* icon;
+	GdkPixbuf* pixbuf = NULL;
+	GFile* file;
+	GFileInfo* file_info;
+	
+	file = g_file_new_for_uri (uri);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_ICON,
+				       G_FILE_QUERY_INFO_NONE,
+				       NULL,
+				       NULL);
+	
+	icon = g_file_info_get_icon(file_info);
+	g_object_get (icon, "names", &icon_names, NULL);
+	icon_info = gtk_icon_theme_choose_icon (gtk_icon_theme_get_default(),
+						icon_names,
+						ICON_SIZE,
+						GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+	pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
+	gtk_icon_info_free(icon_info);
+	
+	return pixbuf;
+}
+
 static void
 set_pixbuf (GtkTreeViewColumn *tree_column,
 	    GtkCellRenderer   *cell,
@@ -141,9 +165,9 @@
 	    GtkTreeIter       *iter,
 	    gpointer           user_data)
 {
-	GbfProjectView *view = GBF_PROJECT_VIEW (user_data);
+	//GbfProjectView *view = GBF_PROJECT_VIEW (user_data);
 	GbfTreeData *data = NULL;
-	GdkPixbuf *pixbuf;
+	GdkPixbuf *pixbuf = NULL;
 	
 	gtk_tree_model_get (model, iter,
 			    GBF_PROJECT_MODEL_COLUMN_DATA, &data, -1);
@@ -151,31 +175,24 @@
 	
 	switch (data->type) {
 		case GBF_TREE_NODE_TARGET_SOURCE:
-			pixbuf = gdl_icons_get_uri_icon (view->priv->icons,
-							 data->uri);
+		{
+			pixbuf = get_icon (data->uri);
 			break;
+		}
 		case GBF_TREE_NODE_GROUP:
-			pixbuf = gdl_icons_get_folder_icon (view->priv->icons);
+			pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
+							   GTK_STOCK_DIRECTORY,
+							   ICON_SIZE,
+							   GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+							   NULL);
 			break;
 		case GBF_TREE_NODE_TARGET: 
 		{
-			pixbuf = gdl_icons_get_mime_icon (view->priv->icons,
-							  data->mime_type);
-#if 0
-			const gchar* icon;
-			icon = 
-				gnome_icon_lookup(gtk_icon_theme_get_default(),
-						  NULL, NULL, NULL, NULL,
-						  data->mime_type,
-						  0, NULL);
-			if (icon)
-			{
-				pixbuf = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
-								  icon, 16, 0, NULL);
-			}
-			else
-				pixbuf = NULL;
-#endif
+			pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
+							   GTK_STOCK_CONVERT,
+							   ICON_SIZE,
+							   GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+							   NULL);
 			break;
 		}
 		default:
@@ -319,8 +336,6 @@
 
 	priv = g_new0 (GbfProjectViewPrivate, 1);
 	tree->priv = priv;
-
-	priv->icons = gdl_icons_new (16);
     
 	gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree), FALSE);
 	gtk_tree_view_set_enable_search (GTK_TREE_VIEW (tree), TRUE);



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