src/inc.c: sync with main (code cleanup); tools/nautlilus2sylpheed.sh: fix whitespace...
authorPaul Mangan <paul@claws-mail.org>
Mon, 7 Jun 2004 05:06:17 +0000 (05:06 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 7 Jun 2004 05:06:17 +0000 (05:06 +0000)
AUTHORS
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/inc.c
tools/README
tools/nautilus2sylpheed.sh

diff --git a/AUTHORS b/AUTHORS
index dec4859..add183a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -205,3 +205,4 @@ contributors (beside the above; based on Changelog)
        Edgar Toernig
        Fabien Vantard
        Reza Pakdel
+       Stephan Sachse
index 7783f20..e4ffb39 100644 (file)
--- 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
index 019a8ff..3ae6efe 100644 (file)
@@ -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 <white@teg-clan.de>
+
 2004-06-04 [christoph] 0.9.11cvs3
 
        * src/account.c
index 65da38d..595943b 100644 (file)
@@ -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(): ¤¤¤¯¤Ä¤«¤Î´Ä¶­¤Î¤¿¤á
index e50f335..171c456 100644 (file)
@@ -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
index 38cffbf..69372f8 100644 (file)
--- 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);
index e9da147..edd42a0 100644 (file)
@@ -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 <hrpakdel@cpsc.ucalgary.ca>
 
 
index 364dca7..677c813 100644 (file)
 # 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 <hrpakdel@cpsc.ucalgary.ca>
+#                 Stephan Sachse <white@teg-clan.de>
+#
+# 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}"