gtkui_transfer.c: merge `gftpui_gtk_ok()` into `on_gtk_dialog_response_transferdlg()`
@@ -177,13 +177,18 @@ on_gtk_button_clicked_skip (GtkButton *button, gpointer data)
static void
-gftpui_gtk_ok (gpointer data)
+on_gtk_dialog_response_transferdlg (GtkDialog *dialog,
+ gint response,
+ gpointer user_data)
+{
+ gftp_transfer * tdata = (gftp_transfer *) user_data;
+
+ /* click on OK */
+ if (response == GTK_RESPONSE_OK)
{
- gftp_transfer * tdata;
gftp_file * tempfle;
GList * templist;
- tdata = data;
g_mutex_lock (&tdata->structmutex);
for (templist = tdata->files; templist != NULL; templist = templist->next)
{
@@ -193,31 +198,18 @@ gftpui_gtk_ok (gpointer data)
}
tdata->ready = 1;
- if (templist == NULL)
- {
+ if (templist == NULL) {
tdata->show = 0;
tdata->done = 1;
- }
- else
+ } else {
tdata->show = 1;
-
- g_mutex_unlock (&tdata->structmutex);
}
+ g_mutex_unlock (&tdata->structmutex);
-static void
-on_gtk_dialog_response_transferdlg (GtkDialog *dialog,
- gint response,
- gpointer user_data)
-{
- if (response == GTK_RESPONSE_OK)
- {
- gftpui_gtk_ok (user_data);
gtk_widget_destroy (GTK_WIDGET (dialog));
return;
}
- gftp_transfer * tdata = (gftp_transfer *) user_data;
-
/* cancel transfers */
g_mutex_lock (&tdata->structmutex);
tdata->show = 0;
