diff options
author | Alexander Batischev <eual.jp@gmail.com> | 2021-04-30 22:19:57 +0300 |
---|---|---|
committer | Alexander Batischev <eual.jp@gmail.com> | 2021-05-17 15:23:13 +0300 |
commit | 51ad6fc931136dd40187209f4f495cc6cddbf732 (patch) | |
tree | e5c010b7bcfcf27f9c46ca72fd18e7f407640e1b | |
parent | d5439aca17357e52ec3a7f0ce71223e9a4dba231 (diff) |
Switch QueueLoader's storage to Utf8String
-rw-r--r-- | include/queueloader.h | 3 | ||||
-rw-r--r-- | src/queueloader.cpp | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/queueloader.h b/include/queueloader.h index 481017d8..a6af2045 100644 --- a/include/queueloader.h +++ b/include/queueloader.h @@ -8,6 +8,7 @@ #include "configcontainer.h" #include "download.h" +#include "utf8string.h" namespace podboat { @@ -30,7 +31,7 @@ public: private: std::string get_filename(const std::string& str) const; - const std::string queuefile; + const newsboat::Utf8String queuefile; const newsboat::ConfigContainer& cfg; std::function<void()> cb_require_view_update; diff --git a/src/queueloader.cpp b/src/queueloader.cpp index 434fc141..7f20e300 100644 --- a/src/queueloader.cpp +++ b/src/queueloader.cpp @@ -23,7 +23,7 @@ namespace podboat { QueueLoader::QueueLoader(const std::string& filepath, const ConfigContainer& cfg_, std::function<void()> cb_require_view_update_) - : queuefile(filepath) + : queuefile(Utf8String::from_utf8(filepath)) , cfg(cfg_) , cb_require_view_update(cb_require_view_update_) { @@ -103,7 +103,7 @@ nonstd::optional<QueueLoader::CategorizedDownloads> QueueLoader::categorize_down void QueueLoader::update_from_queue_file(CategorizedDownloads& downloads) const { - std::fstream f(queuefile, std::fstream::in); + std::fstream f(queuefile.to_utf8(), std::fstream::in); if (!f.is_open()) { return; } @@ -204,7 +204,7 @@ void QueueLoader::update_from_queue_file(CategorizedDownloads& downloads) const void QueueLoader::write_queue_file(const CategorizedDownloads& downloads) const { - std::fstream f(queuefile, std::fstream::out); + std::fstream f(queuefile.to_utf8(), std::fstream::out); if (!f.is_open()) { return; } |