1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

[LocationCompleter] Fix showing icons after last commit

This commit is contained in:
David Rosca 2014-05-30 22:06:58 +02:00
parent 666ecc4d01
commit 59b893075a
2 changed files with 3 additions and 2 deletions

View File

@ -97,10 +97,11 @@ void LocationCompleterRefreshJob::runJob()
// Load all icons into QImage
QSqlQuery query;
query.prepare(QSL("SELECT icon FROM icons WHERE url LIKE ? LIMIT 1"));
foreach (QStandardItem* item, m_items) {
const QUrl url = item->data(LocationCompleterModel::UrlRole).toUrl();
query.addBindValue(QString(QL1S("%1%")).arg(QString::fromUtf8(url.toEncoded(QUrl::RemoveFragment))));
query.bindValue(0, QString(QL1S("%1%")).arg(QString::fromUtf8(url.toEncoded(QUrl::RemoveFragment))));
QSqlQuery res = SqlDatabase::instance()->exec(query);
if (res.next()) {

View File

@ -193,7 +193,7 @@ QImage IconProvider::imageForDomain(const QUrl &url)
}
QSqlQuery query;
query.prepare("SELECT icon FROM icons WHERE url LIKE ?");
query.prepare("SELECT icon FROM icons WHERE url LIKE ? LIMIT 1");
query.addBindValue(QString("%%1%").arg(url.host()));
query.exec();