Commit 08895fd7 authored by Stefan Brüns's avatar Stefan Brüns
Browse files

[Bookmarks Runner] Filter out empty urls, simplify, fix comment

Bookmarks may have no title, the user is free to delete it when creating
a bookmark.
A bookmark without URL would be useless (there were nothing to refer to),
so ignore any bookmark with an empty URL.
Simplify check for Firefox specific "place:" URLs.

Test Plan:
Search for "Recent" or "place"
"Recent Tags" is still filtered out

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision:
parent cb680537
......@@ -102,8 +102,9 @@ QList< BookmarkMatch > Firefox::match(const QString& term, bool addEverything)
foreach(QVariantMap result, results) {
const QString title = result.value(QStringLiteral("title")).toString();
const QUrl url = result.value(QStringLiteral("url")).toUrl();
if (url.scheme().contains(QStringLiteral("place"))) {
//Don't use bookmarks with empty title, url or Firefox intern url
if (url.isEmpty() || url.scheme() == QLatin1String("place")) {
// Don't use bookmarks with empty url or Firefox's "place:" scheme,
// e.g. used for "Most Visited" or "Recent Tags"
//qDebug() << "element " << url << " was not added";
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment