X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fhelpers%2FSearchEngineHelper.cpp;fp=src%2Fhelpers%2FSearchEngineHelper.cpp;h=82919269a7f19bf8368267669481a31a280606bf;hp=0000000000000000000000000000000000000000;hb=68167c0aba46c4bd4c859b176824873ffd14a3e7;hpb=d37c965b5cc545db8845756ff2e059fd20a54869 diff --git a/src/helpers/SearchEngineHelper.cpp b/src/helpers/SearchEngineHelper.cpp new file mode 100644 index 0000000..8291926 --- /dev/null +++ b/src/helpers/SearchEngineHelper.cpp @@ -0,0 +1,57 @@ +/* + * Copyright © 2022 Soren Stoutner . + * + * This file is part of Privacy Browser PC . + * + * Privacy Browser PC is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Privacy Browser PC is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Privacy Browser PC. If not, see . + */ + +// Application headers. +#include "SearchEngineHelper.h" + +// The default constructor. +SearchEngineHelper::SearchEngineHelper() {}; + +QString SearchEngineHelper::getSearchUrl(const QString &searchEngineName) +{ + if (searchEngineName == "Mojeek") // Mojeek. + { + return "https://www.mojeek.com/search?q="; + } + else if (searchEngineName == "Monocles") // Monocles. + { + return "https://monocles.de/search?q="; + } + else if (searchEngineName == "MetaGer") // MetaGer. + { + return "https://metager.org/meta/meta.ger3?eingabe="; + } + else if (searchEngineName == "Google") // Google. + { + return "https://www.google.com/search?q="; + } + else if (searchEngineName == "Bing") // Bing. + { + return "https://www.bing.com/search?q="; + } + else if (searchEngineName == "Yahoo") // Yahoo. + { + return "https://search.yahoo.com/search?p="; + } + else + { + // Return the custom user agent. + return searchEngineName; + } +}