Changeset View
Changeset View
Standalone View
Standalone View
runners/bookmarks/browsers/firefox.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 95 | query = QString("SELECT moz_bookmarks.fk, moz_bookmarks.title, moz_places.url " \ | |||
---|---|---|---|---|---|
97 | "moz_bookmarks.type = 1 AND moz_bookmarks.fk = moz_places.id AND " \ | 97 | "moz_bookmarks.type = 1 AND moz_bookmarks.fk = moz_places.id AND " \ | ||
98 | "(moz_bookmarks.title LIKE '%" + escapedTerm + "%' or moz_places.url LIKE '%" | 98 | "(moz_bookmarks.title LIKE '%" + escapedTerm + "%' or moz_places.url LIKE '%" | ||
99 | + escapedTerm + "%')"); | 99 | + escapedTerm + "%')"); | ||
100 | } | 100 | } | ||
101 | QList<QVariantMap> results = m_fetchsqlite->query(query, QMap<QString, QVariant>()); | 101 | QList<QVariantMap> results = m_fetchsqlite->query(query, QMap<QString, QVariant>()); | ||
102 | foreach(QVariantMap result, results) { | 102 | foreach(QVariantMap result, results) { | ||
103 | const QString title = result.value(QStringLiteral("title")).toString(); | 103 | const QString title = result.value(QStringLiteral("title")).toString(); | ||
104 | const QUrl url = result.value(QStringLiteral("url")).toUrl(); | 104 | const QUrl url = result.value(QStringLiteral("url")).toUrl(); | ||
105 | if (url.scheme().contains(QStringLiteral("place"))) { | 105 | if (url.isEmpty() || url.scheme() == QLatin1String("place")) { | ||
106 | //Don't use bookmarks with empty title, url or Firefox intern url | 106 | // Don't use bookmarks with empty url or Firefox's "place:" scheme, | ||
107 | // e.g. used for "Most Visited" or "Recent Tags" | ||||
davidedmundson: whilst we're at it
QLatin1String | |||||
107 | //qDebug() << "element " << url << " was not added"; | 108 | //qDebug() << "element " << url << " was not added"; | ||
108 | continue; | 109 | continue; | ||
109 | } | 110 | } | ||
110 | 111 | | |||
111 | BookmarkMatch bookmarkMatch( m_favicon, term, title, url.toString()); | 112 | BookmarkMatch bookmarkMatch( m_favicon, term, title, url.toString()); | ||
112 | bookmarkMatch.addTo(matches, addEverything); | 113 | bookmarkMatch.addTo(matches, addEverything); | ||
113 | } | 114 | } | ||
114 | 115 | | |||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
whilst we're at it
QLatin1String