diff -r 6078840978b1 -r d26902edeef5 bookmarksengine/browsercontentdll/src/browsercontentdll.cpp --- a/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp Wed Sep 22 15:59:07 2010 -0400 +++ b/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp Thu Sep 23 15:31:07 2010 -0400 @@ -784,3 +784,28 @@ return false; } + +QMap BrowserContent::findSimilarHistoryItems(QString atitle) +{ + BOOKMARKSCLIENT_PRIVATEPTR(BrowserContent); + QSqlDatabase db = QSqlDatabase::database(priv->m_connectionName); + + QMap map; + + if (db.isOpen()){ + QSqlQuery query(db); + + QString queryStatement = "SELECT url, pageTitle FROM HistoryTable WHERE pageTitle LIKE '%"+atitle+"%' OR url LIKE '%" + atitle + "%'"; + query.prepare(queryStatement); + if(query.exec()) { + while (query.next()){ + QString HistoryUrl = query.value(0).toString(); + QString HistoryTitle = query.value(1).toString(); + map.insert( HistoryUrl, HistoryTitle ); + } + } else { + QSqlError error = query.lastError(); + } + } + return map; +}