From 741aab8d163dc513434812af3044a11c552c974b Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Mon, 7 Jun 2004 05:06:17 +0000 Subject: [PATCH] src/inc.c: sync with main (code cleanup); tools/nautlilus2sylpheed.sh: fix whitespace limitation --- AUTHORS | 1 + ChangeLog | 4 +++ ChangeLog.claws | 9 +++++++ ChangeLog.jp | 4 +++ configure.ac | 2 +- src/inc.c | 28 ++++++++----------- tools/README | 4 --- tools/nautilus2sylpheed.sh | 55 +++++++++++++++++++------------------- 8 files changed, 57 insertions(+), 50 deletions(-) diff --git a/AUTHORS b/AUTHORS index dec485995..add183a63 100644 --- a/AUTHORS +++ b/AUTHORS @@ -205,3 +205,4 @@ contributors (beside the above; based on Changelog) Edgar Toernig Fabien Vantard Reza Pakdel + Stephan Sachse diff --git a/ChangeLog b/ChangeLog index 7783f2007..e4ffb39c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-06-07 + + * src/inc.c: inc_all_account_mail(): code cleanup. + 2004-06-03 * src/procmsg.c: procmsg_read_cache_data_str(): changed gint32 to diff --git a/ChangeLog.claws b/ChangeLog.claws index 019a8ff22..3ae6efeaf 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,12 @@ +2004-06-07 [paul] 0.9.11cvs4 + + * src/inc.c + sync with main, 'code cleanup' + + * tools/nautilus2sylpheed.sh + fix whitespace limitation. patch submitted by + Stephan Sachse + 2004-06-04 [christoph] 0.9.11cvs3 * src/account.c diff --git a/ChangeLog.jp b/ChangeLog.jp index 65da38d1d..595943b4d 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,7 @@ +2004-06-07 + + * src/inc.c: inc_all_account_mail(): ¥³¡¼¥É¤ÎÀ°Íý¡£ + 2004-06-03 * src/procmsg.c: procmsg_read_cache_data_str(): ¤¤¤¯¤Ä¤«¤Î´Ä¶­¤Î¤¿¤á diff --git a/configure.ac b/configure.ac index e50f33585..171c45605 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=11 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=3 +EXTRA_VERSION=4 EXTRA_RELEASE= if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then diff --git a/src/inc.c b/src/inc.c index 38cffbfb3..69372f852 100644 --- a/src/inc.c +++ b/src/inc.c @@ -315,8 +315,8 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck, if (account_new_msgs > 0) new_msgs += account_new_msgs; - /* check IMAP4 folders */ - for (; list != NULL; list = list->next) { + /* check IMAP4 / News folders */ + for (list = account_get_list(); list != NULL; list = list->next) { PrefsAccount *account = list->data; if ((account->protocol == A_IMAP4 || account->protocol == A_NNTP) && account->recv_at_getall) { @@ -336,23 +336,17 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck, } } - if (!queue_list) { - inc_finished(mainwin, new_msgs > 0); - main_window_unlock(mainwin); - inc_notify_cmd(new_msgs, notify); - inc_autocheck_timer_set(); - return; - } - - inc_dialog = inc_progress_dialog_create(autocheck); - inc_dialog->queue_list = queue_list; - inc_dialog->mainwin = mainwin; - inc_progress_dialog_set_list(inc_dialog); + if (queue_list) { + inc_dialog = inc_progress_dialog_create(autocheck); + inc_dialog->queue_list = queue_list; + inc_dialog->mainwin = mainwin; + inc_progress_dialog_set_list(inc_dialog); - toolbar_main_set_sensitive(mainwin); - main_window_set_menu_sensitive(mainwin); + toolbar_main_set_sensitive(mainwin); + main_window_set_menu_sensitive(mainwin); + new_msgs += inc_start(inc_dialog); + } - new_msgs += inc_start(inc_dialog); inc_finished(mainwin, new_msgs > 0); main_window_unlock(mainwin); inc_notify_cmd(new_msgs, notify); diff --git a/tools/README b/tools/README index e9da14795..edd42a019 100644 --- a/tools/README +++ b/tools/README @@ -397,10 +397,6 @@ Other tools and restart nautilus (killall -9 nautilus). You will now have a right-click menu item: '/Scripts/nautilus2sylpheed.sh' - LIMITATIONS - Files/Directories with spaces in the names cannot be handled - correctly. - Contact: Reza Pakdel diff --git a/tools/nautilus2sylpheed.sh b/tools/nautilus2sylpheed.sh index 364dca713..677c81324 100644 --- a/tools/nautilus2sylpheed.sh +++ b/tools/nautilus2sylpheed.sh @@ -21,35 +21,34 @@ # This script will recursively attach a number of selected # files/directories from Nautilus to a new blank e-mail. -attachments="" - -attach_dir() -{ - if [ -d $1 ] - then - for j in $(ls $1) - do - attach_dir $1"/"$j - done - else - attachments="$attachments $1" - fi -} - -for i in $* -do - if [ -d $i ] - then - for file in $(ls $i) - do - attach_dir $i"/"$file - done - else - attachments="$attachments $i"; - fi +# Authors: Reza Pakdel +# Stephan Sachse +# +# Fixes: +# Stephan Sachse : files/directorys with whitspaces + + +SELECTED_PATHS="${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS}" +NB_SELECTED_PATHS=`echo -n "${SELECTED_PATHS}" | wc -l | awk '{print $1}'` + +ATTACHMENTS="" + +for ((i=${NB_SELECTED_PATHS}; i>0; i--)) ; do + CURRENT_PATH=`echo -n "${SELECTED_PATHS}" | head -n${i} | tail -n1` + if test -d "${CURRENT_PATH}" ; then + FILES_FOUND=`find "${CURRENT_PATH}" -type f` + NB_FILES_FOUND=`echo "${FILES_FOUND}" | wc -l | awk '{print $1}'` + for ((j=${NB_FILES_FOUND}; j>0; j--)) ; do + CURRENT_FILE=`echo "${FILES_FOUND}" | head -n${j} | tail -n1` + ATTACHMENTS="${ATTACHMENTS} \"${CURRENT_FILE}\"" + done + else + ATTACHMENTS="${ATTACHMENTS} \"${CURRENT_PATH}\"" + fi done echo "-----------" -echo $attachments -sylpheed --compose --attach $attachments +echo ${ATTACHMENTS} + +eval "sylpheed --compose --attach ${ATTACHMENTS}" -- 2.25.1