]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/helpers/SearchEngineHelper.cpp
Block all CSP requests. https://redmine.stoutner.com/issues/1193
[PrivacyBrowserPC.git] / src / helpers / SearchEngineHelper.cpp
index 82919269a7f19bf8368267669481a31a280606bf..6433c5b92e7cf3d0c31b7aecb0ca8802d4f5fca7 100644 (file)
@@ -1,53 +1,53 @@
-/*
- * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2022, 2024 Soren Stoutner <soren@stoutner.com>
  *
  *
- * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ * This file is part of Privacy Browser PC <https://www.stoutner.com/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.
+ * This program 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.
+ * This program 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 <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
 #include "SearchEngineHelper.h"
 
  */
 
 // Application headers.
 #include "SearchEngineHelper.h"
 
-// The default constructor.
-SearchEngineHelper::SearchEngineHelper() {};
+// Construct the class.
+SearchEngineHelper::SearchEngineHelper() {}
 
 QString SearchEngineHelper::getSearchUrl(const QString &searchEngineName)
 {
 
 QString SearchEngineHelper::getSearchUrl(const QString &searchEngineName)
 {
-    if (searchEngineName == "Mojeek")  // Mojeek.
+    if (searchEngineName == QLatin1String("Mojeek"))  // Mojeek.
     {
     {
-        return "https://www.mojeek.com/search?q=";
+        return QLatin1String("https://www.mojeek.com/search?q=");
     }
     }
-    else if (searchEngineName == "Monocles")  // Monocles.
+    else if (searchEngineName == QLatin1String("Monocles"))  // Monocles.
     {
     {
-        return "https://monocles.de/search?q=";
+        return QLatin1String("https://monocles.de/search?q=");
     }
     }
-    else if (searchEngineName == "MetaGer")  // MetaGer.
+    else if (searchEngineName == QLatin1String("MetaGer"))  // MetaGer.
     {
     {
-        return "https://metager.org/meta/meta.ger3?eingabe=";
+        return QLatin1String("https://metager.org/meta/meta.ger3?eingabe=");
     }
     }
-    else if (searchEngineName == "Google")  // Google.
+    else if (searchEngineName == QLatin1String("Google"))  // Google.
     {
     {
-        return "https://www.google.com/search?q=";
+        return QLatin1String("https://www.google.com/search?q=");
     }
     }
-    else if (searchEngineName == "Bing")  // Bing.
+    else if (searchEngineName == QLatin1String("Bing"))  // Bing.
     {
     {
-        return "https://www.bing.com/search?q=";
+        return QLatin1String("https://www.bing.com/search?q=");
     }
     }
-    else if (searchEngineName == "Yahoo")  // Yahoo.
+    else if (searchEngineName == QLatin1String("Yahoo"))  // Yahoo.
     {
     {
-        return "https://search.yahoo.com/search?p=";
+        return QLatin1String("https://search.yahoo.com/search?p=");
     }
     else
     {
     }
     else
     {