diff --git a/src/access.c b/src/access.c
index f469dba..b856a34 100644
--- a/src/access.c
+++ b/src/access.c
@@ -110,12 +110,9 @@ send_response (AccessDialogHandle *handle)
}
static void
-access_dialog_response (GtkWidget *widget,
- int response,
- gpointer user_data)
+access_dialog_response (AccessDialogHandle *handle,
+ int response)
{
- AccessDialogHandle *handle = user_data;
-
switch (response)
{
default:
@@ -138,9 +135,8 @@ access_dialog_response (GtkWidget *widget,
}
static gboolean
-handle_close (XdpImplRequest *object,
- GDBusMethodInvocation *invocation,
- AccessDialogHandle *handle)
+handle_close (AccessDialogHandle *handle,
+ GDBusMethodInvocation *invocation G_GNUC_UNUSED)
{
GVariantBuilder opt_builder;
@@ -181,7 +177,7 @@ add_choice (GtkWidget *box,
{
GtkWidget *label;
GtkWidget *group = NULL;
- int i;
+ gsize i;
label = gtk_label_new (name);
gtk_widget_show (label);
@@ -315,7 +311,7 @@ handle_access_dialog (XdpImplAccess *object,
if (choices)
{
- int i;
+ gsize i;
choice_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
for (i = 0; i < g_variant_n_children (choices); i++)
@@ -359,9 +355,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
handle->external_parent = external_parent;
handle->choices = choice_table;
- g_signal_connect (request, "handle-close", G_CALLBACK (handle_close), handle);
+ g_signal_connect_swapped (request, "handle-close", G_CALLBACK (handle_close), handle);
- g_signal_connect (dialog, "response", G_CALLBACK (access_dialog_response), handle);
+ g_signal_connect_swapped (dialog, "response", G_CALLBACK (access_dialog_response), handle);
gtk_widget_realize (dialog);
diff --git a/src/account.c b/src/account.c
index 6d2e494..2bf770f 100644
--- a/src/account.c
+++ b/src/account.c
@@ -84,15 +84,12 @@ send_response (AccountDialogHandle *handle)
}
static void
-account_dialog_done (GtkWidget *widget,
+account_dialog_done (AccountDialogHandle *handle,
int response,
const char *user_name,
const char *real_name,
- const char *icon_file,
- gpointer user_data)
+ const char *icon_file)
{
- AccountDialogHandle *handle = user_data;
-
g_clear_pointer (&handle->user_name, g_free);
g_clear_pointer (&handle->real_name, g_free);
g_clear_pointer (&handle->icon_uri, g_free);
@@ -123,9 +120,8 @@ account_dialog_done (GtkWidget *widget,
}
static gboolean
-handle_close (XdpImplRequest *object,
- GDBusMethodInvocation *invocation,
- AccountDialogHandle *handle)
+handle_close (AccountDialogHandle *handle,
+ GDBusMethodInvocation *invocation G_GNUC_UNUSED)
{
GVariantBuilder opt_builder;
@@ -206,9 +202,9 @@ handle_get_user_information (XdpImplAccount *object,
handle->real_name = g_strdup (real_name);
handle->icon_uri = g_filename_to_uri (icon_file, NULL, NULL);
- g_signal_connect (request, "handle-close", G_CALLBACK (handle_close), handle);
+ g_signal_connect_swapped (request, "handle-close", G_CALLBACK (handle_close), handle);
- g_signal_connect (dialog, "done", G_CALLBACK (account_dialog_done), handle);
+ g_signal_connect_swapped (dialog, "done", G_CALLBACK (account_dialog_done), handle);
gtk_widget_realize (dialog);
diff --git a/src/accountdialog.c b/src/accountdialog.c
index 823f20a..5f9c293 100644
--- a/src/accountdialog.c
+++ b/src/accountdialog.c
@@ -58,7 +58,8 @@ account_dialog_finalize (GObject *object)
}
static gboolean
-account_dialog_delete_event (GtkWidget *dialog, GdkEventAny *event)
+account_dialog_delete_event (GtkWidget *dialog,
+ GdkEventAny *event G_GNUC_UNUSED)
{
gtk_widget_hide (dialog);
diff --git a/src/appchooser.c b/src/appchooser.c
index 6b3a275..7c654eb 100644
--- a/src/appchooser.c
+++ b/src/appchooser.c
@@ -228,7 +228,7 @@ handle_choose_application (XdpImplAppChooser *object,
}
static gboolean
-handle_update_choices (XdpImplAppChooser *object,
+handle_update_choices (XdpImplAppChooser *object G_GNUC_UNUSED,
GDBusMethodInvocation *invocation,
const char *arg_handle,
const char **choices)
diff --git a/src/appchooserdialog.c b/src/appchooserdialog.c
index 1bbe9c7..6104b43 100644
--- a/src/appchooserdialog.c
+++ b/src/appchooserdialog.c
@@ -76,7 +76,7 @@ G_DEFINE_TYPE (AppChooserDialog, app_chooser_dialog, GTK_TYPE_WINDOW)
static void
update_header (GtkListBoxRow *row,
GtkListBoxRow *before,
- gpointer data)
+ gpointer data G_GNUC_UNUSED)
{
if (before != NULL &&
gtk_list_box_row_get_header (row) == NULL)
@@ -125,7 +125,7 @@ close_dialog (AppChooserDialog *dialog,
static void
show_more (AppChooserDialog *dialog)
{
- int i;
+ guint i;
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (dialog->scrolled_window),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
@@ -147,9 +147,8 @@ show_more (AppChooserDialog *dialog)
}
static void
-row_activated (GtkListBox *list,
- GtkWidget *row,
- AppChooserDialog *dialog)
+row_activated (AppChooserDialog *dialog,
+ GtkWidget *row)
{
GAppInfo *info = NULL;
@@ -165,24 +164,21 @@ row_activated (GtkListBox *list,
}
static void
-row_selected (GtkListBox *list,
- GtkWidget *row,
- AppChooserDialog *dialog)
+row_selected (AppChooserDialog *dialog,
+ GtkWidget *row)
{
gtk_widget_set_sensitive (dialog->open_button, TRUE);
dialog->selected_row = row;
}
static void
-cancel_clicked (GtkWidget *button,
- AppChooserDialog *dialog)
+cancel_clicked (AppChooserDialog *dialog)
{
close_dialog (dialog, NULL);
}
static void
-open_clicked (GtkWidget *button,
- AppChooserDialog *dialog)
+open_clicked (AppChooserDialog *dialog)
{
GAppInfo *info = NULL;
@@ -230,14 +226,14 @@ launch_software (AppChooserDialog *dialog)
}
static void
-find_in_software (GtkWidget *button,
- AppChooserDialog *dialog)
+find_in_software (AppChooserDialog *dialog)
{
launch_software (dialog);
}
static gboolean
-app_chooser_delete_event (GtkWidget *dialog, GdkEventAny *event)
+app_chooser_delete_event (GtkWidget *dialog,
+ GdkEventAny *event G_GNUC_UNUSED)
{
close_dialog (APP_CHOOSER_DIALOG (dialog), NULL);
@@ -319,7 +315,7 @@ static void
ensure_default_in_initial_list (const char **choices,
const char *default_id)
{
- int i;
+ guint i;
guint n_choices;
if (default_id == NULL)
@@ -350,11 +346,10 @@ ensure_default_in_initial_list (const char **choices,
}
static void
-more_pressed (GtkGestureMultiPress *gesture,
+more_pressed (AppChooserDialog *dialog,
int n_press,
- double x,
- double y,
- AppChooserDialog *dialog)
+ double x G_GNUC_UNUSED,
+ double y)
{
if (n_press != 1)
return;
@@ -370,8 +365,8 @@ app_chooser_dialog_new (const char **choices,
const char *location)
{
AppChooserDialog *dialog;
- int n_choices;
- int i;
+ guint n_choices;
+ guint i;
g_autofree char *short_location = shorten_location (location);
dialog = g_object_new (app_chooser_dialog_get_type (), NULL);
@@ -446,7 +441,7 @@ app_chooser_dialog_new (const char **choices,
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_PRIMARY);
- g_signal_connect (gesture, "pressed", G_CALLBACK (more_pressed), dialog);
+ g_signal_connect_swapped (gesture, "pressed", G_CALLBACK (more_pressed), dialog);
gtk_list_box_row_set_selectable (GTK_LIST_BOX_ROW (row), FALSE);
image = gtk_image_new_from_icon_name ("view-more-symbolic", GTK_ICON_SIZE_BUTTON);
@@ -467,7 +462,7 @@ void
app_chooser_dialog_update_choices (AppChooserDialog *dialog,
const char **choices)
{
- int i;
+ guint i;
GPtrArray *new_choices;
new_choices = g_ptr_array_new ();
diff --git a/src/appchooserdialog.ui b/src/appchooserdialog.ui
index 1dbb1c4..6ffaaaf 100644
--- a/src/appchooserdialog.ui
+++ b/src/appchooserdialog.ui
@@ -13,7 +13,7 @@
1
_Cancel
1
-
+
@@ -23,7 +23,7 @@
_Open
1
1
-
+
@@ -67,8 +67,8 @@
-
-
+
+
single
0
1
@@ -140,7 +140,7 @@
-
+