Blame SOURCES/rhelonly-cleanup-remove-unused-support.c-support.h-generated-.patch

f5c53a
From 9093e083aa78aee6b85345e8fd15424549d01cac Mon Sep 17 00:00:00 2001
f5c53a
From: Lianbo Jiang <lijiang@redhat.com>
f5c53a
Date: Thu, 3 Dec 2020 10:58:33 +0800
f5c53a
Subject: [PATCH] cleanup: remove unused support.c/support.h generated by Glade
f5c53a
f5c53a
The support.c and support.h are automatically generated by Glade, and these
f5c53a
files are not used any more, so let's remove the redundant files and make a
f5c53a
cleanup, which can also make ninja-build happy.
f5c53a
f5c53a
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
f5c53a
---
f5c53a
 src/gui/callbacks.c |   1 -
f5c53a
 src/gui/engine.cc   |   5 --
f5c53a
 src/gui/gtk-lshw.c  |   1 -
f5c53a
 src/gui/support.c   | 144 --------------------------------------------
f5c53a
 src/gui/support.h   |  44 --------------
f5c53a
 5 files changed, 195 deletions(-)
f5c53a
 delete mode 100644 src/gui/support.c
f5c53a
 delete mode 100644 src/gui/support.h
f5c53a
f5c53a
diff --git a/src/gui/callbacks.c b/src/gui/callbacks.c
f5c53a
index b108777fe11f..6b88c82e6098 100644
f5c53a
--- a/src/gui/callbacks.c
f5c53a
+++ b/src/gui/callbacks.c
f5c53a
@@ -5,7 +5,6 @@
f5c53a
 #include <gtk/gtk.h>
f5c53a
 
f5c53a
 #include "callbacks.h"
f5c53a
-#include "support.h"
f5c53a
 #include "version.h"
f5c53a
 #include "engine.h"
f5c53a
 #include <string.h>
f5c53a
diff --git a/src/gui/engine.cc b/src/gui/engine.cc
f5c53a
index 2962ec80d81a..b537ef11db23 100644
f5c53a
--- a/src/gui/engine.cc
f5c53a
+++ b/src/gui/engine.cc
f5c53a
@@ -15,11 +15,6 @@
f5c53a
 
f5c53a
 static const char *id = "@(#) $Id$";
f5c53a
 
f5c53a
-extern "C"
f5c53a
-{
f5c53a
-#include "support.h"
f5c53a
-};
f5c53a
-
f5c53a
 #define AUTOMATIC "automatic file format"
f5c53a
 #define LSHW_XML "lshw XML format (.lshw, .xml)"
f5c53a
 #define PLAIN_TEXT "plain text document (.text, .txt)"
f5c53a
diff --git a/src/gui/gtk-lshw.c b/src/gui/gtk-lshw.c
f5c53a
index d3e531c4ceb3..090484317c6e 100644
f5c53a
--- a/src/gui/gtk-lshw.c
f5c53a
+++ b/src/gui/gtk-lshw.c
f5c53a
@@ -2,7 +2,6 @@
f5c53a
 #include <unistd.h>
f5c53a
 #include <gtk/gtk.h>
f5c53a
 
f5c53a
-#include "support.h"
f5c53a
 #include "config.h"
f5c53a
 #include "stock.h"
f5c53a
 #include "engine.h"
f5c53a
diff --git a/src/gui/support.c b/src/gui/support.c
f5c53a
deleted file mode 100644
f5c53a
index 7dc3c78cb605..000000000000
f5c53a
--- a/src/gui/support.c
f5c53a
+++ /dev/null
f5c53a
@@ -1,144 +0,0 @@
f5c53a
-/*
f5c53a
- * DO NOT EDIT THIS FILE - it is generated by Glade.
f5c53a
- */
f5c53a
-
f5c53a
-#ifdef HAVE_CONFIG_H
f5c53a
-#  include <config.h>
f5c53a
-#endif
f5c53a
-
f5c53a
-#include <sys/types.h>
f5c53a
-#include <sys/stat.h>
f5c53a
-#include <unistd.h>
f5c53a
-#include <string.h>
f5c53a
-#include <stdio.h>
f5c53a
-
f5c53a
-#include <gtk/gtk.h>
f5c53a
-
f5c53a
-#include "support.h"
f5c53a
-
f5c53a
-GtkWidget*
f5c53a
-lookup_widget                          (GtkWidget       *widget,
f5c53a
-                                        const gchar     *widget_name)
f5c53a
-{
f5c53a
-  GtkWidget *parent, *found_widget;
f5c53a
-
f5c53a
-  for (;;)
f5c53a
-    {
f5c53a
-      if (GTK_IS_MENU (widget))
f5c53a
-        parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
f5c53a
-      else
f5c53a
-        parent = widget->parent;
f5c53a
-      if (!parent)
f5c53a
-        parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
f5c53a
-      if (parent == NULL)
f5c53a
-        break;
f5c53a
-      widget = parent;
f5c53a
-    }
f5c53a
-
f5c53a
-  found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
f5c53a
-                                                 widget_name);
f5c53a
-  if (!found_widget)
f5c53a
-    g_warning ("Widget not found: %s", widget_name);
f5c53a
-  return found_widget;
f5c53a
-}
f5c53a
-
f5c53a
-static GList *pixmaps_directories = NULL;
f5c53a
-
f5c53a
-/* Use this function to set the directory containing installed pixmaps. */
f5c53a
-void
f5c53a
-add_pixmap_directory                   (const gchar     *directory)
f5c53a
-{
f5c53a
-  pixmaps_directories = g_list_prepend (pixmaps_directories,
f5c53a
-                                        g_strdup (directory));
f5c53a
-}
f5c53a
-
f5c53a
-/* This is an internally used function to find pixmap files. */
f5c53a
-static gchar*
f5c53a
-find_pixmap_file                       (const gchar     *filename)
f5c53a
-{
f5c53a
-  GList *elem;
f5c53a
-
f5c53a
-  /* We step through each of the pixmaps directory to find it. */
f5c53a
-  elem = pixmaps_directories;
f5c53a
-  while (elem)
f5c53a
-    {
f5c53a
-      gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
f5c53a
-                                         G_DIR_SEPARATOR_S, filename);
f5c53a
-      if (g_file_test (pathname, G_FILE_TEST_EXISTS))
f5c53a
-        return pathname;
f5c53a
-      g_free (pathname);
f5c53a
-      elem = elem->next;
f5c53a
-    }
f5c53a
-  return NULL;
f5c53a
-}
f5c53a
-
f5c53a
-/* This is an internally used function to create pixmaps. */
f5c53a
-GtkWidget*
f5c53a
-create_pixmap                          (GtkWidget       *widget,
f5c53a
-                                        const gchar     *filename)
f5c53a
-{
f5c53a
-  gchar *pathname = NULL;
f5c53a
-  GtkWidget *pixmap;
f5c53a
-
f5c53a
-  if (!filename || !filename[0])
f5c53a
-      return gtk_image_new ();
f5c53a
-
f5c53a
-  pathname = find_pixmap_file (filename);
f5c53a
-
f5c53a
-  if (!pathname)
f5c53a
-    {
f5c53a
-      g_warning ("Couldn't find pixmap file: %s", filename);
f5c53a
-      return gtk_image_new ();
f5c53a
-    }
f5c53a
-
f5c53a
-  pixmap = gtk_image_new_from_file (pathname);
f5c53a
-  g_free (pathname);
f5c53a
-  return pixmap;
f5c53a
-}
f5c53a
-
f5c53a
-/* This is an internally used function to create pixmaps. */
f5c53a
-GdkPixbuf*
f5c53a
-create_pixbuf                          (const gchar     *filename)
f5c53a
-{
f5c53a
-  gchar *pathname = NULL;
f5c53a
-  GdkPixbuf *pixbuf;
f5c53a
-  GError *error = NULL;
f5c53a
-
f5c53a
-  if (!filename || !filename[0])
f5c53a
-      return NULL;
f5c53a
-
f5c53a
-  pathname = find_pixmap_file (filename);
f5c53a
-
f5c53a
-  if (!pathname)
f5c53a
-    {
f5c53a
-      g_warning ("Couldn't find pixmap file: %s", filename);
f5c53a
-      return NULL;
f5c53a
-    }
f5c53a
-
f5c53a
-  pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
f5c53a
-  if (!pixbuf)
f5c53a
-    {
f5c53a
-      fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
f5c53a
-               pathname, error->message);
f5c53a
-      g_error_free (error);
f5c53a
-    }
f5c53a
-  g_free (pathname);
f5c53a
-  return pixbuf;
f5c53a
-}
f5c53a
-
f5c53a
-/* This is used to set ATK action descriptions. */
f5c53a
-void
f5c53a
-glade_set_atk_action_description       (AtkAction       *action,
f5c53a
-                                        const gchar     *action_name,
f5c53a
-                                        const gchar     *description)
f5c53a
-{
f5c53a
-  gint n_actions, i;
f5c53a
-
f5c53a
-  n_actions = atk_action_get_n_actions (action);
f5c53a
-  for (i = 0; i < n_actions; i++)
f5c53a
-    {
f5c53a
-      if (!strcmp (atk_action_get_name (action, i), action_name))
f5c53a
-        atk_action_set_description (action, i, description);
f5c53a
-    }
f5c53a
-}
f5c53a
-
f5c53a
diff --git a/src/gui/support.h b/src/gui/support.h
f5c53a
deleted file mode 100644
f5c53a
index 2dea079c2a42..000000000000
f5c53a
--- a/src/gui/support.h
f5c53a
+++ /dev/null
f5c53a
@@ -1,44 +0,0 @@
f5c53a
-/*
f5c53a
- * DO NOT EDIT THIS FILE - it is generated by Glade.
f5c53a
- */
f5c53a
-
f5c53a
-#ifdef HAVE_CONFIG_H
f5c53a
-#  include <config.h>
f5c53a
-#endif
f5c53a
-
f5c53a
-#include <gtk/gtk.h>
f5c53a
-
f5c53a
-/*
f5c53a
- * Public Functions.
f5c53a
- */
f5c53a
-
f5c53a
-/*
f5c53a
- * This function returns a widget in a component created by Glade.
f5c53a
- * Call it with the toplevel widget in the component (i.e. a window/dialog),
f5c53a
- * or alternatively any widget in the component, and the name of the widget
f5c53a
- * you want returned.
f5c53a
- */
f5c53a
-GtkWidget*  lookup_widget              (GtkWidget       *widget,
f5c53a
-                                        const gchar     *widget_name);
f5c53a
-
f5c53a
-
f5c53a
-/* Use this function to set the directory containing installed pixmaps. */
f5c53a
-void        add_pixmap_directory       (const gchar     *directory);
f5c53a
-
f5c53a
-
f5c53a
-/*
f5c53a
- * Private Functions.
f5c53a
- */
f5c53a
-
f5c53a
-/* This is used to create the pixmaps used in the interface. */
f5c53a
-GtkWidget*  create_pixmap              (GtkWidget       *widget,
f5c53a
-                                        const gchar     *filename);
f5c53a
-
f5c53a
-/* This is used to create the pixbufs used in the interface. */
f5c53a
-GdkPixbuf*  create_pixbuf              (const gchar     *filename);
f5c53a
-
f5c53a
-/* This is used to set ATK action descriptions. */
f5c53a
-void        glade_set_atk_action_description (AtkAction       *action,
f5c53a
-                                              const gchar     *action_name,
f5c53a
-                                              const gchar     *description);
f5c53a
-
f5c53a
-- 
f5c53a
2.17.1
f5c53a