Changeset View
Changeset View
Standalone View
Standalone View
runners/bookmarks/browsers/firefox.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 92 | } else { | |||
---|---|---|---|---|---|
93 | query = QString("SELECT moz_bookmarks.fk, moz_bookmarks.title, moz_places.url " \ | 93 | query = QString("SELECT moz_bookmarks.fk, moz_bookmarks.title, moz_places.url " \ | ||
94 | "FROM moz_bookmarks, moz_places WHERE " \ | 94 | "FROM moz_bookmarks, moz_places WHERE " \ | ||
95 | "moz_bookmarks.type = 1 AND moz_bookmarks.fk = moz_places.id AND " \ | 95 | "moz_bookmarks.type = 1 AND moz_bookmarks.fk = moz_places.id AND " \ | ||
96 | "(moz_bookmarks.title LIKE :term OR moz_places.url LIKE :term)"); | 96 | "(moz_bookmarks.title LIKE :term OR moz_places.url LIKE :term)"); | ||
97 | } | 97 | } | ||
98 | const QMap<QString, QVariant> bindVariables { | 98 | const QMap<QString, QVariant> bindVariables { | ||
99 | {QStringLiteral(":term"), QStringLiteral("%%%1%%").arg(term)}, | 99 | {QStringLiteral(":term"), QStringLiteral("%%%1%%").arg(term)}, | ||
100 | }; | 100 | }; | ||
101 | QList<QVariantMap> results = m_fetchsqlite->query(query, bindVariables); | 101 | const QList<QVariantMap> results = m_fetchsqlite->query(query, bindVariables); | ||
102 | QMultiMap<QString, QString> uniqueResults; | 102 | QMultiMap<QString, QString> uniqueResults; | ||
103 | foreach(QVariantMap result, results) { | 103 | for(const QVariantMap &result : results) { | ||
104 | const QString title = result.value(QStringLiteral("title")).toString(); | 104 | const QString title = result.value(QStringLiteral("title")).toString(); | ||
105 | const QUrl url = result.value(QStringLiteral("url")).toUrl(); | 105 | const QUrl url = result.value(QStringLiteral("url")).toUrl(); | ||
106 | if (url.isEmpty() || url.scheme() == QLatin1String("place")) { | 106 | if (url.isEmpty() || url.scheme() == QLatin1String("place")) { | ||
107 | // Don't use bookmarks with empty url or Firefox's "place:" scheme, | 107 | // Don't use bookmarks with empty url or Firefox's "place:" scheme, | ||
108 | // e.g. used for "Most Visited" or "Recent Tags" | 108 | // e.g. used for "Most Visited" or "Recent Tags" | ||
109 | //qDebug() << "element " << url << " was not added"; | 109 | //qDebug() << "element " << url << " was not added"; | ||
110 | continue; | 110 | continue; | ||
111 | } | 111 | } | ||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |