* small cleanups in icon-factory
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 29 Nov 2006 16:30:25 +0000 (16:30 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 29 Nov 2006 16:30:25 +0000 (16:30 +0000)
* fix type in modest-main

pmo-trunk-r501

src/modest-icon-factory.c
src/modest-icon-factory.h
src/modest-main.c

index 37c0797..c1902a2 100644 (file)
@@ -57,7 +57,7 @@ modest_icon_factory_init   (void)
                            "should be called only once\n");
                return;
        }
-
+       
        icon_hash = g_hash_table_new_full (g_str_hash,
                                           (GEqualFunc)equal_func,
                                           (GDestroyNotify)g_free,
@@ -87,6 +87,8 @@ modest_icon_factory_get_icon (const gchar *name)
        GError *err = NULL;
        GdkPixbuf *pixbuf;
        gpointer orig_key;
+
+       g_return_val_if_fail (name, NULL);
        
        if (!icon_hash) {
                g_printerr ("modest: ModestIconFactory must be initialized first\n");
@@ -100,7 +102,8 @@ modest_icon_factory_get_icon (const gchar *name)
                                           (gpointer*)&pixbuf)) {
                pixbuf = gdk_pixbuf_new_from_file (name, &err);
                if (!pixbuf) {
-                       g_printerr ("modest: error in icon factory: %s\n", err->message);
+                       g_printerr ("modest: error in icon factory while loading '%s': %s\n",
+                                   name, err->message);
                        g_error_free (err);
                }
                /* if we cannot find it, we still insert, so we get the error
@@ -112,12 +115,15 @@ modest_icon_factory_get_icon (const gchar *name)
 }
 
 
+
 GdkPixbuf*
-modest_icon_factory_get_icon_at_size (const gchar *name, int width, int height)
+modest_icon_factory_get_icon_at_size (const gchar *name, guint width, guint height)
 {
        /* FIXME, somehow, cache scaled icons as well... */
        GError *err = NULL;
        GdkPixbuf *pixbuf = NULL;
+
+       g_return_val_if_fail (name, NULL);
        
        if (!icon_hash) {
                g_printerr ("modest: ModestIconFactory must be initialized first\n");
@@ -126,7 +132,8 @@ modest_icon_factory_get_icon_at_size (const gchar *name, int width, int height)
 
        pixbuf = gdk_pixbuf_new_from_file_at_size (name, width, height, &err);
        if (!pixbuf) {
-               g_printerr ("modest: error in icon factory: %s\n", err->message);
+               g_printerr ("modest: error in icon factory while loading '%s'@(%dx%d): %s\n",
+                           name, width, height, err->message);
                g_error_free (err);
        }
        
index d1f45e4..a96f540 100644 (file)
@@ -72,7 +72,7 @@ GdkPixbuf* modest_icon_factory_get_icon (const gchar *name);
  * Returns: a GdkPixBuf for this icon, or NULL in case of error
  * You should NOT unref or modify the pixbuf in any way
  */
-GdkPixbuf* modest_icon_factory_get_icon_at_size (const gchar *name, int width, int height);
+GdkPixbuf* modest_icon_factory_get_icon_at_size (const gchar *name, guint width, guint height);
 
 /* FIXME */
 #define modest_icon_factory_get_small_icon(n) modest_icon_factory_get_icon_at_size(n,16,16)
index df5de2c..118db3f 100644 (file)
@@ -208,10 +208,8 @@ hildon_init ()
                osso_initialize(PACKAGE, PACKAGE_VERSION,
                                TRUE, NULL);    
        if (!osso_context) {
-               g_printerr ("modest: failed to aquire osso context, exiting\n");
-
+               g_printerr ("modest: failed to acquire osso context\n");
                return FALSE;
-               
        }
        
 #endif /* MODEST_PLATFORM_ID==2 */