Blame SOURCES/0001-printers-Remove-unused-function.patch

34cf59
From 80dce1ee4ccf3807761da5a6b16057e81f17a319 Mon Sep 17 00:00:00 2001
34cf59
From: Marek Kasik <mkasik@redhat.com>
34cf59
Date: Fri, 22 May 2015 11:17:07 +0200
34cf59
Subject: [PATCH 1/2] printers: Remove unused function
34cf59
34cf59
Function printer_set_default_media_size() is not used anywhere
34cf59
in Printer panel.
34cf59
34cf59
https://bugzilla.gnome.org/show_bug.cgi?id=748569
34cf59
---
34cf59
 panels/printers/pp-utils.c | 58 ----------------------------------------------
34cf59
 panels/printers/pp-utils.h |  2 --
34cf59
 2 files changed, 60 deletions(-)
34cf59
34cf59
diff --git a/panels/printers/pp-utils.c b/panels/printers/pp-utils.c
34cf59
index 7d84dea..3eb8e60 100644
34cf59
--- a/panels/printers/pp-utils.c
34cf59
+++ b/panels/printers/pp-utils.c
34cf59
@@ -1341,64 +1341,6 @@ get_paper_size_from_locale ()
34cf59
     return "iso-a4";
34cf59
 }
34cf59
 
34cf59
-/* Set default media size according to the locale */
34cf59
-void
34cf59
-printer_set_default_media_size (const gchar *printer_name)
34cf59
-{
34cf59
-  GVariantBuilder  array_builder;
34cf59
-  GDBusConnection *bus;
34cf59
-  GVariant        *output;
34cf59
-  GError          *error = NULL;
34cf59
-
34cf59
-  bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
34cf59
-  if (!bus)
34cf59
-   {
34cf59
-     g_warning ("Failed to get system bus: %s", error->message);
34cf59
-     g_error_free (error);
34cf59
-     return;
34cf59
-   }
34cf59
-
34cf59
-  g_variant_builder_init (&array_builder, G_VARIANT_TYPE ("as"));
34cf59
-  g_variant_builder_add (&array_builder, "s", get_paper_size_from_locale ());
34cf59
-
34cf59
-  output = g_dbus_connection_call_sync (bus,
34cf59
-                                        MECHANISM_BUS,
34cf59
-                                        "/",
34cf59
-                                        MECHANISM_BUS,
34cf59
-                                        "PrinterAddOption",
34cf59
-                                        g_variant_new ("(ssas)",
34cf59
-                                                       printer_name,
34cf59
-                                                       "media",
34cf59
-                                                       &array_builder),
34cf59
-                                        G_VARIANT_TYPE ("(s)"),
34cf59
-                                        G_DBUS_CALL_FLAGS_NONE,
34cf59
-                                        -1,
34cf59
-                                        NULL,
34cf59
-                                        &error);
34cf59
-
34cf59
-  g_object_unref (bus);
34cf59
-
34cf59
-  if (output)
34cf59
-    {
34cf59
-      const gchar *ret_error;
34cf59
-
34cf59
-      g_variant_get (output, "(&s)", &ret_error);
34cf59
-      if (ret_error[0] != '\0')
34cf59
-        g_warning ("cups-pk-helper: setting of media size for printer %s failed: %s", printer_name, ret_error);
34cf59
-
34cf59
-      g_variant_unref (output);
34cf59
-    }
34cf59
-  else
34cf59
-    {
34cf59
-      if (!(error->domain == G_DBUS_ERROR &&
34cf59
-            (error->code == G_DBUS_ERROR_SERVICE_UNKNOWN ||
34cf59
-             error->code == G_DBUS_ERROR_UNKNOWN_METHOD)))
34cf59
-        g_warning ("%s", error->message);
34cf59
-      g_error_free (error);
34cf59
-    }
34cf59
-}
34cf59
-
34cf59
-
34cf59
 typedef struct
34cf59
 {
34cf59
   gchar        *printer_name;
34cf59
diff --git a/panels/printers/pp-utils.h b/panels/printers/pp-utils.h
34cf59
index 6543181..37af065 100644
34cf59
--- a/panels/printers/pp-utils.h
34cf59
+++ b/panels/printers/pp-utils.h
34cf59
@@ -144,8 +144,6 @@ gchar      *printer_get_hostname (cups_ptype_t  printer_type,
34cf59
                                   const gchar  *device_uri,
34cf59
                                   const gchar  *printer_uri);
34cf59
 
34cf59
-void        printer_set_default_media_size (const gchar *printer_name);
34cf59
-
34cf59
 typedef void (*PSPCallback) (gchar    *printer_name,
34cf59
                              gboolean  success,
34cf59
                              gpointer  user_data);
34cf59
-- 
34cf59
2.4.3
34cf59