[pan2] upload fix for bpf setting in prefs



commit abe908dc60c7104fb3e967c4efc289fcd3a971b7
Author: Heinrich MÃller <henmull src gnome org>
Date:   Mon Feb 11 20:55:25 2013 +0100

    upload fix for bpf setting in prefs

 pan/gui/post-ui.cc  |    1 +
 pan/gui/prefs-ui.cc |    2 +-
 uulib/uuencode.c    |   58 ++++++++++++++++++++++++++++----------------------
 3 files changed, 34 insertions(+), 27 deletions(-)
---
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 7223240..bb6ca43 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -1232,6 +1232,7 @@ PostUI :: maybe_post_message (GMimeMessage * message)
 
       TaskUpload::UploadInfo f;
       f.total=1;
+      f.bpf = _prefs.get_int("upload-option-bpf",512*1024);
       TaskUpload::Needed n;
       n.mid = out;
 
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index e1db387..934b899 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -385,7 +385,7 @@ namespace pan
 
   GtkWidget* new_spin_button (const char *key, int low, int high, Prefs &prefs)
   {
-    guint tm = prefs.get_int(key, 5 );
+    guint tm = prefs.get_int(key, low );
     GtkAdjustment *adj = (GtkAdjustment*) gtk_adjustment_new(tm, low, high, 1.0, 1.0, 0.0);
     GtkWidget *w = gtk_spin_button_new( adj, 1.0, 0);
     g_object_set_data_full(G_OBJECT(w), PREFS_KEY, g_strdup(key), g_free);
diff --git a/uulib/uuencode.c b/uulib/uuencode.c
index ebddb7e..53c753c 100644
--- a/uulib/uuencode.c
+++ b/uulib/uuencode.c
@@ -909,33 +909,39 @@ UUEncodeStream_byFSize (FILE *outfile, FILE *infile, int encoding, long bpf, crc
 
           char tmp = (char) ((int) itemp[index] + 42);
 
-          switch (tmp)
-            {
-            case '\0':
-//          case '\t':  yEnc 1.3 draft
-            case '\n':
-            case '\r':
-            case '=':
-            case '\033':
-              *optr++ = '=';
-              *optr++ = tmp + 64;
-              llen += 2;
-              break;
-
-            case '.':
-              if (llen == 0)
-                {
-                  *optr++ = '=';
-                  *optr++ =  tmp + 64;
-                  llen += 2;
-                  break;
-              }
+          switch ((char) ((int) itemp[index] + 42))
+                          {
+                          case '\0':
+          //                case '\t':  yEnc 1.3 draft
+                          case '\n':
+                          case '\r':
+                          case '=':
+                          case '\033':
+                            *optr++ = '=';
+                            *optr++ = (char) ((int) itemp[index] + 42 + 64);
+                            llen += 2;
+                            break;
+
+                          case '.':
+                            if (llen == 0)
+                              {
+                                *optr++ = '=';
+                                *optr++ = (char) ((int) itemp[index] + 42 + 64);
+                                llen += 2;
+                              }
+                            else
+                              {
+                                *optr++ = (char) ((int) itemp[index] + 42);
+                                llen++;
+                              }
+                            break;
+
+                          default:
+                            *optr++ = (char) ((int) itemp[index] + 42);
+                            llen++;
+                            break;
+                          }
 
-            default:
-              *optr++ = tmp;
-              llen++;
-              break;
-            }
         }
 
         rest -= count;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]