[pan2/testing: 115/279] last commit before merge i hope



commit 7839f472154e58072ca6bd3fddf490c971b9d422
Author: Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
Date:   Thu Jun 23 12:48:28 2011 +0200

    last commit before merge i hope

 pan/gui/post-ui.cc            |   12 +++++-------
 pan/tasks/encoder.cc          |    3 +--
 pan/tasks/task-upload.cc      |    5 ++---
 pan/usenet-utils/mime-utils.h |    2 +-
 uulib/uuencode.c              |   12 ++++++------
 5 files changed, 15 insertions(+), 19 deletions(-)
---
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 6b88b9f..b744910 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -722,9 +722,6 @@ PostUI :: send_and_save_now ()
   if (!check_charset())
     return;
 
-  std::cerr<<"send and save now : "<<_file_queue_empty <<" "<< _prefs.get_flag(MESSAGE_ID_PREFS_KEY,false) << " "
-  <<(_file_queue_empty || !_prefs.get_flag(MESSAGE_ID_PREFS_KEY,false))<<std::endl;
-
   if (_file_queue_empty || !_prefs.get_flag(MESSAGE_ID_PREFS_KEY,false))
   {
     GtkWidget * d = gtk_message_dialog_new (GTK_WINDOW(_root),
@@ -2592,7 +2589,8 @@ PostUI :: select_parts ()
 
   if (!_upload_ptr) return;
 
-  _total_parts = (int) (((long)_upload_ptr->get_byte_count() + (4000*YENC_HALF_LINE_LEN-1)) / (4000*YENC_HALF_LINE_LEN));
+  int lpf = lpf = _prefs.get_int("upload-option-lpf",4000);
+  _total_parts = (int) (((long)_upload_ptr->get_byte_count() + (lpf*YENC_HALF_LINE_LEN-1)) / (lpf*YENC_HALF_LINE_LEN));
 
   GtkWidget * w;
   GtkTreeIter iter;
@@ -2810,7 +2808,6 @@ PostUI :: prompt_user_for_queueable_files (GtkWindow * parent, const Prefs& pref
 
     // query lines per file value
     ui.lpf = _prefs.get_int("upload-option-lpf",4000);
-    std::cerr<<"got "<<ui.lpf<<std::endl;
 
     // generate domain name for upload if the flag is set
     bool custom_mid(_prefs.get_flag(MESSAGE_ID_PREFS_KEY,false));
@@ -2825,8 +2822,9 @@ PostUI :: prompt_user_for_queueable_files (GtkWindow * parent, const Prefs& pref
 		  a.subject = subject;
 		  a.author = author;
       stat ((const char*)cur->data,&sb);
-      int total = (int) (((long)sb.st_size + (YENC_LINES_PER_FILE*YENC_HALF_LINE_LEN-1)) /
-                          (YENC_LINES_PER_FILE*YENC_HALF_LINE_LEN));
+      int lpf = _prefs.get_int("upload-option-lpf",4000);
+      int total = (int) (((long)sb.st_size + (lpf*YENC_HALF_LINE_LEN-1)) /
+                          (lpf*YENC_HALF_LINE_LEN));
 
       char* basename = g_path_get_basename((const char*)cur->data);
       TaskUpload::needed_t import;
diff --git a/pan/tasks/encoder.cc b/pan/tasks/encoder.cc
index 16dd581..49d6f77 100644
--- a/pan/tasks/encoder.cc
+++ b/pan/tasks/encoder.cc
@@ -67,7 +67,6 @@ Encoder :: generate_unique_id (StringView& mid, int cnt, std::string& s)
   out << mid;
   //std::cerr << "rng : "<<out.str()<<std::endl;
   s = out.str();
-  std::cerr<<"unique id : "<<mid<<" "<<cnt<<" "<<s<<std::endl;
 }
 
 Encoder :: Encoder (WorkerPool& pool):
@@ -158,7 +157,7 @@ Encoder :: do_work()
       Article* tmp = article;
 
       /* build real subject line */
-      g_snprintf(buf, sizeof(buf), "\"%s\" - %s (/%03d)", basename.c_str(), subject.c_str(), needed->size());
+      g_snprintf(buf, sizeof(buf), "\"%s\" - %s (/%03d)", basename.c_str(), subject.c_str(), (int)needed->size());
       tmp->subject = buf;
 
       char cachename[4096];
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index 1daaf02..c13887b 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -131,8 +131,8 @@ void
 TaskUpload :: build_needed_tasks(bool imported)
 {
 
-  _total_parts = (int) (((long)get_byte_count() + (YENC_LINES_PER_FILE*YENC_HALF_LINE_LEN-1)) /
-                        (YENC_LINES_PER_FILE*YENC_HALF_LINE_LEN));
+  _total_parts = (int) (((long)get_byte_count() + (_lpf*YENC_HALF_LINE_LEN-1)) /
+                        (_lpf*YENC_HALF_LINE_LEN));
   int cnt(1);
 
   quarks_t groups;
@@ -362,7 +362,6 @@ TaskUpload :: use_encoder (Encoder* encoder)
   format_s << "\"%s\""; // will be filled in by uuencode
   format_s << " (%d/%d) yEnc";     // will be filled in by uuencode
   std::string format(format_s.str());
-  std::cerr<<"_lpf : " <<_lpf<<std::endl;
   _encoder->enqueue (this, &_cache, &_article, _filename, _basename,
                      groups, _subject, _author, _agent, format, _domain, _lpf, YENC);
   debug ("encoder thread was free, enqueued work");
diff --git a/pan/usenet-utils/mime-utils.h b/pan/usenet-utils/mime-utils.h
index a38d9d8..956e0db 100644
--- a/pan/usenet-utils/mime-utils.h
+++ b/pan/usenet-utils/mime-utils.h
@@ -47,7 +47,7 @@
 #define YENC_TAG_CRC32         " crc32="
 #define YENC_FULL_LINE_LEN     256
 #define YENC_HALF_LINE_LEN     128
-#define YENC_LINES_PER_FILE    4000
+//#define YENC_LINES_PER_FILE    4000
 #define YENC_ESC_NULL          "=@"
 #define YENC_ESC_TAB           "=I"
 #define YENC_ESC_LF            "=J"
diff --git a/uulib/uuencode.c b/uulib/uuencode.c
index 05da2a3..f7e4d88 100644
--- a/uulib/uuencode.c
+++ b/uulib/uuencode.c
@@ -931,7 +931,7 @@ UUEncodePartial (FILE *outfile, FILE *infile,
 		 eolstring);
       }
 
-      fprintf (outfile, "=ypart begin=%d end=%d%s",
+      fprintf (outfile, "=ypart begin=%ld end=%ld%s",
 	       (partno-1)*linperfile*128+1,
 	       (partno*linperfile*128) < progress.totsize ?
 	       (partno*linperfile*128) : progress.totsize,
@@ -997,14 +997,14 @@ UUEncodePartial (FILE *outfile, FILE *infile,
   }
   else if (encoding == YENC_ENCODED) {
     if (numparts != 1) {
-      fprintf (outfile, "=yend size=%d part=%d pcrc32=%08lx",
+      fprintf (outfile, "=yend size=%ld part=%ld pcrc32=%08lx",
 	       (partno*linperfile*128) < progress.totsize ?
 	       linperfile*128 : (progress.totsize-(partno-1)*linperfile*128),
 	       partno,
 	       pcrc);
     }
     else {
-      fprintf (outfile, "=yend size=%d",
+      fprintf (outfile, "=yend size=%ld",
 	       progress.totsize);
     }
     if (feof (theifile))
@@ -1405,7 +1405,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
 		   eolstring);
 	}
 
-	fprintf (outfile, "=ypart begin=%d end=%d%s",
+	fprintf (outfile, "=ypart begin=%ld end=%ld%s",
 		 (part-1)*linperfile*128+1,
 		 (part*linperfile*128) < progress.totsize ?
 		 (part*linperfile*128) : progress.totsize,
@@ -1451,14 +1451,14 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
     }
     else if (encoding == YENC_ENCODED) {
       if (numparts != 1) {
-	fprintf (outfile, "=yend size=%d part=%d pcrc32=%08lx",
+	fprintf (outfile, "=yend size=%ld part=%ld pcrc32=%08lx",
 		 (part*linperfile*128) < progress.totsize ?
 		 linperfile*128 : (progress.totsize-(part-1)*linperfile*128),
 		 part,
 		 pcrc);
       }
       else {
-	fprintf (outfile, "=yend size=%d",
+	fprintf (outfile, "=yend size=%ld",
 		 progress.totsize);
       }
       if (feof (theifile))



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