[libgda] removing warning for png not found



commit 7e2cb358418a020839eb07f174b9ff3b1ead68ee
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Sep 20 13:14:56 2018 -0500

    removing warning for png not found

 libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c | 19 ++++++++-----------
 libgda-ui/gdaui.gresource.xml                         | 19 ++-----------------
 2 files changed, 10 insertions(+), 28 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c 
b/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
index addbcb536..550c2181a 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
@@ -92,7 +92,6 @@ enum {
 
 static GObjectClass *parent_class = NULL;
 static guint bin_cell_signals[LAST_SIGNAL] = { 0 };
-static GdkPixbuf *attach_pixbuf = NULL;
 
 
 GType
@@ -198,14 +197,6 @@ gdaui_data_cell_renderer_bin_class_init (GdauiDataCellRendererBinClass *class)
                              G_TYPE_NONE, 2,
                              G_TYPE_STRING,
                              G_TYPE_VALUE);
-
-       if (! attach_pixbuf) {
-               #define ICON_FILE "/gdaui/images/data/bin-attachment.png"
-               attach_pixbuf = gdk_pixbuf_new_from_resource (ICON_FILE, NULL);
-               if (!attach_pixbuf)
-                       g_warning (_("Could not find icon file %s in resources please report error to "
-                                  "https://gitlab.gnome.org/GNOME/libgda/issues";), ICON_FILE);
-       }
 }
 
 static void
@@ -273,9 +264,15 @@ gdaui_data_cell_renderer_bin_set_property (GObject *object,
                /* Because we don't have a copy of the value, we MUST NOT free it! */
                if (value) {    
                         GValue *gval = g_value_get_boxed (value);
-                       if (gval && (G_VALUE_TYPE (gval) != GDA_TYPE_NULL))
+                       if (gval && (G_VALUE_TYPE (gval) != GDA_TYPE_NULL)) {
+                               GError *error = NULL;
+                               GdkPixbuf *attach_pixbuf = gdk_pixbuf_new_from_resource 
("/gdaui/bin-attachment.png", &error);
+                               if (!attach_pixbuf)
+                                       g_warning (_("Could not find icon file bin-attachment.png in 
resources please report error to "
+                                                        "https://gitlab.gnome.org/GNOME/libgda/issues. Error 
message: %s"),
+                                                                                error != NULL ? 
error->message != NULL ? error->message : _("No detail") : _("No detail"));
                                g_object_set (object, "pixbuf", attach_pixbuf, NULL);
-                       else if (gval)
+                       } else if (gval)
                                g_object_set (object, "pixbuf", NULL, NULL);
                        else {
                                cell->priv->invalid = TRUE;
diff --git a/libgda-ui/gdaui.gresource.xml b/libgda-ui/gdaui.gresource.xml
index ce94b3725..418622586 100644
--- a/libgda-ui/gdaui.gresource.xml
+++ b/libgda-ui/gdaui.gresource.xml
@@ -2,29 +2,12 @@
 <gresources>
   <gresource prefix="/gdaui">
     <file compressed="true">gdaui.css</file>
-  </gresource>
-  <gresource prefix="/gdaui">
     <file compressed="true">gdaui-layout.dtd</file>
-  </gresource>
-  <gresource prefix="/gdaui/images">
-    <file compressed="no">data/gdaui-generic.png</file>
-  </gresource>
-  <gresource prefix="/gdaui">
     <file compressed="true">data/mime-types-extensions</file>
-  </gresource>
-  <gresource prefix="/gdaui">
     <file compressed="true">data-entries/gdaui-entry-string.xml</file>
-  </gresource>
-  <gresource prefix="/gdaui">
     <file compressed="true">data-entries/gdaui-entry-integer.xml</file>
-  </gresource>
-  <gresource prefix="/gdaui">
     <file compressed="true">data-entries/gdaui-entry-number.xml</file>
-  </gresource>
-  <gresource prefix="/gdaui/glade">
     <file compressed="true">data/server_operation.xml</file>
-  </gresource>
-  <gresource prefix="/gdaui/db-engines">
     <file>data/Bdb.png</file>
     <file>data/Firebird.png</file>
     <file>data/LDAP.png</file>
@@ -37,5 +20,7 @@
     <file>data/SQLCipher.png</file>
     <file>data/SqlServer.png</file>
     <file>data/Web.png</file>
+    <file>data/gdaui-generic.png</file>
+    <file>data/bin-attachment.png</file>
   </gresource>
 </gresources>


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