[libslab] Remove libgnomeui usage.
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Subject: [libslab] Remove libgnomeui usage.
- Date: Tue, 21 Jul 2009 21:04:28 +0000 (UTC)
commit 41e246d9adcea93eb8ab46272c49b1fc5929c6e3
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Jun 30 19:57:18 2009 +0200
Remove libgnomeui usage.
libslab/document-tile.c | 16 +++++++++-------
libslab/libslab-utils.c | 6 +++---
libslab/libslab-utils.h | 5 +++--
3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/libslab/document-tile.c b/libslab/document-tile.c
index 33522a7..6c439db 100644
--- a/libslab/document-tile.c
+++ b/libslab/document-tile.c
@@ -22,7 +22,6 @@
#include <glib/gi18n.h>
#include <string.h>
-#include <libgnomeui/gnome-icon-lookup.h>
#include <gio/gio.h>
#include "slab-gnome-util.h"
@@ -413,7 +412,8 @@ load_image (DocumentTile *tile)
gchar *icon_id = NULL;
gboolean free_icon_id = TRUE;
- GnomeThumbnailFactory *thumbnail_factory;
+ GnomeDesktopThumbnailFactory *thumbnail_factory;
+ GIcon *icon;
libslab_checkpoint ("document-tile.c: load_image(): start for %s", TILE (tile)->uri);
@@ -429,12 +429,14 @@ load_image (DocumentTile *tile)
thumbnail_factory = libslab_thumbnail_factory_get ();
- icon_id = gnome_thumbnail_factory_lookup (thumbnail_factory, TILE (tile)->uri, priv->modified);
+ icon_id = gnome_desktop_thumbnail_factory_lookup (thumbnail_factory, TILE (tile)->uri, priv->modified);
- if (! icon_id)
- icon_id = gnome_icon_lookup (
- gtk_icon_theme_get_default (), thumbnail_factory,
- TILE (tile)->uri, NULL, NULL, priv->mime_type, 0, NULL);
+ if (! icon_id) {
+ icon = g_content_type_get_icon (priv->mime_type);
+ g_object_get (icon, "name", &icon_id, NULL);
+
+ g_object_unref (icon);
+ }
exit:
diff --git a/libslab/libslab-utils.c b/libslab/libslab-utils.c
index a54fe29..3a2d50b 100644
--- a/libslab/libslab-utils.c
+++ b/libslab/libslab-utils.c
@@ -593,7 +593,7 @@ libslab_spawn_command (const gchar *cmd)
}
static guint thumbnail_factory_idle_id;
-static GnomeThumbnailFactory *thumbnail_factory;
+static GnomeDesktopThumbnailFactory *thumbnail_factory;
static void
create_thumbnail_factory (void)
@@ -606,7 +606,7 @@ create_thumbnail_factory (void)
libslab_checkpoint ("create_thumbnail_factory(): start");
- thumbnail_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL);
+ thumbnail_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL);
libslab_checkpoint ("create_thumbnail_factory(): end");
}
@@ -625,7 +625,7 @@ libslab_thumbnail_factory_preinit (void)
thumbnail_factory_idle_id = g_idle_add (init_thumbnail_factory_idle_cb, NULL);
}
-GnomeThumbnailFactory *
+GnomeDesktopThumbnailFactory *
libslab_thumbnail_factory_get (void)
{
if (thumbnail_factory_idle_id != 0) {
diff --git a/libslab/libslab-utils.h b/libslab/libslab-utils.h
index bb887d2..322a00a 100644
--- a/libslab/libslab-utils.h
+++ b/libslab/libslab-utils.h
@@ -5,7 +5,8 @@
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
#include <libgnome/gnome-desktop-item.h>
-#include <libgnomeui/gnome-thumbnail.h>
+#define GNOME_DESKTOP_USE_UNSTABLE_API 1
+#include <libgnomeui/gnome-desktop-thumbnail.h>
G_BEGIN_DECLS
@@ -31,7 +32,7 @@ void libslab_spawn_command (const gchar *cmd);
GdkScreen *libslab_get_current_screen (void);
void libslab_thumbnail_factory_preinit (void);
-GnomeThumbnailFactory *libslab_thumbnail_factory_get (void);
+GnomeDesktopThumbnailFactory *libslab_thumbnail_factory_get (void);
void libslab_checkpoint_init (const char *checkpoint_config_file_basename, const char *checkpoint_file_basename);
void libslab_checkpoint (const char *format, ...);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]