Mercurial > gftp.yaz
changeset 441:f8a0c22af707
2004-3-20 Brian Masney <masneyb@gftp.org>
* src/gtk/chmod_dialog.c - use gftpui_common_run_callback_function()
to do the chmod operation. This will spawn a thread if necessary
author | masneyb |
---|---|
date | Sat, 20 Mar 2004 19:17:48 +0000 |
parents | 44a018ea578c |
children | 9d03253b00d0 |
files | ChangeLog src/gtk/chmod_dialog.c |
diffstat | 2 files changed, 33 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat Mar 20 18:48:40 2004 +0000 +++ b/ChangeLog Sat Mar 20 19:17:48 2004 +0000 @@ -1,4 +1,7 @@ -2004-3-19 Brian Masney <masneyb@gftp.org> +2004-3-20 Brian Masney <masneyb@gftp.org> + * src/gtk/chmod_dialog.c - use gftpui_common_run_callback_function() + to do the chmod operation. This will spawn a thread if necessary + * debian/gftp-text.prerm - missing debian package file * Makefile.am - updated with EXTRA_DIST variable with the list of the @@ -7,6 +10,7 @@ * debian/* - updated Debian package files from Aurelien Jarno <aurelien@aurel32.net> +2004-3-19 Brian Masney <masneyb@gftp.org> * lib/gftp.h - if _LARGEFILE_SOURCE is defined, but _LARGEFILE64_SOURCE is not defined, define it @@ -2338,7 +2342,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.245 2004/03/20 18:48:40 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.246 2004/03/20 19:17:47 masneyb Exp $ tags * debian/* - updated files from Debian maintainer
--- a/src/gtk/chmod_dialog.c Sat Mar 20 18:48:40 2004 +0000 +++ b/src/gtk/chmod_dialog.c Sat Mar 20 19:17:48 2004 +0000 @@ -25,66 +25,40 @@ static int mode; -static void * -do_chmod_thread (void * data) +static int +do_chmod_thread (gftpui_callback_data * cdata) { - int success, num, sj; - intptr_t network_timeout; GList * filelist, * templist; gftp_window_data * wdata; gftp_file * tempfle; - - wdata = data; - - gftp_lookup_request_option (wdata->request, "network_timeout", - &network_timeout); + int error, num; - if (gftpui_common_use_threads (wdata->request)) - { - sj = sigsetjmp (gftpui_common_jmp_environment, 1); - gftpui_common_use_jmp_environment = 1; - } - else - sj = 0; + wdata = cdata->uidata; + error = 0; - success = 0; - if (sj == 0) - { - filelist = wdata->files; - templist = GTK_CLIST (wdata->listbox)->selection; - num = 0; - while (templist != NULL) - { - templist = get_next_selection (templist, &filelist, &num); - tempfle = filelist->data; - if (network_timeout > 0) - alarm (network_timeout); - if (gftp_chmod (wdata->request, tempfle->file, mode) == 0) - success = 1; - if (!GFTP_IS_CONNECTED (wdata->request)) - break; - } - alarm (0); - } - else + filelist = wdata->files; + templist = GTK_CLIST (wdata->listbox)->selection; + num = 0; + while (templist != NULL) { - gftp_disconnect (wdata->request); - wdata->request->logging_function (gftp_logging_error, - wdata->request, - _("Operation canceled\n")); + templist = get_next_selection (templist, &filelist, &num); + tempfle = filelist->data; + + if (gftp_chmod (wdata->request, tempfle->file, mode) != 0) + error = 1; + + if (!GFTP_IS_CONNECTED (wdata->request)) + break; } - if (gftpui_common_use_threads (wdata->request)) - gftpui_common_use_jmp_environment = 0; - - wdata->request->stopable = 0; - return (GINT_TO_POINTER (success)); + return (error); } static void dochmod (GtkWidget * widget, gftp_window_data * wdata) { + gftpui_callback_data * cdata; int cur, ret; mode = 0; @@ -125,9 +99,14 @@ if (check_reconnect (wdata) < 0) return; - ret = GPOINTER_TO_INT (gftpui_generic_thread (do_chmod_thread, wdata)); - if (ret) - gftpui_refresh (wdata); + cdata = g_malloc0 (sizeof (*cdata)); + cdata->request = wdata->request; + cdata->uidata = wdata; + cdata->run_function = do_chmod_thread; + + ret = gftpui_common_run_callback_function (cdata); + + g_free (cdata); }