From fbe607f90c70a40bb943eea264d1dada81910c7f Mon Sep 17 00:00:00 2001 From: Andreas Krennmair Date: Sun, 12 Nov 2006 10:34:28 +0000 Subject: Andreas Krennmair: added first parts of a cache. --- src/controller.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/controller.cpp') diff --git a/src/controller.cpp b/src/controller.cpp index 55d1e129..58f5e1f4 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -6,7 +6,7 @@ using namespace noos; -controller::controller() : v(0) { +controller::controller() : v(0), rsscache(0) { std::ostringstream cfgfile; cfgfile << "urls.txt"; // XXX refactor cfg.load_config(cfgfile.str()); @@ -15,6 +15,13 @@ controller::controller() : v(0) { std::cerr << "error: no URLs configured." << std::endl; ::exit(1); } + + rsscache = new cache("cache.db"); +} + +controller::~controller() { + if (rsscache) + delete rsscache; } void controller::set_view(view * vv) { @@ -39,6 +46,8 @@ void controller::open_feed(unsigned int pos) { parser.parse(); rss_feed& feed = parser.get_feed(); + rsscache->externalize_rssfeed(feed); + v->feedlist_status(""); if (feed.items().size() == 0) { -- cgit v1.2.3