aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-06-22 21:50:48 +0200
committerdec05eba <dec05eba@protonmail.com>2020-06-22 21:50:48 +0200
commit99915ba9ec15a5018be4e7793c1482a032c3ca14 (patch)
tree02faeaa99e7e99dded6b8cd99b2cc3d96ac4414b /src/plugins
parentf8cf25f3ecd2b312c3a88b9bb67451a86e511c4a (diff)
Support installation resources path
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Fourchan.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index 073356b..22a3faf 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -12,7 +12,7 @@ static const std::string fourchan_url = "https://a.4cdn.org/";
static const std::string fourchan_image_url = "https://i.4cdn.org/";
namespace QuickMedia {
- Fourchan::Fourchan() : ImageBoard("4chan") {
+ Fourchan::Fourchan(const std::string &resources_root) : ImageBoard("4chan"), resources_root(resources_root) {
thread_list_update_thread = std::thread([this]() {
BodyItems new_thread_list_items;
while(running) {
@@ -52,7 +52,7 @@ namespace QuickMedia {
return PluginResult::NET_ERR;
#else
std::string server_response;
- if(file_get_content("../../../boards.json", server_response) != 0) {
+ if(file_get_content(resources_root + "boards.json", server_response) != 0) {
fprintf(stderr, "failed to read boards.json\n");
return PluginResult::ERR;
}