[gnome-control-center] printers: Remove unused class members
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] printers: Remove unused class members
- Date: Thu, 2 Jul 2020 16:25:28 +0000 (UTC)
commit b994237acd16d7aab1f92864bf99d68d4e52bc34
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Jun 26 15:45:46 2020 +1200
printers: Remove unused class members
panels/printers/cc-printers-panel.c | 13 -------------
panels/printers/pp-details-dialog.c | 3 ---
panels/printers/pp-ipp-option-widget.c | 1 -
panels/printers/pp-new-printer-dialog.c | 24 ++++++++++--------------
panels/printers/pp-options-dialog.c | 7 -------
panels/printers/pp-ppd-selection-dialog.c | 5 -----
panels/printers/pp-printer-entry.c | 4 ----
panels/printers/pp-samba.c | 9 ---------
8 files changed, 10 insertions(+), 56 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index b038ad4d9..1c77434ef 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -94,9 +94,6 @@ struct _CcPrintersPanel
PPDList *all_ppds_list;
gchar *new_printer_name;
- gchar *new_printer_location;
- gchar *new_printer_make_and_model;
- gboolean new_printer_on_network;
gchar *renamed_printer_name;
gchar *old_printer_name;
@@ -109,8 +106,6 @@ struct _CcPrintersPanel
GVariant *action;
GtkSizeGroup *size_group;
-
- gpointer dummy;
};
CC_PANEL_REGISTER (CcPrintersPanel, cc_printers_panel)
@@ -307,8 +302,6 @@ cc_printers_panel_dispose (GObject *object)
g_clear_object (&self->pp_new_printer_dialog);
g_clear_pointer (&self->new_printer_name, g_free);
- g_clear_pointer (&self->new_printer_location, g_free);
- g_clear_pointer (&self->new_printer_make_and_model, g_free);
g_clear_pointer (&self->renamed_printer_name, g_free);
g_clear_pointer (&self->old_printer_name, g_free);
g_clear_object (&self->builder);
@@ -961,9 +954,6 @@ new_printer_dialog_pre_response_cb (CcPrintersPanel *self,
gboolean is_network_device)
{
self->new_printer_name = g_strdup (device_name);
- self->new_printer_location = g_strdup (device_location);
- self->new_printer_make_and_model = g_strdup (device_make_and_model);
- self->new_printer_on_network = is_network_device;
actualize_printers_list (self);
}
@@ -975,9 +965,6 @@ new_printer_dialog_response_cb (CcPrintersPanel *self,
if (self->pp_new_printer_dialog)
g_clear_object (&self->pp_new_printer_dialog);
- g_clear_pointer (&self->new_printer_location, g_free);
- g_clear_pointer (&self->new_printer_make_and_model, g_free);
-
if (response_id == GTK_RESPONSE_REJECT)
{
GtkWidget *message_dialog;
diff --git a/panels/printers/pp-details-dialog.c b/panels/printers/pp-details-dialog.c
index 70e67cd63..f9d97e5c1 100644
--- a/panels/printers/pp-details-dialog.c
+++ b/panels/printers/pp-details-dialog.c
@@ -52,7 +52,6 @@ struct _PpDetailsDialog {
GtkButton *search_for_drivers_button;
gchar *printer_name;
- gchar *printer_location;
gchar *ppd_file_name;
PPDList *all_ppds_list;
GCancellable *cancellable;
@@ -306,7 +305,6 @@ pp_details_dialog_dispose (GObject *object)
PpDetailsDialog *self = PP_DETAILS_DIALOG (object);
g_clear_pointer (&self->printer_name, g_free);
- g_clear_pointer (&self->printer_location, g_free);
g_clear_pointer (&self->ppd_file_name, g_free);
if (self->all_ppds_list != NULL)
@@ -363,7 +361,6 @@ pp_details_dialog_new (gchar *printer_name,
NULL);
self->printer_name = g_strdup (printer_name);
- self->printer_location = g_strdup (printer_location);
self->ppd_file_name = NULL;
/* Translators: This is the title of the dialog. %s is the printer name. */
diff --git a/panels/printers/pp-ipp-option-widget.c b/panels/printers/pp-ipp-option-widget.c
index 97ba832bf..d9c79d3b7 100644
--- a/panels/printers/pp-ipp-option-widget.c
+++ b/panels/printers/pp-ipp-option-widget.c
@@ -41,7 +41,6 @@ struct _PpIPPOptionWidget
GtkWidget *switch_button;
GtkWidget *spin_button;
GtkWidget *combo;
- GtkWidget *box;
IPPAttribute *option_supported;
IPPAttribute *option_default;
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index dea07a76c..be900813f 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -109,9 +109,6 @@ struct _PpNewPrinterDialog
gboolean samba_authenticated_searching;
gboolean samba_searching;
- GtkCellRenderer *text_renderer;
- GtkCellRenderer *icon_renderer;
-
PpPPDSelectionDialog *ppd_selection_dialog;
PpPrintDevice *new_device;
@@ -548,9 +545,6 @@ pp_new_printer_dialog_finalize (GObject *object)
g_cancellable_cancel (self->remote_host_cancellable);
g_cancellable_cancel (self->cancellable);
- self->text_renderer = NULL;
- self->icon_renderer = NULL;
-
g_clear_handle_id (&self->host_search_timeout_id, g_source_remove);
g_clear_object (&self->remote_host_cancellable);
g_clear_object (&self->cancellable);
@@ -1889,6 +1883,8 @@ populate_devices_list (PpNewPrinterDialog *self)
GEmblem *emblem;
PpCups *cups;
GIcon *icon, *emblem_icon;
+ GtkCellRenderer *text_renderer;
+ GtkCellRenderer *icon_renderer;
g_signal_connect_object (gtk_tree_view_get_selection (self->treeview),
"changed", G_CALLBACK (device_selection_changed_cb), self, G_CONNECT_SWAPPED);
@@ -1909,21 +1905,21 @@ populate_devices_list (PpNewPrinterDialog *self)
g_object_unref (emblem_icon);
g_object_unref (emblem);
- self->icon_renderer = gtk_cell_renderer_pixbuf_new ();
- g_object_set (self->icon_renderer, "stock-size", GTK_ICON_SIZE_DIALOG, NULL);
- gtk_cell_renderer_set_alignment (self->icon_renderer, 1.0, 0.5);
- gtk_cell_renderer_set_padding (self->icon_renderer, 4, 4);
- column = gtk_tree_view_column_new_with_attributes ("Icon", self->icon_renderer,
+ icon_renderer = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (icon_renderer, "stock-size", GTK_ICON_SIZE_DIALOG, NULL);
+ gtk_cell_renderer_set_alignment (icon_renderer, 1.0, 0.5);
+ gtk_cell_renderer_set_padding (icon_renderer, 4, 4);
+ column = gtk_tree_view_column_new_with_attributes ("Icon", icon_renderer,
"gicon", DEVICE_GICON_COLUMN, NULL);
gtk_tree_view_column_set_max_width (column, -1);
gtk_tree_view_column_set_min_width (column, 80);
gtk_tree_view_append_column (self->treeview, column);
- self->text_renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes ("Devices", self->text_renderer,
+ text_renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes ("Devices", text_renderer,
NULL);
- gtk_tree_view_column_set_cell_data_func (column, self->text_renderer, cell_data_func,
+ gtk_tree_view_column_set_cell_data_func (column, text_renderer, cell_data_func,
self, NULL);
gtk_tree_view_append_column (self->treeview, column);
diff --git a/panels/printers/pp-options-dialog.c b/panels/printers/pp-options-dialog.c
index e41d04e7a..37de75307 100644
--- a/panels/printers/pp-options-dialog.c
+++ b/panels/printers/pp-options-dialog.c
@@ -61,10 +61,6 @@ struct _PpOptionsDialog {
GHashTable *ipp_attributes;
gboolean ipp_attributes_set;
- gboolean populating_dialog;
-
- GtkResponseType response;
-
gboolean sensitive;
};
@@ -679,8 +675,6 @@ populate_options_real (PpOptionsDialog *self)
if ((model = gtk_tree_view_get_model (self->categories_treeview)) != NULL &&
gtk_tree_model_get_iter_first (model, &iter))
gtk_tree_selection_select_iter (self->categories_selection, &iter);
-
- self->populating_dialog = FALSE;
}
static void
@@ -902,7 +896,6 @@ pp_options_dialog_new (gchar *printer_name,
gtk_window_set_title (GTK_WINDOW (self), printer_name);
- self->populating_dialog = TRUE;
populate_options (self);
return self;
diff --git a/panels/printers/pp-ppd-selection-dialog.c b/panels/printers/pp-ppd-selection-dialog.c
index 7c0f5927c..c94a7c3b4 100644
--- a/panels/printers/pp-ppd-selection-dialog.c
+++ b/panels/printers/pp-ppd-selection-dialog.c
@@ -52,7 +52,6 @@ enum
struct _PpPPDSelectionDialog {
GtkBuilder *builder;
- GtkWidget *parent;
GtkWidget *dialog;
UserResponseCallback user_callback;
@@ -60,7 +59,6 @@ struct _PpPPDSelectionDialog {
gchar *ppd_name;
gchar *ppd_display_name;
- GtkResponseType response;
gchar *manufacturer;
PPDList *list;
@@ -294,7 +292,6 @@ ppd_selection_dialog_response_cb (PpPPDSelectionDialog *self,
pp_ppd_selection_dialog_hide (self);
- self->response = response_id;
if (response_id == GTK_RESPONSE_OK)
{
models_treeview = (GtkTreeView*)
@@ -336,7 +333,6 @@ pp_ppd_selection_dialog_new (GtkWindow *parent,
self = g_new0 (PpPPDSelectionDialog, 1);
self->builder = gtk_builder_new ();
- self->parent = GTK_WIDGET (parent);
builder_result = gtk_builder_add_objects_from_resource (self->builder,
"/org/gnome/control-center/printers/ppd-selection-dialog.ui",
@@ -352,7 +348,6 @@ pp_ppd_selection_dialog_new (GtkWindow *parent,
self->user_callback = user_callback;
self->user_data = user_data;
- self->response = GTK_RESPONSE_NONE;
self->list = ppd_list_copy (ppd_list);
self->manufacturer = get_standard_manufacturers_name (manufacturer);
diff --git a/panels/printers/pp-printer-entry.c b/panels/printers/pp-printer-entry.c
index 7273982eb..b3f25bab4 100644
--- a/panels/printers/pp-printer-entry.c
+++ b/panels/printers/pp-printer-entry.c
@@ -46,8 +46,6 @@ struct _PpPrinterEntry
GtkListBoxRow parent;
gchar *printer_name;
- gchar *ppd_file_name;
- int num_jobs;
gboolean is_accepting_jobs;
gchar *printer_make_and_model;
gchar *printer_location;
@@ -79,9 +77,7 @@ struct _PpPrinterEntry
GtkLabel *error_status;
/* Dialogs */
- PpDetailsDialog *pp_details_dialog;
PpJobsDialog *pp_jobs_dialog;
- PpOptionsDialog *pp_options_dialog;
GCancellable *get_jobs_cancellable;
};
diff --git a/panels/printers/pp-samba.c b/panels/printers/pp-samba.c
index 80add734b..1dfc2cc12 100644
--- a/panels/printers/pp-samba.c
+++ b/panels/printers/pp-samba.c
@@ -33,9 +33,6 @@ struct _PpSamba
PpHost parent_instance;
/* Auth info */
- gchar *server;
- gchar *share;
- gchar *workgroup;
gchar *username;
gchar *password;
gboolean waiting;
@@ -48,9 +45,6 @@ pp_samba_finalize (GObject *object)
{
PpSamba *self = PP_SAMBA (object);
- g_clear_pointer (&self->server, g_free);
- g_clear_pointer (&self->share, g_free);
- g_clear_pointer (&self->workgroup, g_free);
g_clear_pointer (&self->username, g_free);
g_clear_pointer (&self->password, g_free);
@@ -150,9 +144,6 @@ auth_fn (SMBCCTX *smb_context,
if (!data->cancelled)
{
- samba->server = g_strdup (server);
- samba->share = g_strdup (share);
- samba->workgroup = g_strdup (workgroup);
samba->username = g_strdup (username);
samba->password = g_strdup (password);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]