Skip to content

Commit

Permalink
Update README.md, minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1701c committed Sep 25, 2019
1 parent d0fb09d commit 7fc7334
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/quick_web_shortcuts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -135,7 +134,6 @@ void QuickWebShortcuts::match(Plasma::RunnerContext &context) {
// Remove escape character
QString term = QString(context.query()).replace(QString::fromWCharArray(L"\u001B"), " ");

QList<Plasma::QueryMatch> matches;
QMap<QString, QVariant> data;

if (term.startsWith("::")) {
Expand Down Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/quick_web_shortcuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> searchEngines;

Plasma::QueryMatch createMatch(const QString &text, const QMap<QString, QVariant> &data, bool useGlobe = false);

Expand Down

0 comments on commit 7fc7334

Please sign in to comment.