diff options
author | bogdasar1985 <bogdasar1985@gmail.com> | 2023-10-02 16:19:56 +0500 |
---|---|---|
committer | Alexander Batischev <eual.jp@gmail.com> | 2024-10-01 19:12:41 +0300 |
commit | 7a7020445d82ce9012b65eacb140b4c49309c670 (patch) | |
tree | 49a2d51c35202c90a68ba9fabb126833fc4a987b | |
parent | 44e04d0b24a399a2e9d8193a554c321c36194234 (diff) |
Migrate QueueManager to Filepath
-rw-r--r-- | include/queuemanager.h | 8 | ||||
-rw-r--r-- | src/queuemanager.cpp | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/queuemanager.h b/include/queuemanager.h index 759834bd..57bfb51b 100644 --- a/include/queuemanager.h +++ b/include/queuemanager.h @@ -4,6 +4,8 @@ #include <memory> #include <string> +#include "filepath.h" + namespace newsboat { class ConfigContainer; @@ -24,12 +26,12 @@ struct EnqueueResult { class QueueManager { ConfigContainer* cfg = nullptr; - std::string queue_file; + Filepath queue_file; public: /// Construct `QueueManager` instance out of a config container and a path /// to the queue file. - QueueManager(ConfigContainer* cfg, std::string queue_file); + QueueManager(ConfigContainer* cfg, Filepath queue_file); /// Adds the podcast URL to Podboat's queue file EnqueueResult enqueue_url(std::shared_ptr<RssItem> item, @@ -39,7 +41,7 @@ public: EnqueueResult autoenqueue(std::shared_ptr<RssFeed> feed); private: - std::string generate_enqueue_filename(std::shared_ptr<RssItem> item, + Filepath generate_enqueue_filename(std::shared_ptr<RssItem> item, std::shared_ptr<RssFeed> feed); }; diff --git a/src/queuemanager.cpp b/src/queuemanager.cpp index 899dd4dc..e9028d7d 100644 --- a/src/queuemanager.cpp +++ b/src/queuemanager.cpp @@ -10,7 +10,7 @@ namespace newsboat { -QueueManager::QueueManager(ConfigContainer* cfg_, std::string queue_file) +QueueManager::QueueManager(ConfigContainer* cfg_, Filepath queue_file) : cfg(cfg_) , queue_file(std::move(queue_file)) {} @@ -19,7 +19,7 @@ EnqueueResult QueueManager::enqueue_url(std::shared_ptr<RssItem> item, std::shared_ptr<RssFeed> feed) { const std::string& url = item->enclosure_url(); - const std::string filename = generate_enqueue_filename(item, feed); + const Filepath filename = generate_enqueue_filename(item, feed); std::fstream f; f.open(queue_file, std::fstream::in); @@ -63,7 +63,7 @@ std::string get_hostname_from_url(const std::string& url) return hostname; } -std::string QueueManager::generate_enqueue_filename( +Filepath QueueManager::generate_enqueue_filename( std::shared_ptr<RssItem> item, std::shared_ptr<RssFeed> feed) { |