[pan2/testing: 113/279] * Added lines per file option for yenc encoding (see prefs->upload options) * removed tests from mak
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2/testing: 113/279] * Added lines per file option for yenc encoding (see prefs->upload options) * removed tests from mak
- Date: Sat, 3 Dec 2011 22:31:40 +0000 (UTC)
commit fab291603a3cedf3bf5ca98253a95a4edbac098e
Author: Heinrich Mueller <sphemuel stud informatik uni-erlangen de>
Date: Wed Jun 22 20:22:12 2011 +0200
* Added lines per file option for yenc encoding (see prefs->upload options)
* removed tests from makefiles
pan/data/Makefile.am | 19 +++++++++--------
pan/general/Makefile.am | 30 ++++++++++++++--------------
pan/gui/post-ui.cc | 4 +++
pan/gui/prefs-ui.cc | 9 +++++++-
pan/tasks/Makefile.am | 26 ++++++++++++------------
pan/tasks/encoder.cc | 5 ++-
pan/tasks/encoder.h | 2 +
pan/tasks/nzb.cc | 16 +++++++++++---
pan/tasks/task-upload.cc | 6 +++-
pan/tasks/task-upload.h | 2 +
pan/usenet-utils/Makefile.am | 43 +++++++++++++++++++++--------------------
11 files changed, 95 insertions(+), 67 deletions(-)
---
diff --git a/pan/data/Makefile.am b/pan/data/Makefile.am
index 977d063..6562464 100644
--- a/pan/data/Makefile.am
+++ b/pan/data/Makefile.am
@@ -22,17 +22,18 @@ noinst_HEADERS = \
server-info.h \
xref.h
-noinst_PROGRAMS = \
- article-test \
- xref-test
+#noinst_PROGRAMS = \
+# article-test \
+#xref-test
#dnl decode-test
#dnl decode_test_SOURCES = decode-test.cc
#dnl decode_test_LDADD = $(TEST_LDADD)
-TESTS = $(noinst_PROGRAMS)
-TEST_LDADD = ./libdata.a ../usenet-utils/libusenetutils.a ../general/libgeneralutils.a @GMIME_LIBS@ @GLIB_LIBS@
-xref_test_SOURCES = xref-test.cc
-xref_test_LDADD = $(TEST_LDADD)
-article_test_SOURCES = article-test.cc
-article_test_LDADD = $(TEST_LDADD)
+#TESTS = $(noinst_PROGRAMS)
+#TEST_LDADD = ./libdata.a ../usenet-utils/libusenetutils.a
+#../general/libgeneralutils.a @GMIME_LIBS@ @GLIB_LIBS@
+#xref_test_SOURCES = xref-test.cc
+#xref_test_LDADD = $(TEST_LDADD)
+#article_test_SOURCES = article-test.cc
+#article_test_LDADD = $(TEST_LDADD)
diff --git a/pan/general/Makefile.am b/pan/general/Makefile.am
index 8bfe693..a6a02e4 100644
--- a/pan/general/Makefile.am
+++ b/pan/general/Makefile.am
@@ -36,19 +36,19 @@ noinst_HEADERS = \
utf8-utils.h \
worker-pool.h
-noinst_PROGRAMS = \
- progress-test \
- quark-test \
- string-view-test \
- text-match-test
+#noinst_PROGRAMS = \
+# progress-test \
+# quark-test \
+# string-view-test \
+# text-match-test
-TESTS = $(noinst_PROGRAMS)
-TEST_LDADD = ./libgeneralutils.a @GMIME_CFLAGS@ @GLIB_LIBS@
-progress_test_SOURCES = progress-test.cc
-progress_test_LDADD = $(TEST_LDADD)
-quark_test_SOURCES = quark-test.cc
-quark_test_LDADD = $(TEST_LDADD)
-string_view_test_SOURCES = string-view-test.cc
-string_view_test_LDADD = $(TEST_LDADD)
-text_match_test_SOURCES = text-match-test.cc
-text_match_test_LDADD = $(TEST_LDADD)
+#TESTS = $(noinst_PROGRAMS)
+#TEST_LDADD = ./libgeneralutils.a @GMIME_CFLAGS@ @GLIB_LIBS@
+#progress_test_SOURCES = progress-test.cc
+#progress_test_LDADD = $(TEST_LDADD)
+#quark_test_SOURCES = quark-test.cc
+#quark_test_LDADD = $(TEST_LDADD)
+#string_view_test_SOURCES = string-view-test.cc
+#string_view_test_LDADD = $(TEST_LDADD)
+#text_match_test_SOURCES = text-match-test.cc
+#text_match_test_LDADD = $(TEST_LDADD)
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 85d6d08..6b88b9f 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -2808,6 +2808,10 @@ PostUI :: prompt_user_for_queueable_files (GtkWindow * parent, const Prefs& pref
TaskUpload::UploadInfo ui;
ui.comment1 = _prefs.get_flag("upload-queue-append-subject-enabled",false);
+ // 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));
if (custom_mid)
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index d6f79a9..dff7a31 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -616,8 +616,15 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
t = HIG :: workarea_create ();
HIG :: workarea_add_section_title (t, &row, _("Upload Subject Line Appearance"));
HIG :: workarea_add_section_spacer (t, row, 4);
- w = new_check_button (_("Append su_bject to all posts"), "upload-queue-append-subject-enabled", false, prefs);
+ w = new_check_button (_("Append Su_bject to all Posts"), "upload-queue-append-subject-enabled", false, prefs);
HIG :: workarea_add_wide_control (t, &row, w);
+ HIG :: workarea_add_section_title (t, &row, _("Upload Subject Line Appearance"));
+ HIG :: workarea_add_section_spacer (t, row, 4);
+ w = new_spin_button ("upload-option-lpf", 5000, 50000, prefs);
+ l = gtk_label_new(_("Default _Lines per File (for yEnc Encoder)"));
+ gtk_misc_set_alignment (GTK_MISC(l), 0.0, 0.5);
+ gtk_label_set_mnemonic_widget(GTK_LABEL(l), w);
+ HIG::workarea_add_row (t, &row, w, l);
HIG :: workarea_finish (t, &row);
gtk_notebook_append_page (GTK_NOTEBOOK(notebook), t, gtk_label_new_with_mnemonic(_("_Upload options")));
diff --git a/pan/tasks/Makefile.am b/pan/tasks/Makefile.am
index 9f0606d..6a9a870 100644
--- a/pan/tasks/Makefile.am
+++ b/pan/tasks/Makefile.am
@@ -44,22 +44,22 @@ noinst_HEADERS = \
socket-impl-scripted.h \
nntp-pool.h
-noinst_PROGRAMS = \
- adaptable-set-test \
- nzb-test
+#noinst_PROGRAMS = \
+# adaptable-set-test \
+# nzb-test
-TESTS = $(noinst_PROGRAMS)
+#TESTS = $(noinst_PROGRAMS)
-TEST_LDADD = ./libtasks.a \
- ../data/libdata.a \
- ../usenet-utils/libusenetutils.a \
- ../general/libgeneralutils.a \
- ../../uulib/libuu.a \
- @GMIME_LIBS@ @GLIB_LIBS@
+#TEST_LDADD = ./libtasks.a \
+# ../data/libdata.a \
+# ../usenet-utils/libusenetutils.a \
+# ../general/libgeneralutils.a \
+# ../../uulib/libuu.a \
+# @GMIME_LIBS@ @GLIB_LIBS@
-adaptable_set_test_SOURCES = adaptable-set-test.cc
-nzb_test_SOURCES = nzb-test.cc
-nzb_test_LDADD = $(TEST_LDADD)
+#adaptable_set_test_SOURCES = adaptable-set-test.cc
+#nzb_test_SOURCES = nzb-test.cc
+#nzb_test_LDADD = $(TEST_LDADD)
# FIXME: these need to be moved up the food chain past data-impl
#
diff --git a/pan/tasks/encoder.cc b/pan/tasks/encoder.cc
index 407cdb4..16dd581 100644
--- a/pan/tasks/encoder.cc
+++ b/pan/tasks/encoder.cc
@@ -97,6 +97,7 @@ Encoder :: enqueue (TaskUpload * task,
std::string & agent,
std::string & format,
std::string global_mid,
+ int lpf,
const TaskUpload::EncodeMode & enc)
{
@@ -115,6 +116,7 @@ Encoder :: enqueue (TaskUpload * task,
this->cache = cache;
this->article = article;
this->format = format;
+ this->lpf = lpf;
percent = 0;
current_file.clear ();
@@ -169,12 +171,11 @@ Encoder :: do_work()
log_errors.push_back(buf); // log error
continue;
}
- // 4000 lines SHOULD be OK for ANY nntp server ...
StringView mid(global_mid);
if (!global_mid.empty())
generate_unique_id(mid, cnt, s);
res = UUE_PrepPartial (fp, NULL, (char*)filename.c_str(),YENC_ENCODED,
- (char*)basename.c_str(),0644, cnt, 4000,
+ (char*)basename.c_str(),0644, cnt, lpf,
0, (char*)groups.c_str(),
(char*)author.c_str(),
(char*)subject.c_str(), s.empty() ? NULL : (char*)s.c_str(), (char*)format.c_str(), agent.empty() ? NULL : (char*)agent.c_str(), 0);
diff --git a/pan/tasks/encoder.h b/pan/tasks/encoder.h
index ca0fe80..9c01158 100644
--- a/pan/tasks/encoder.h
+++ b/pan/tasks/encoder.h
@@ -72,6 +72,7 @@ namespace pan
std::string & agent,
std::string & format,
std::string global_mid,
+ int lpf,
const TaskUpload::EncodeMode & enc = TaskUpload::YENC);
public:
@@ -91,6 +92,7 @@ namespace pan
TaskUpload::EncodeMode encode_mode;
std::string basename, filename;
std::string subject, author, groups, mid, format, agent;
+ int lpf;
EncodeCache * cache;
TaskUpload::needed_t * needed;
std::string global_mid;
diff --git a/pan/tasks/nzb.cc b/pan/tasks/nzb.cc
index 58a3807..f427272 100644
--- a/pan/tasks/nzb.cc
+++ b/pan/tasks/nzb.cc
@@ -51,6 +51,7 @@ namespace
TaskUpload::needed_t needed_parts; // TaskUpload
std::string domain; // TaskUpload
std::string queue;
+ int lpf;
Article a;
PartBatch parts;
tasks_t tasks;
@@ -79,6 +80,7 @@ namespace
needed_parts.clear(); // TaskUpload
domain.clear(); // TaskUpload
queue.clear();
+ lpf = 0;
}
};
@@ -104,11 +106,12 @@ namespace
else if (!strcmp (element_name, "upload")) {
mc.file_clear ();
for (const char **k(attribute_names), **v(attribute_vals); *k; ++k, ++v) {
- if (!strcmp (*k,"author")) mc.a.author = *v;
+ if (!strcmp (*k,"author")) mc.a.author = *v;
else if (!strcmp (*k,"subject")) mc.a.subject = *v;
- else if (!strcmp (*k,"server")) mc.server = *v;
- else if (!strcmp (*k,"domain")) mc.domain = *v;
- else if (!strcmp (*k,"queue")) mc.queue = *v;
+ else if (!strcmp (*k,"server")) mc.server = *v;
+ else if (!strcmp (*k,"domain")) mc.domain = *v;
+ else if (!strcmp (*k,"queue")) mc.queue = *v;
+ else if (!strcmp (*k,"lpf")) mc.lpf = atoi(*v);
}
}
@@ -191,6 +194,7 @@ namespace
TaskUpload::UploadInfo format;
format.domain = mc.domain;
format.comment1 = true;
+ format.lpf = mc.lpf;
TaskUpload* tmp = new TaskUpload (mc.path, mc.server, mc.encode_cache,mc.a,
format, mc.needed_parts, 0, TaskUpload::YENC);
mc.tasks.push_back (tmp);
@@ -362,6 +366,10 @@ NZB :: nzb_to_xml (std::ostream & out,
escaped (out, task->_server.to_string());
out << "\" queue=\"";
escaped (out, task->_save_file);
+ out << "\" lpf=\"";
+ char buf[256];
+ g_snprintf(buf,sizeof(buf),"%d",task->_lpf);
+ escaped (out, buf);
out << "\" domain=\"nospam@";
escaped (out, task->_domain) << "\">\n";
++depth;
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index 1edb629..1daaf02 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -109,7 +109,8 @@ TaskUpload :: TaskUpload (const std::string & filename,
_format(format),
_save_file(format.save_file),
_agent(get_user_agent()),
- _queue_pos(0)
+ _queue_pos(0),
+ _lpf(format.lpf)
{
if (!format.domain.empty()) _domain = get_domain(StringView(format.domain)) ;
@@ -361,8 +362,9 @@ 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, YENC);
+ groups, _subject, _author, _agent, format, _domain, _lpf, YENC);
debug ("encoder thread was free, enqueued work");
}
diff --git a/pan/tasks/task-upload.h b/pan/tasks/task-upload.h
index e42786a..7094f05 100644
--- a/pan/tasks/task-upload.h
+++ b/pan/tasks/task-upload.h
@@ -54,6 +54,7 @@ namespace pan
bool comment1;
std::string domain;
std::string save_file;
+ int lpf;
};
const Article& get_article () { return _article; }
@@ -146,6 +147,7 @@ namespace pan
Article::mid_sequence_t _mids;
int _queue_pos;
std::string _agent;
+ int _lpf;
private:
needed_t _needed;
diff --git a/pan/usenet-utils/Makefile.am b/pan/usenet-utils/Makefile.am
index be2611a..3d895d2 100644
--- a/pan/usenet-utils/Makefile.am
+++ b/pan/usenet-utils/Makefile.am
@@ -24,26 +24,27 @@ noinst_HEADERS = \
text-massager.h \
url-find.h
-noinst_PROGRAMS = \
- gnksa-test \
- message-check-test \
- numbers-test \
- scorefile-test \
- text-massager-test \
- url-find-test
+#noinst_PROGRAMS = \
+# gnksa-test \
+# message-check-test \
+# numbers-test \
+# scorefile-test \
+# text-massager-test \
+# url-find-test
-TESTS = $(noinst_PROGRAMS)
-TEST_LDADD = ./libusenetutils.a ../general/libgeneralutils.a @GMIME_LIBS@ @GLIB_LIBS@
-gnksa_test_SOURCES = gnksa-test.cc
-gnksa_test_LDADD = $(TEST_LDADD)
-message_check_test_SOURCES = message-check-test.cc
-message_check_test_LDADD = $(TEST_LDADD)
-numbers_test_SOURCES = numbers-test.cc
-numbers_test_LDADD = $(TEST_LDADD)
-scorefile_test_SOURCES = scorefile-test.cc
-scorefile_test_LDADD = $(TEST_LDADD)
-text_massager_test_SOURCES = text-massager-test.cc
-text_massager_test_LDADD = $(TEST_LDADD)
-url_find_test_SOURCES = url-find-test.cc
-url_find_test_LDADD = $(TEST_LDADD)
+#TESTS = $(noinst_PROGRAMS)
+#TEST_LDADD = ./libusenetutils.a ../general/libgeneralutils.a @GMIME_LIBS@
+# GLIB_LIBS@
+#gnksa_test_SOURCES = gnksa-test.cc
+#gnksa_test_LDADD = $(TEST_LDADD)
+#message_check_test_SOURCES = message-check-test.cc
+#message_check_test_LDADD = $(TEST_LDADD)
+#numbers_test_SOURCES = numbers-test.cc
+#numbers_test_LDADD = $(TEST_LDADD)
+#scorefile_test_SOURCES = scorefile-test.cc
+#scorefile_test_LDADD = $(TEST_LDADD)
+#text_massager_test_SOURCES = text-massager-test.cc
+#text_massager_test_LDADD = $(TEST_LDADD)
+#url_find_test_SOURCES = url-find-test.cc
+#url_find_test_LDADD = $(TEST_LDADD)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]