diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-24 07:53:33 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-24 07:54:32 +0200 |
commit | 1026360c595818eabe75813bcd02258c4d0dddc7 (patch) | |
tree | 2d1c9877c695c53942247aafed99a086be2387a4 /src/DownloadUtils.cpp | |
parent | 318d230c19954c8dade052b05a9e23d5d2c53e7e (diff) |
Save the last accessed file manager directory and use that the next time. Add ctrl+s for 4chan without viewing the image/video in fullscreen mode
Diffstat (limited to 'src/DownloadUtils.cpp')
-rw-r--r-- | src/DownloadUtils.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/DownloadUtils.cpp b/src/DownloadUtils.cpp index 7d2cbb8..b6d21b9 100644 --- a/src/DownloadUtils.cpp +++ b/src/DownloadUtils.cpp @@ -222,13 +222,12 @@ namespace QuickMedia { return DownloadResult::OK; } - bool download_async_gui(const std::string &url, bool use_youtube_dl, bool no_video) { - // TODO: Figure out why /proc/self/exe doesn't work when installed to /usr/bin/quickmedia - char quickmedia_path[PATH_MAX] = "quickmedia"; - //if(readlink("/proc/self/exe", quickmedia_path, sizeof(quickmedia_path)) == -1) - // return false; + bool download_async_gui(const std::string &url, const std::string &file_manager_start_dir, bool use_youtube_dl, bool no_video) { + char quickmedia_path[PATH_MAX]; + if(readlink("/proc/self/exe", quickmedia_path, sizeof(quickmedia_path)) == -1) + strcpy(quickmedia_path, "quickmedia"); - std::vector<const char*> args = { quickmedia_path, "download", "-u", url.c_str() }; + std::vector<const char*> args = { quickmedia_path, "download", "-u", url.c_str(), "--dir", file_manager_start_dir.c_str() }; if(use_youtube_dl) args.push_back("--youtube-dl"); if(no_video) args.push_back("--no-video"); args.push_back(nullptr); |