[pan2] cleanup of experimental code
- From: Heinrich Müller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] cleanup of experimental code
- Date: Thu, 21 Nov 2013 21:42:37 +0000 (UTC)
commit 35bf10f456956da19a39d5b5d8bbf3f84dffcb80
Author: Heinrich Müller <henmull src gnome org>
Date: Wed Nov 20 21:19:00 2013 +0100
cleanup of experimental code
configure.in | 15 -
pan.cbp | 360 -------------------
pan/data-impl/Makefile.am | 6 +-
pan/data-impl/data-impl.cc | 47 ---
pan/data-impl/data-impl.h | 14 +-
pan/data-impl/download-meter.cc | 207 -----------
pan/data-impl/download-meter.h | 88 -----
pan/data/article-cache.cc | 1 +
pan/data/data.h | 46 ---
pan/gui/Makefile.am | 8 +-
pan/gui/actions.cc | 6 -
pan/gui/dl-prefs.cc | 194 -----------
pan/gui/dl-prefs.h | 61 ----
pan/gui/gui.cc | 36 +--
pan/gui/gui.h | 8 +-
pan/gui/pan-ui.h | 1 -
pan/gui/pan.cc | 4 +-
pan/gui/search-pane.cc | 730 ---------------------------------------
pan/gui/search-pane.h | 86 -----
pan/gui/searchpane.ui.h | 8 -
pan/tasks/nntp-pool.cc | 10 +-
pan/tasks/nntp-pool.h | 3 +-
pan/tasks/nntp.cc | 4 +-
pan/tasks/nntp.h | 3 -
pan/tasks/queue.cc | 6 +-
pan/tasks/queue.h | 6 +-
pan/tasks/task-upload.cc | 3 +-
27 files changed, 21 insertions(+), 1940 deletions(-)
---
diff --git a/configure.in b/configure.in
index 9777e9c..9079bc3 100644
--- a/configure.in
+++ b/configure.in
@@ -55,9 +55,6 @@ LIBNOTIFY_REQUIRED=0.4.1
LIBGKR_REQUIRED=3.2.0
WEBKIT_REQUIRED=1.8.1
LIBGRSS_REQUIRED=0.5.0
-LIBSOUP_REQUIRED=2.36.1
-AC_SUBST(LIBGRSS_REQUIRED)
-AC_SUBST(LIBSOUP_REQUIRED)
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GLIB_REQUIRED_FOR_DBUS)
AC_SUBST(GMIME_REQUIRED)
@@ -95,18 +92,6 @@ PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],AC_DEFINE(HAVE_ZLIB,[1],[Zlib for xzve
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
-dnl rss feed support for nzbindex using libgrss and libsoup for http GET (nzb file(s))
-AC_ARG_WITH(rss, AS_HELP_STRING([--with-rss],[enable RSS support (normally: no)]), [want_rss=$withval],
[want_rss=no])
-if test "x$want_rss" = "xyes" ; then
- PKG_CHECK_MODULES([GRSS],[libgrss-0.5 >= $LIBGRSS_REQUIRED libsoup-2.4 >= LIBSOUP_REQUIRED],
- [
- AC_DEFINE(HAVE_RSS,[1],[RSS support])
- ],
- [
- AC_MSG_RESULT(no)
- ])
-fi
-
dnl D-Bus support
AC_ARG_WITH(dbus, AS_HELP_STRING([--with-dbus],[enable D-Bus support (normally: no)]), [want_dbus=$withval],
[want_dbus=no])
if test "x$want_dbus" = "xyes" ; then
diff --git a/pan/data-impl/Makefile.am b/pan/data-impl/Makefile.am
index 30f97f0..7e1125a 100644
--- a/pan/data-impl/Makefile.am
+++ b/pan/data-impl/Makefile.am
@@ -16,8 +16,7 @@ libpandata_a_SOURCES = \
server.cc \
my-tree.cc \
task-archive.cc \
- xover.cc \
- download-meter.cc
+ xover.cc
noinst_HEADERS = \
@@ -27,8 +26,7 @@ noinst_HEADERS = \
data-io.h \
defgroup.h \
profiles.h \
- memchunk.h \
- download-meter.h
+ memchunk.h
#noinst_PROGRAMS = \
# add-server \
diff --git a/pan/data-impl/data-impl.cc b/pan/data-impl/data-impl.cc
index 010c7eb..ee940a3 100644
--- a/pan/data-impl/data-impl.cc
+++ b/pan/data-impl/data-impl.cc
@@ -69,7 +69,6 @@ namespace
DataImpl :: DataImpl (const StringView& cache_ext, Prefs& prefs, bool unit_test, int cache_megs, DataIO *
io):
ProfilesImpl (*io),
- DownloadMeterImpl(prefs, *this),
_cache (get_cache_path(), cache_ext, cache_megs),
_prefs(prefs),
_encode_cache (get_encode_cache_path(), cache_megs),
@@ -106,7 +105,6 @@ DataImpl :: rebuild_backend ()
load_newsrc_files (*_data_io);
load_group_xovers (*_data_io);
load_group_permissions (*_data_io);
- load_download_stats (*_data_io);
_descriptions.clear ();
_descriptions_loaded = false;
@@ -129,7 +127,6 @@ DataImpl :: save_state ()
debug ("data-impl dtor saving xov, newsrc...");
save_group_xovers (*_data_io);
save_newsrc_files (*_data_io);
- save_download_stats (*_data_io);
}
}
@@ -180,47 +177,3 @@ DataImpl :: password_decrypt (PasswordData& pw) const
return (pw.pw ? GNOME_KEYRING_RESULT_OK : GNOME_KEYRING_RESULT_DENIED) ;
}
#endif
-
-
-/***
- ** Download stats
- ***/
-
- void
-DataImpl :: load_download_stats (const DataIO& data_io)
-{
-
- LineReader * in (data_io.read_download_stats ());
- StringView s, line;
- uint64_t bytes (0ul);
- while (in && !in->fail() && in->getline(line))
- {
- if (line.len && *line.str=='#')
- {
- continue;
- }
- else
- {
- bytes = atoll(line.str);
- break;
- }
- }
-
- dl_meter_init (bytes);
-
- delete in;
-}
-
-void
-DataImpl :: save_download_stats(DataIO& data_io) const
-{
- if (_unit_test)
- return;
-
- std::ostream& out (*data_io.write_download_stats ());
-
- out << "# Download stats (single uint64_t showing bytes downloaded so far\n";
- out << dl_meter_get_bytes() <<"\n";
-
- data_io.write_done (&out);
-}
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 6145a83..e33cf75 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -43,7 +43,6 @@
#include <pan/data-impl/article-filter.h>
#include <pan/data-impl/rules-filter.h>
#include <pan/data-impl/profiles.h>
-#include <pan/data-impl/download-meter.h>
#include <pan/data-impl/memchunk.h>
#include <pan/gui/prefs.h>
@@ -68,9 +67,7 @@ namespace pan
class DataImpl:
public Data,
public TaskArchive,
- public ProfilesImpl,
- public DownloadMeterImpl
-// public DownloadMeter::Listener
+ public ProfilesImpl
{
/**
@@ -698,15 +695,6 @@ namespace pan
save_newsrc_files(*_data_io);
newsrc_autosave_id = 0;
}
-
- /**
- *** Download stats
- **/
- public:
-
- void load_download_stats (const DataIO&);
- void save_download_stats (DataIO&) const;
-
};
}
diff --git a/pan/data/article-cache.cc b/pan/data/article-cache.cc
index d6cb747..0ac3d57 100644
--- a/pan/data/article-cache.cc
+++ b/pan/data/article-cache.cc
@@ -120,6 +120,7 @@ ArticleCache :: message_id_to_filename (char * buf, int len, const StringView& m
break;
default:
*out++ = *in;
+ break;
}
}
diff --git a/pan/data/data.h b/pan/data/data.h
index 8cdd42c..7c771a3 100644
--- a/pan/data/data.h
+++ b/pan/data/data.h
@@ -155,51 +155,6 @@ namespace pan
Profiles () {}
};
- class DownloadMeter
- {
- public:
-
- virtual ~DownloadMeter () {}
-
- struct Listener {
- Listener () {}
- virtual ~Listener () {}
- virtual void on_xfer_bytes (uint64_t) = 0;
- virtual void on_reset_xfer_bytes () = 0;
- virtual void on_dl_limit_reached () = 0;
- };
-
- virtual void add_listener (Listener * l) = 0;
- virtual void remove_listener (Listener * l) = 0;
-
- protected:
-
- DownloadMeter() {}
-
- public:
- virtual void dl_meter_add (uint64_t bytes) = 0;
- virtual void dl_meter_update () = 0;
-
- public:
-
- virtual ProgressView* get_view() = 0;
- virtual GtkWidget* get_widget () = 0;
- virtual GtkWidget* get_button () = 0;
-
- public:
-
- virtual uint64_t dl_meter_get_limit() = 0;
- virtual void dl_meter_set_limit (uint64_t l) = 0;
- virtual void dl_meter_reset () = 0;
-
- public:
-
- virtual void fire_xfer_bytes (uint64_t bytes) = 0;
- virtual void fire_reset_xfer_bytes () = 0;
- virtual void fire_dl_limit_reached () = 0;
-
- };
-
/**
* The main interface class for Pan's data backend.
*
@@ -215,7 +170,6 @@ namespace pan
*/
class Data:
public virtual ServerInfo,
- public virtual DownloadMeter,
public virtual GroupServer,
public virtual ArticleRead,
public virtual Profiles,
diff --git a/pan/gui/Makefile.am b/pan/gui/Makefile.am
index 99bfaba..ed0fd40 100644
--- a/pan/gui/Makefile.am
+++ b/pan/gui/Makefile.am
@@ -1,5 +1,5 @@
AM_CPPFLAGS = -I top_srcdir@ @GTKSPELL_CFLAGS@ @ENCHANT_CFLAGS@ @GTK_CFLAGS@ @GMIME_CFLAGS@ @GLIB_CFLAGS@ \
- @GNUTLS_CFLAGS@ @LIBNOTIFY_CFLAGS@ @LIBGNOME_KEYRING_1_CFLAGS@ @WEBKITGTK_CFLAGS
-DPANLOCALEDIR=\""$(panlocaledir)"\" @ZLIB_CFLAGS@ @GRSS_CFLAGS@
+ @GNUTLS_CFLAGS@ @LIBNOTIFY_CFLAGS@ @LIBGNOME_KEYRING_1_CFLAGS@ @WEBKITGTK_CFLAGS
-DPANLOCALEDIR=\""$(panlocaledir)"\" @ZLIB_CFLAGS@
noinst_LIBRARIES = libpangui.a
@@ -16,7 +16,6 @@ libpangui_a_SOURCES = \
group-prefs.cc \
group-prefs-dialog.cc \
header-pane.cc \
- search-pane.cc \
hig.cc \
log-ui.cc \
pan-file-entry.cc \
@@ -24,7 +23,6 @@ libpangui_a_SOURCES = \
pan-tree.cc \
post-ui.cc \
prefs.cc \
- dl-prefs.cc \
prefs-file.cc \
prefs-ui.cc \
progress-view.cc \
@@ -57,7 +55,6 @@ noinst_HEADERS = \
gtk-compat.h \
gui.h \
header-pane.h \
- search-pane.h \
hig.h \
license.h \
log-ui.h \
@@ -68,7 +65,6 @@ noinst_HEADERS = \
pan.ui.h \
pan.ui.ssl.h \
prefs.h \
- dl-prefs.h \
prefs-file.h \
prefs-ui.h \
post-ui.h \
@@ -108,7 +104,7 @@ endif
pan_SOURCES = gui.cc pan.cc $(WINRC)
pan_LDADD = ./libpangui.a $(WINRCOBJ) ../data-impl/libpandata.a ../tasks/libtasks.a ../data/libdata.a
../usenet-utils/libusenetutils.a ../general/libgeneralutils.a ../../uulib/libuu.a \
- @GTKSPELL_LIBS@ @ENCHANT_LIBS@ @GTK_LIBS@ @GMIME_LIBS@ @GLIB_LIBS@ @GNUTLS_LIBS@
@LIBNOTIFY_LIBS@ @LIBGNOME_KEYRING_1_LIBS@ @WEBKITGTK_LIBS@ @ZLIB_LIBS@ @GRSS_LIBS@
+ @GTKSPELL_LIBS@ @ENCHANT_LIBS@ @GTK_LIBS@ @GMIME_LIBS@ @GLIB_LIBS@ @GNUTLS_LIBS@
@LIBNOTIFY_LIBS@ @LIBGNOME_KEYRING_1_LIBS@ @WEBKITGTK_LIBS@ @ZLIB_LIBS@
if HAVE_WIN32
pan_LDFLAGS = -mwindows
endif
diff --git a/pan/gui/actions.cc b/pan/gui/actions.cc
index 9c1acbd..d9c89f3 100644
--- a/pan/gui/actions.cc
+++ b/pan/gui/actions.cc
@@ -123,7 +123,6 @@ namespace pan
void do_import_tasks (GtkAction*) { pan_ui->do_import_tasks(); }
void do_cancel_latest_task (GtkAction*) { pan_ui->do_cancel_latest_task(); }
void do_show_task_window (GtkAction*) { pan_ui->do_show_task_window(); }
- void do_show_dl_meter_prefs (GtkAction*) { pan_ui->do_show_dl_meter_prefs(); }
void do_show_log_window (GtkAction*) { pan_ui->do_show_log_window(); }
void do_quit (GtkAction*) { pan_ui->do_quit(); }
void do_clear_header_pane (GtkAction*) { pan_ui->do_clear_header_pane(); }
@@ -402,11 +401,6 @@ namespace pan
NULL,
G_CALLBACK(do_show_task_window) },
- { "show-dl-meter-prefs", NULL,
- N_("_Download Meter Preferences"), NULL,
- NULL,
- G_CALLBACK(do_show_dl_meter_prefs) },
-
{ "show-log-dialog", GTK_STOCK_DIALOG_INFO,
N_("_Event Log"), NULL,
NULL,
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index ffa1a6b..8fbcbf0 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -48,7 +48,6 @@ extern "C" {
#include "group-pane.h"
#include "group-prefs-dialog.h"
#include "header-pane.h"
-#include "search-pane.h"
#include "hig.h"
#include "license.h"
#include "log-ui.h"
@@ -62,7 +61,6 @@ extern "C" {
#endif
#include "prefs-ui.h"
-#include "dl-prefs.h"
#include "progress-view.h"
#include "profiles-dialog.h"
#include "post-ui.h"
@@ -214,7 +212,7 @@ GUI :: root_realized_cb (GtkWidget*, gpointer self_gpointer)
}
}
-GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs, DownloadMeter& meter):
+GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs):
_data (data),
_queue (queue),
_prefs (prefs),
@@ -225,7 +223,6 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs, Dow
_menu_vbox (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)),
_group_pane (0),
_header_pane (0),
- _search_pane (0),
_body_pane (0),
_ui_manager (gtk_ui_manager_new ()),
_info_image (gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_MENU)),
@@ -235,8 +232,7 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs, Dow
_queue_size_label (0),
_queue_size_button (0),
_taskbar (0),
- _certstore(data.get_certstore()),
- _meter(meter)
+ _certstore(data.get_certstore())
{
char * filename = g_build_filename (file::get_pan_home().c_str(), "pan.ui", NULL);
@@ -251,9 +247,6 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs, Dow
_group_pane = new GroupPane (*this, data, _prefs, _group_prefs);
_header_pane = new HeaderPane (*this, data, _queue, _cache, _prefs, _group_prefs, *this, *this);
-#ifdef HAVE_RSS
- _search_pane = new SearchPane (data, queue, *this, *this);
-#endif
_body_pane = new BodyPane (data, _cache, _prefs, _group_prefs, _queue, _header_pane);
std::string path = "/ui/main-window-toolbar";
@@ -307,11 +300,6 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs, Dow
gtk_container_add (GTK_CONTAINER(frame), w);
gtk_box_pack_start (GTK_BOX(status_bar), frame, FALSE, FALSE, 0);
- // download meter
- w = _meter.get_widget();
- gtk_box_pack_start (GTK_BOX(status_bar), w, FALSE, FALSE, 0);
- g_signal_connect (_meter.get_button(), "clicked", G_CALLBACK(show_download_meter_prefs_cb), this);
-
// drag and drop for message-ids
// gtk_drag_dest_set(_workarea_bin,GTK_DEST_DEFAULT_ALL,target_list,3,GDK_ACTION_COPY);
// gtk_drag_dest_add_text_targets(_workarea_bin);
@@ -361,9 +349,6 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs, Dow
g_object_ref_sink (G_OBJECT(_error_image));
g_object_ref (_group_pane->root());
g_object_ref (_header_pane->root());
-#ifdef HAVE_RSS
- g_object_ref (_search_pane->root());
-#endif
g_object_ref (_body_pane->root());
do_work_online (is_action_active ("work-online"));
@@ -379,7 +364,6 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs, Dow
if (_prefs.get_flag ("get-new-headers-on-startup", false))
activate_action ("get-new-headers-in-subscribed-groups");
- _queue.add_listener (this);
_prefs.add_listener (this);
_certstore.add_listener(this);
Log::get().add_listener (this);
@@ -450,17 +434,11 @@ GUI :: ~GUI ()
std::set<GtkWidget*> unref;
unref.insert (_body_pane->root());
unref.insert (_header_pane->root());
-#ifdef HAVE_RSS
- unref.insert (_search_pane->root());
-#endif
unref.insert (_group_pane->root());
unref.insert (_error_image);
unref.insert (_info_image);
delete _header_pane;
-#ifdef HAVE_RSS
- delete _search_pane;
-#endif
delete _group_pane;
delete _body_pane;
@@ -478,7 +456,6 @@ GUI :: ~GUI ()
_certstore.remove_listener(this);
_data.remove_listener(this);
_prefs.remove_listener (this);
- _queue.remove_listener (this);
Log::get().remove_listener (this);
}
@@ -903,13 +880,6 @@ void GUI :: do_show_task_window ()
toggle_visible (task_pane->root());
}
-void GUI :: do_show_dl_meter_prefs()
-{
- DLMeterDialog * dialog = new DLMeterDialog (_prefs, _meter, get_window(_root));
- g_signal_connect (dialog->root(), "destroy", G_CALLBACK(prefs_dialog_destroyed_cb), this);
- gtk_widget_show (dialog->root());
-}
-
namespace
{
void set_bin_child (GtkWidget * w, GtkWidget * new_child)
@@ -1176,8 +1146,6 @@ void GUI :: prefs_dialog_destroyed (GtkWidget *)
}
_cache.set_max_megs(_prefs.get_int("cache-size-megs",10));
- gtk_widget_set_visible(_meter.get_widget(), _prefs.get_flag("dl-meter-show", true));
-
}
diff --git a/pan/gui/gui.h b/pan/gui/gui.h
index 02b8524..474e8e3 100644
--- a/pan/gui/gui.h
+++ b/pan/gui/gui.h
@@ -32,7 +32,6 @@
#include <pan/gui/prefs.h>
#include <pan/gui/group-prefs.h>
#include <pan/gui/wait.h>
-#include <pan/data-impl/download-meter.h>
#include <stdint.h>
@@ -42,9 +41,7 @@ namespace pan
{
class GroupPane;
class HeaderPane;
- class SearchPane;
class BodyPane;
- class SearchPane;
class ProgressView;
/**
@@ -67,7 +64,7 @@ namespace pan
typedef std::vector<Quark> mid_sequence_t;
- GUI (Data& data, Queue&, Prefs&, GroupPrefs&, DownloadMeter&);
+ GUI (Data& data, Queue&, Prefs&, GroupPrefs&);
virtual ~GUI ();
GtkWidget* root () { return _root; }
typedef std::vector<std::string> strings_t;
@@ -112,7 +109,6 @@ namespace pan
virtual void do_import_tasks_from_nzb_stream (const char*);
virtual void do_cancel_latest_task ();
virtual void do_show_task_window ();
- virtual void do_show_dl_meter_prefs();
virtual void do_show_log_window ();
virtual void do_select_all_articles ();
virtual void do_unselect_all_articles ();
@@ -247,7 +243,6 @@ namespace pan
Prefs& _prefs;
GroupPrefs& _group_prefs;
CertStore& _certstore;
- DownloadMeter& _meter;
private:
GtkWidget * _root;
@@ -256,7 +251,6 @@ namespace pan
GtkWidget * _toolbar;
GroupPane * _group_pane;
HeaderPane * _header_pane;
- SearchPane * _search_pane;
BodyPane * _body_pane;
GtkUIManager * _ui_manager;
diff --git a/pan/gui/pan-ui.h b/pan/gui/pan-ui.h
index 6c43c81..d69b014 100644
--- a/pan/gui/pan-ui.h
+++ b/pan/gui/pan-ui.h
@@ -91,7 +91,6 @@ namespace pan
virtual void do_quit () = 0;
virtual void do_show_task_window () = 0;
- virtual void do_show_dl_meter_prefs() = 0;
virtual void do_show_log_window () = 0;
virtual void do_show_preferences_dialog () = 0;
virtual void do_show_group_preferences_dialog () = 0;
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index 28c1837..6d36b7c 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -987,7 +987,7 @@ main (int argc, char *argv[])
// instantiate the queue...
WorkerPool worker_pool (4, true);
SocketCreator socket_creator(data, certstore);
- Queue queue (data, data, data, data, &socket_creator, certstore, prefs, worker_pool, false, 32768);
+ Queue queue (data, data, data, &socket_creator, certstore, prefs, worker_pool, false, 32768);
#ifdef HAVE_DBUS
Pan pan(data, queue, cache, encode_cache, prefs, group_prefs);
@@ -1093,7 +1093,7 @@ main (int argc, char *argv[])
gtk_window_set_resizable (GTK_WINDOW(window), true);
gtk_window_set_default_icon (pixbuf);
- gui_ptr = new GUI (data, queue, prefs, group_prefs, data);
+ gui_ptr = new GUI (data, queue, prefs, group_prefs);
#ifdef HAVE_LIBNOTIFY
if (!notify_is_initted ())
diff --git a/pan/tasks/nntp-pool.cc b/pan/tasks/nntp-pool.cc
index 923858e..ffb344b 100644
--- a/pan/tasks/nntp-pool.cc
+++ b/pan/tasks/nntp-pool.cc
@@ -41,8 +41,7 @@ NNTP_Pool :: NNTP_Pool (const Quark & server,
ServerInfo & server_info,
Prefs & prefs,
SocketCreator * creator,
- CertStore & store,
- DownloadMeter & meter):
+ CertStore & store):
_server_info (server_info),
_prefs (prefs),
@@ -51,8 +50,7 @@ NNTP_Pool :: NNTP_Pool (const Quark & server,
_pending_connections (0),
_active_count (0),
_time_to_allow_new_connections (0),
- _certstore(store),
- _meter(meter)
+ _certstore(store)
{
}
@@ -193,11 +191,11 @@ NNTP_Pool :: on_socket_created (const StringView & host,
{
std::string pw (pass ? pass : "");
if (pass) g_free(pass);
- nntp = new NNTP (_server, user, pw, _meter, _server_info, socket);
+ nntp = new NNTP (_server, user, pw, _server_info, socket);
}
else
{
- nntp = new NNTP ( _server, user, pass, _meter, _server_info, socket);
+ nntp = new NNTP ( _server, user, pass, _server_info, socket);
}
nntp->handshake (this);
}
diff --git a/pan/tasks/nntp-pool.h b/pan/tasks/nntp-pool.h
index 6bd78b1..c44a7f3 100644
--- a/pan/tasks/nntp-pool.h
+++ b/pan/tasks/nntp-pool.h
@@ -49,7 +49,7 @@ class NNTP_Pool: public NNTP::Source,
public:
NNTP_Pool(const Quark & server, ServerInfo & server_info, Prefs& prefs, SocketCreator *,
- CertStore &, DownloadMeter& meter);
+ CertStore &);
virtual ~NNTP_Pool();
virtual void check_in(NNTP*, Health);
@@ -115,7 +115,6 @@ private:
int _pending_connections;
CertStore& _certstore;
Prefs& _prefs;
- DownloadMeter& _meter;
struct PoolItem {
NNTP * nntp;
diff --git a/pan/tasks/nntp.cc b/pan/tasks/nntp.cc
index b1433c9..c42d334 100644
--- a/pan/tasks/nntp.cc
+++ b/pan/tasks/nntp.cc
@@ -75,9 +75,6 @@ bool
NNTP :: on_socket_response (Socket * sock UNUSED, const StringView& line_in)
{
- //increase dl meter
- _meter.dl_meter_add (line_in.len);
-
enum State { CMD_FAIL, CMD_DONE, CMD_MORE, CMD_NEXT, CMD_RETRY };
State state;
StringView line (line_in);
@@ -213,6 +210,7 @@ NNTP :: on_socket_response (Socket * sock UNUSED, const StringView& line_in)
state = CMD_DONE;
break;
}
+ break;
case GROUP_NONEXISTENT:
state = CMD_FAIL;
break;
diff --git a/pan/tasks/nntp.h b/pan/tasks/nntp.h
index 7ac6469..1c61e8c 100644
--- a/pan/tasks/nntp.h
+++ b/pan/tasks/nntp.h
@@ -153,12 +153,10 @@ namespace pan
NNTP (const Quark & server,
const std::string & username,
const std::string & password,
- DownloadMeter & meter,
ServerInfo & info,
Socket * socket):
_server(server),
_server_info(info),
- _meter(meter),
_socket(socket),
_socket_error(false),
_listener(0),
@@ -323,7 +321,6 @@ namespace pan
ServerInfo& _server_info;
Quark _group;
Socket * _socket;
- DownloadMeter& _meter;
bool _socket_error;
const std::string& get_username()
{
diff --git a/pan/tasks/queue.cc b/pan/tasks/queue.cc
index e568b48..0481964 100644
--- a/pan/tasks/queue.cc
+++ b/pan/tasks/queue.cc
@@ -36,7 +36,6 @@ using namespace pan;
Queue :: Queue (ServerInfo & server_info,
TaskArchive & archive,
Data & data,
- DownloadMeter & meter,
SocketCreator * socket_creator,
CertStore & certstore,
Prefs & prefs,
@@ -56,14 +55,12 @@ Queue :: Queue (ServerInfo & server_info,
_needs_saving (false),
_last_time_saved (0),
_archive (archive),
- _meter (meter),
_certstore(certstore),
_uploads_total(0),
_downloads_total(0)
{
data.set_queue(this);
- meter.add_listener(this);
tasks_t tasks;
_archive.load_tasks (tasks);
@@ -75,7 +72,6 @@ Queue :: Queue (ServerInfo & server_info,
Queue :: ~Queue ()
{
_tasks.remove_listener (this);
- _meter.remove_listener(this);
foreach (pools_t, _pools, it)
delete it->second;
@@ -113,7 +109,7 @@ Queue :: get_pool (const Quark& servername)
}
else // have to build one
{
- pool = new NNTP_Pool (servername, _server_info, _prefs, _socket_creator, _certstore, _meter);
+ pool = new NNTP_Pool (servername, _server_info, _prefs, _socket_creator, _certstore);
pool->add_listener (this);
_pools[servername] = pool;
}
diff --git a/pan/tasks/queue.h b/pan/tasks/queue.h
index de3be6b..9758b2d 100644
--- a/pan/tasks/queue.h
+++ b/pan/tasks/queue.h
@@ -73,11 +73,10 @@ namespace pan
public Task::DecoderSource,
public Task::EncoderSource,
private NNTP_Pool::Listener,
- private AdaptableSet<Task*, TaskWeakOrdering>::Listener,
- private DownloadMeter::Listener
+ private AdaptableSet<Task*, TaskWeakOrdering>::Listener
{
public:
- Queue (ServerInfo&, TaskArchive&, Data&, DownloadMeter&, SocketCreator*, CertStore&, Prefs&,
WorkerPool&,
+ Queue (ServerInfo&, TaskArchive&, Data&, SocketCreator*, CertStore&, Prefs&, WorkerPool&,
bool online, int save_delay_secs);
virtual ~Queue ();
@@ -257,7 +256,6 @@ namespace pan
int _uploads_total, _downloads_total;
CertStore& _certstore;
Prefs& _prefs;
- DownloadMeter& _meter;
private:
typedef AdaptableSet<Task*, TaskWeakOrdering> TaskSet;
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index 8aa7231..8487d7c 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -340,14 +340,13 @@ TaskUpload :: on_nntp_done (NNTP * nntp,
else
{
g_snprintf(buf,sizeof(buf), _("Posting of file %s not completely successful: Check the log
(right-click list item)."),
- _basename.c_str(), response.str);
+ _basename.c_str());
tmp.severity = Log :: PAN_SEVERITY_ERROR;
}
tmp.message = buf;
Log::add_entry_list (tmp, _logfile);
_logfile.clear();
}
-
case TOO_MANY_CONNECTIONS:
// lockout for 120 secs, but try
it->second.reset();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]