printers: Do not crash due to wrong argument

Callback for handling of "notification-dismiss-button" got its
parameters swapped. This resulted in crash when user closed
notification about deleted printer.
This commit converts the on_notification_dismissed() function
to accept swapped arguments as was probably intended.
This commit is contained in:
Marek Kasik 2020-06-03 17:59:01 +02:00
parent c6cc59b973
commit cdb4727690

View file

@ -636,11 +636,8 @@ on_printer_deletion_undone (CcPrintersPanel *self)
}
static void
on_notification_dismissed (GtkButton *button,
gpointer user_data)
on_notification_dismissed (CcPrintersPanel *self)
{
CcPrintersPanel *self = (CcPrintersPanel*) user_data;
if (self->deleted_printer_name != NULL)
{
PpPrinter *printer;
@ -660,7 +657,7 @@ on_notification_dismissed (GtkButton *button,
static gboolean
on_remove_printer_timeout (gpointer user_data)
{
on_notification_dismissed (NULL, user_data);
on_notification_dismissed (user_data);
return G_SOURCE_REMOVE;
}
@ -675,7 +672,7 @@ on_printer_deleted (CcPrintersPanel *self,
gtk_widget_hide (GTK_WIDGET (printer_entry));
on_notification_dismissed (NULL, self);
on_notification_dismissed (self);
g_object_get (printer_entry,
"printer-name", &printer_name,