aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Info.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Info.cpp')
-rw-r--r--src/plugins/Info.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/Info.cpp b/src/plugins/Info.cpp
index 2b520ac..90c8fe1 100644
--- a/src/plugins/Info.cpp
+++ b/src/plugins/Info.cpp
@@ -32,20 +32,20 @@ namespace QuickMedia {
return exec_program_async(args, nullptr) == 0 ? PluginResult::OK : PluginResult::ERR;
}
- PluginResult InfoPage::submit(const std::string&, const std::string &url, std::vector<Tab> &result_tabs) {
- if(string_starts_with(url, REVERSE_IMAGE_SEARCH_URL)) {
- std::string image_url = url.substr(strlen(REVERSE_IMAGE_SEARCH_URL));
+ PluginResult InfoPage::submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) {
+ if(string_starts_with(args.url, REVERSE_IMAGE_SEARCH_URL)) {
+ std::string image_url = args.url.substr(strlen(REVERSE_IMAGE_SEARCH_URL));
result_tabs.push_back(Tab{create_body(), std::make_unique<SaucenaoPage>(program, image_url, false), nullptr});
return PluginResult::OK;
- } else if(string_starts_with(url, GOOGLE_SEARCH_URL)) {
- const std::string search_term = url.substr(strlen(GOOGLE_SEARCH_URL));
+ } else if(string_starts_with(args.url, GOOGLE_SEARCH_URL)) {
+ const std::string search_term = args.url.substr(strlen(GOOGLE_SEARCH_URL));
const std::string search_url = "https://www.google.com/search?q=" + url_param_encode(search_term);
return open_with_browser(search_url);
- } else if(is_youtube_url(url)) {
- result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, url), nullptr});
+ } else if(is_youtube_url(args.url)) {
+ result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, args.url), nullptr});
return PluginResult::OK;
} else {
- return open_with_browser(url);
+ return open_with_browser(args.url);
}
}