Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

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

Summary:
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: https://phabricator.kde.org/D15356
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";
continue;
}
......
Markdown is supported
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