[gtk] window: Remove _set_default_icon_from_file



commit 79664567c4959b7023a9dcb91ee441c02e5254a3
Author: Timm Bäder <mail baedert org>
Date:   Sun Dec 30 06:29:12 2018 +0100

    window: Remove _set_default_icon_from_file

 gtk/gtkwindow.c | 58 ---------------------------------------------------------
 gtk/gtkwindow.h |  3 ---
 2 files changed, 61 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 491c4aa291..5d422e562b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4947,36 +4947,6 @@ gtk_window_get_icon (GtkWindow  *window)
     return NULL;
 }
 
-/* Load surface, printing warning on failure if error == NULL
- */
-static GdkTexture *
-load_texture_verbosely (const char *filename,
-                       GError    **err)
-{
-  GFile *file;
-  GError *local_err = NULL;
-  GdkTexture *texture;
-
-  file = g_file_new_for_path (filename);
-  texture = gdk_texture_new_from_file (file, &local_err);
-  g_object_unref (file);
-
-  if (!texture)
-    {
-      if (err)
-       *err = local_err;
-      else
-       {
-         g_warning ("Error loading icon from file '%s':\n\t%s",
-                    filename, local_err->message);
-         g_error_free (local_err);
-       }
-      return NULL;
-    }
-
-  return texture;
-}
-
 /**
  * gtk_window_set_default_icon_list:
  * @list: (element-type GdkTexture) (transfer container): a list of #GdkTextures
@@ -5110,34 +5080,6 @@ gtk_window_get_default_icon_name (void)
   return default_icon_name;
 }
 
-/**
- * gtk_window_set_default_icon_from_file:
- * @filename: (type filename): location of icon file
- * @err: (allow-none): location to store error, or %NULL.
- *
- * Sets an icon to be used as fallback for windows that haven't
- * had gtk_window_set_icon_list() called on them from a file
- * on disk. Warns on failure if @err is %NULL.
- *
- * Returns: %TRUE if setting the icon succeeded.
- **/
-gboolean
-gtk_window_set_default_icon_from_file (const gchar *filename,
-                                      GError     **err)
-{
-  GdkTexture *texture = load_texture_verbosely (filename, err);
-
-  if (texture)
-    {
-      gtk_window_set_default_icon (texture);
-      g_object_unref (texture);
-      
-      return TRUE;
-    }
-  else
-    return FALSE;
-}
-
 /**
  * gtk_window_get_default_icon_list:
  * 
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 889ca89656..7840c8a3e8 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -297,9 +297,6 @@ GDK_AVAILABLE_IN_ALL
 void       gtk_window_set_default_icon_name        (const gchar *name);
 GDK_AVAILABLE_IN_ALL
 const gchar * gtk_window_get_default_icon_name     (void);
-GDK_AVAILABLE_IN_ALL
-gboolean   gtk_window_set_default_icon_from_file   (const gchar *filename,
-                                                   GError     **err);
 
 GDK_AVAILABLE_IN_ALL
 void       gtk_window_set_auto_startup_notification (gboolean setting);


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