diff --git a/README.md b/README.md index 8e73acc..efd61f5 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,14 @@ The master branch (default) is recommended for most users. ### Build Instructions Required Dependencies on Debian/Ubuntu: -`sudo apt install cmake extra-cmake-modules build-essential libkf5runner-dev libkf5textwidgets-dev qtdeclarative5-dev gettext` +`sudo apt install cmake extra-cmake-modules build-essential libkf5runner-dev libkf5textwidgets-dev qtdeclarative5-dev gettext libnotify-bin` openSUSE -`sudo zypper install cmake extra-cmake-modules libQt5Widgets5 libQt5Core5 libqt5-qtlocation-devel ki18n-devel ktextwidgets-devel kservice-devel krunner-devel gettext-tools` +`sudo zypper install cmake extra-cmake-modules libQt5Widgets5 libQt5Core5 libqt5-qtlocation-devel ki18n-devel ktextwidgets-devel + kservice-devel krunner-devel gettext-tools libnotify-tools` Fedora -`sudo dnf install cmake extra-cmake-modules kf5-ki18n-devel kf5-kservice-devel kf5-krunner-devel kf5-ktextwidgets-devel gettext` +`sudo dnf install cmake extra-cmake-modules kf5-ki18n-devel kf5-kservice-devel kf5-krunner-devel kf5-ktextwidgets-devel gettext libnotify` The easiest way to install is: @@ -82,6 +83,9 @@ DuckDuckGo website, because of that this option is not as fast as the others. Un Additionally you can enable suggestions for private/incognito searches. To protect your privacy you can configure a proxy. This configuration can be tested by clicking the "Test Proxy Configuration" button. For this the plugin is sending a request to https://ifconfig.me/ip. +Note: If your internet connection is very slow and you have search suggestions configured +the plugin shows sometimes no matches, in this case yu can just add +a space to the query so that the match method is called again. ![Configure search suggestions](https://raw.githubusercontent.com/alex1701c/Screenshots/master/QuickWebShortcuts/config_dialog_search_suggestions_section.png) #### Configure history clearing diff --git a/src/quick_web_shortcuts.cpp b/src/quick_web_shortcuts.cpp index 710dce6..8830250 100644 --- a/src/quick_web_shortcuts.cpp +++ b/src/quick_web_shortcuts.cpp @@ -46,7 +46,6 @@ void QuickWebShortcuts::reloadConfiguration() { } // Load general settings - globeIcon = QIcon::fromTheme("globe"); openUrls = configGroup.readEntry("open_urls", "true") == "true"; if (configGroup.readEntry("show_search_for_note") == "false") { searchOptionTemplate = "%1"; @@ -135,7 +134,6 @@ void QuickWebShortcuts::match(Plasma::RunnerContext &context) { // Remove escape character QString term = QString(context.query()).replace(QString::fromWCharArray(L"\u001B"), " "); - QList matches; QMap data; if (term.startsWith("::")) { @@ -168,7 +166,7 @@ void QuickWebShortcuts::match(Plasma::RunnerContext &context) { duckDuckGoSearchSuggest(context, term); } } - } else if (openUrls && term.contains(QRegExp(R"(^.*\.[a-z]{2,5}$)"))) { + } else if (openUrls && term.contains(urlRegex)) { QString text = "Go To " + term; data.insert("url", !term.startsWith("http") ? "http://" + term : term); context.addMatch(createMatch(text, data, true)); diff --git a/src/quick_web_shortcuts.h b/src/quick_web_shortcuts.h index b431ba3..3344b6a 100644 --- a/src/quick_web_shortcuts.h +++ b/src/quick_web_shortcuts.h @@ -19,12 +19,12 @@ Q_OBJECT int minimumLetterCount, maxSuggestionResults; QString privateBrowser, privateBrowserMode, searchOptionTemplate, searchSuggestionChoice; QString bingMarket, googleLocale; - QIcon globeIcon; + const QIcon globeIcon = QIcon::fromTheme("globe"); QNetworkProxy *proxy; SearchEngine currentSearchEngine; + const QRegExp urlRegex = QRegExp(R"(^.*\.[a-z]{2,5}$)"); RequiredData requiredData; - QMap searchEngines; Plasma::QueryMatch createMatch(const QString &text, const QMap &data, bool useGlobe = false);