summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis van der Schagt <dennisschagt@gmail.com>2024-10-05 02:45:43 +0200
committerDennis van der Schagt <dennisschagt@gmail.com>2024-10-05 02:46:43 +0200
commit8cff36ab9a968f022a9ad7cf9f040d9a2902b1c4 (patch)
tree109efd7463aeb3e086d75eb05c6c0128df19d3fd
parent71748fe47193572481a848e78af7d3b00ed4c7a3 (diff)
replace_feed: Pass RssFeed by reference instead of shared_ptr
-rw-r--r--include/controller.h5
-rw-r--r--src/controller.cpp12
-rw-r--r--src/reloader.cpp2
3 files changed, 7 insertions, 12 deletions
diff --git a/include/controller.h b/include/controller.h
index 12c6e6d5..dc6abf7a 100644
--- a/include/controller.h
+++ b/include/controller.h
@@ -80,10 +80,7 @@ public:
return reloader.get();
}
- void replace_feed(std::shared_ptr<RssFeed> oldfeed,
- std::shared_ptr<RssFeed> newfeed,
- unsigned int pos,
- bool unattended);
+ void replace_feed(RssFeed& oldfeed, RssFeed& newfeed, unsigned int pos, bool unattended);
ConfigContainer* get_config()
{
diff --git a/src/controller.cpp b/src/controller.cpp
index cd6e10e7..96f5f0c6 100644
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -703,25 +703,23 @@ void Controller::mark_all_read(const std::vector<std::string>& item_guids)
}
}
-void Controller::replace_feed(std::shared_ptr<RssFeed> oldfeed,
- std::shared_ptr<RssFeed> newfeed,
- unsigned int pos,
+void Controller::replace_feed(RssFeed& oldfeed, RssFeed& newfeed, unsigned int pos,
bool unattended)
{
LOG(Level::DEBUG, "Controller::replace_feed: saving");
rsscache->externalize_rssfeed(
- *newfeed, ign.matches_resetunread(newfeed->rssurl()));
+ newfeed, ign.matches_resetunread(newfeed.rssurl()));
LOG(Level::DEBUG,
"Controller::replace_feed: after externalize_rssfeed");
bool ignore_disp = (cfg.get_configvalue("ignore-mode") == "display");
std::shared_ptr<RssFeed> feed = rsscache->internalize_rssfeed(
- oldfeed->rssurl(), ignore_disp ? &ign : nullptr);
+ oldfeed.rssurl(), ignore_disp ? &ign : nullptr);
LOG(Level::DEBUG,
"Controller::replace_feed: after internalize_rssfeed");
- feed->set_tags(urlcfg->get_tags(oldfeed->rssurl()));
- feed->set_order(oldfeed->get_order());
+ feed->set_tags(urlcfg->get_tags(oldfeed.rssurl()));
+ feed->set_order(oldfeed.get_order());
feedcontainer.replace_feed(pos, feed);
if (cfg.get_configvalue_as_bool("podcast-auto-enqueue")) {
diff --git a/src/reloader.cpp b/src/reloader.cpp
index ae23d24a..2472e304 100644
--- a/src/reloader.cpp
+++ b/src/reloader.cpp
@@ -117,7 +117,7 @@ void Reloader::reload(unsigned int pos,
sm.stopover("start replacing feed");
if (newfeed != nullptr) {
ctrl->replace_feed(
- oldfeed, newfeed, pos, unattended);
+ *oldfeed, *newfeed, pos, unattended);
if (newfeed->total_item_count() == 0) {
LOG(Level::DEBUG,
"Reloader::reload: feed is empty");