[pan2/testing: 128/279] forgot to implement article mid for nzb saving
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2/testing: 128/279] forgot to implement article mid for nzb saving
- Date: Sat, 3 Dec 2011 22:32:56 +0000 (UTC)
commit a65b3ea7a042fa936077ae2fb79326cd17678197
Author: Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
Date: Wed Jun 29 10:23:52 2011 +0200
forgot to implement article mid for nzb saving
pan/gui/post-ui.cc | 5 +-
pan/tasks/encoder.cc | 17 +++-----
pan/tasks/nzb.cc | 103 +++++++++++++++++++++++++-------------------------
3 files changed, 61 insertions(+), 64 deletions(-)
---
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index acbb705..45c3c9b 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -781,7 +781,8 @@ PostUI :: send_and_save_now ()
HIG :: message_dialog_set_text (GTK_MESSAGE_DIALOG(d),
_("The file queue is empty, so no files can be saved."),"");
gtk_dialog_add_button (GTK_DIALOG(d), _("Go Back"), GTK_RESPONSE_CANCEL);
- }
+ } else
+ _save_file = prompt_user_for_upload_nzb_dir (GTK_WINDOW(_root), _prefs);
GMimeMessage * message (new_message_from_ui (POSTING));
if (!maybe_post_message (message))
@@ -905,9 +906,7 @@ PostUI :: on_progress_finished (Progress&, int status) // posting finished
mut.unlock();
if (close) close_window(true);
}
-
}
-
}
void
diff --git a/pan/tasks/encoder.cc b/pan/tasks/encoder.cc
index 31ba791..00eedfc 100644
--- a/pan/tasks/encoder.cc
+++ b/pan/tasks/encoder.cc
@@ -98,10 +98,14 @@ Encoder :: do_work()
const int bufsz = 4096;
char buf[bufsz], buf2[bufsz];
int cnt(1);
- crc32_t crcptr;
+ crc32_t crc;
struct stat sb;
std::string s;
FILE* outfile, * infile ;
+ PartBatch batch;
+ char cachename[4096];
+ FILE * fp ;
+ Article* tmp = article;
enable_progress_update();
@@ -113,11 +117,7 @@ Encoder :: do_work()
UUSetMsgCallback (this, uu_log);
UUSetBusyCallback (this, uu_busy_poll, 200);
- PartBatch batch;
- char cachename[4096];
- int cnt(1);
- FILE * fp ;
- Article* tmp = article;
+
batch.init(StringView(basename), needed->size(), 0);
@@ -126,8 +126,6 @@ Encoder :: do_work()
for (TaskUpload::needed_t::iterator it = needed->begin(); it != needed->end(); ++it, ++cnt)
{
-
- crc32_t crc;
int enc(YENC_ENCODED);
std::ofstream out;
std::string txt;
@@ -173,8 +171,7 @@ _no_encode:
stat (cachename, &sb);
it->second.bytes = sb.st_size;
task->_all_bytes += sb.st_size;
- //dbg
- batch.add_part(cnt, StringView(s), 0);//sb.st_size);
+ batch.add_part(cnt, StringView(it->second.mid), sb.st_size);
if (res != UURET_CONT) break;
}
diff --git a/pan/tasks/nzb.cc b/pan/tasks/nzb.cc
index 4855b13..0b125e9 100644
--- a/pan/tasks/nzb.cc
+++ b/pan/tasks/nzb.cc
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset:
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset:
2 -*- */
/*
* Pan - A Newsreader for Gtk+
@@ -351,58 +351,59 @@ NZB :: nzb_to_xml (std::ostream & out,
out << indent(--depth) << "</segments>\n";
out << indent(--depth) << "</file>\n";
}
- else
- { // handle upload tasks
- TaskUpload * task (dynamic_cast<TaskUpload*>(*it));
- // not an upload task, move on
- if (!task) continue;
-
- const Article& a (task->get_article());
-
- //info: author, subject, load path, parts to encode / post
- out << indent(depth)
- << "<upload" << " author=\"";
- escaped (out, task->_author);
- out << "\" subject=\"";
- escaped (out, task->_subject);
- out << "\" server=\"";
- escaped (out, task->_server.to_string());
-
- ///TODO
-// out << "\" queue=\"";
-// escaped (out, task->_save_file);
- out << "\" lpf=\"";
- char buf[256];
- g_snprintf(buf,sizeof(buf),"%d",task->_lpf);
- escaped (out, buf);
- ++depth;
- out << indent(depth)
- << "<path>" << task->_filename << "</path>\n";
- out << indent(depth) << "<groups>\n";
-
- ///TODO
+// else
+// { // handle upload tasks
+// TaskUpload * task (dynamic_cast<TaskUpload*>(*it));
+// // not an upload task, move on
+// if (!task) continue;
+//
+// const Article& a (task->get_article());
+//
+// //info: author, subject, load path, parts to encode / post
+// out << indent(depth)
+// << "<upload" << " author=\"";
+// escaped (out, task->_author);
+// out << "\" subject=\"";
+// escaped (out, task->_subject);
+// out << "\" server=\"";
+// escaped (out, task->_server.to_string());
+//
+// ///TODO
+//// out << "\" queue=\"";
+//// escaped (out, task->_save_file);
+// out << "\" lpf=\"";
+// char buf[256];
+// g_snprintf(buf,sizeof(buf),"%d",task->_lpf);
+// escaped (out, buf);
// ++depth;
-// foreach_const (quarks_t, task->_groups, git)
-// out << indent(depth) << "<group>" << *git << "</group>\n";
+// out << indent(depth)
+// << "<path>" << task->_filename << "</path>\n";
+// out << indent(depth) << "<groups>\n";
+//
+// ///TODO
+//// ++depth;
+//// foreach_const (quarks_t, task->_groups, git)
+//// out << indent(depth) << "<group>" << *git << "</group>\n";
+//// --depth;
+//
+// out << indent(--depth) << "</groups>\n";
+// out << indent(depth) << "<parts>\n";
+// ++depth;
+//
+// foreach (TaskUpload::needed_t, task->_needed, it)
+// {
+// out << indent(depth)
+// << "<part" << " bytes=\"" << it->second.bytes << '"'
+// << " number=\"" << it->second.partno << '"'
+// << ">";
+// escaped(out, it->second.message_id);
+// out << "</part>\n";
+// }
// --depth;
-
- out << indent(--depth) << "</groups>\n";
- out << indent(depth) << "<parts>\n";
- ++depth;
-
- foreach (TaskUpload::needed_t, task->_needed, it)
- {
- out << indent(depth)
- << "<part" << " bytes=\"" << it->second.bytes << '"'
- << " number=\"" << it->second.partno << '"'
- << ">";
- escaped(out, it->second.message_id);
- out << "</part>\n";
- }
- --depth;
- out << indent(depth) << "</parts>\n";
- out << indent(depth) << "</upload>\n";
- }
+// out << indent(depth) << "</parts>\n";
+// out << indent(depth) << "</upload>\n";
+// }
+// }
}
out << indent(--depth) << "</nzb>\n";
return out;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]