[gtk+] Fix a thinko in the previous commit



commit 978afce04a765c5faa9d6e60b1bfedbc88925572
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 4 16:06:30 2014 -0400

    Fix a thinko in the previous commit
    
    GTK+ relies on this function silently failing for invalid data.

 gtk/gtkcssprovider.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 62fde1c..24d804a 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2780,7 +2780,7 @@ gtk_css_provider_load_internal (GtkCssProvider *css_provider,
  * Returns: %TRUE. The return value is deprecated and %FALSE will only be
  *     returned for backwards compatibility reasons if an @error is not 
  *     %NULL and a loading error occured. To track errors while loading
- *     CSS, connect to the GtkCssProvider::parsing-error signal.
+ *     CSS, connect to the #GtkCssProvider::parsing-error signal.
  **/
 gboolean
 gtk_css_provider_load_from_data (GtkCssProvider  *css_provider,
@@ -2828,7 +2828,7 @@ gtk_css_provider_load_from_data (GtkCssProvider  *css_provider,
  * Returns: %TRUE. The return value is deprecated and %FALSE will only be
  *     returned for backwards compatibility reasons if an @error is not 
  *     %NULL and a loading error occured. To track errors while loading
- *     CSS, connect to the GtkCssProvider::parsing-error signal.
+ *     CSS, connect to the #GtkCssProvider::parsing-error signal.
  **/
 gboolean
 gtk_css_provider_load_from_file (GtkCssProvider  *css_provider,
@@ -2861,7 +2861,7 @@ gtk_css_provider_load_from_file (GtkCssProvider  *css_provider,
  * Returns: %TRUE. The return value is deprecated and %FALSE will only be
  *     returned for backwards compatibility reasons if an @error is not 
  *     %NULL and a loading error occured. To track errors while loading
- *     CSS, connect to the GtkCssProvider::parsing-error signal.
+ *     CSS, connect to the #GtkCssProvider::parsing-error signal.
  **/
 gboolean
 gtk_css_provider_load_from_path (GtkCssProvider  *css_provider,
@@ -2887,12 +2887,13 @@ gtk_css_provider_load_from_path (GtkCssProvider  *css_provider,
  * gtk_css_provider_load_from_resource:
  * @css_provider: a #GtkCssProvider
  * @resource_path: a #GResource resource path
+ * @error: return location for an error
  *
  * Loads the data contained in the resource at @resource_path into
  * the #GtkCssProvider, clearing any previously loaded information.
  *
- * If there is an error locating the resource or parsing the CSS,
- * then the program will be aborted.
+ * To track errors while loading CSS, connect to the
+ * #GtkCssProvider::parsing-error signal.
  *
  * Since: 3.16
  */
@@ -2902,7 +2903,6 @@ gtk_css_provider_load_from_resource (GtkCssProvider *css_provider,
 {
   GFile *file;
   gchar *uri, *escaped;
-  GError *error;
 
   g_return_if_fail (GTK_IS_CSS_PROVIDER (css_provider));
   g_return_if_fail (resource_path != NULL);
@@ -2915,8 +2915,7 @@ gtk_css_provider_load_from_resource (GtkCssProvider *css_provider,
   file = g_file_new_for_uri (uri);
   g_free (uri);
 
-  if (!gtk_css_provider_load_from_file (css_provider, file, &error))
-    g_error ("Failed to load CSS: %s", error->message); 
+  gtk_css_provider_load_from_file (css_provider, file, NULL);
 
   g_object_unref (file);
 }


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