Revision: 201031
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 09:59:06 +0300
changeset 7 580d0a0c653c
parent 4 6637b4599484
child 10 b61e1b3b145f
Revision: 201031 Kit: 201033
bookmarksengine/browsercontentdll/src/browsercontentdll.cpp
--- a/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp	Tue Jul 06 14:27:10 2010 +0300
+++ b/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp	Wed Aug 18 09:59:06 2010 +0300
@@ -25,8 +25,10 @@
 #include<QSqlQuery>
 #include<QSqlError>
 #include<QDebug>
+
 const QString dbLocation="browserContent.db";
 
+
 class BrowserContentPrivate {
 BOOKMARKSCLIENT_PUBLIC(BrowserContent)
 public:
@@ -68,7 +70,6 @@
     if (!sqlDB.open())
         return -1;
     QSqlError error;
-    int  err = ErrGeneral;
 
     //Check if the table exists, create table only when it's empty 
     QStringList tablelist = sqlDB.tables(QSql::Tables);
@@ -518,12 +519,11 @@
     if(atitle.contains("'", Qt::CaseInsensitive))
       atitle.replace(QString("'"), QString("''"));
  
-    QString queryStatement = "SELECT title,url,1 FROM HistoryTable WHERE title LIKE '%" + atitle + "%' OR url LIKE '%" + atitle + "%'" +
-                             " UNION " +
-                             "SELECT title,url,2 FROM BookMarkTable WHERE title LIKE '%" + atitle + "%' OR url LIKE '%" + atitle + "%'" +
-							 "ORDER BY 3";
-							 
-        
+    QString queryStatement = "SELECT pageTitle,url,1 FROM HistoryTable WHERE pagetitle LIKE '%" + atitle + "%' OR url LIKE '%" + atitle + "%' "+
+    						 " UNION "+
+    						 "SELECT title,url,2 FROM BookMarkTable WHERE title LIKE '%"+atitle+"%' OR url LIKE '%" + atitle + "%'"+
+    						 " ORDER BY 3";
+         
         query.prepare(queryStatement);
         query.exec();
         QSqlError error = query.lastError();
@@ -630,7 +630,6 @@
     BOOKMARKSCLIENT_PRIVATEPTR(BrowserContent);
     QSqlDatabase db = QSqlDatabase::database(priv->m_connectionName);
     QList<HistoryLeaf*> nodeslist;
-    int i=0;
     bool dbopen = db.isOpen();
     bool ok;
     QString history = "";
@@ -698,7 +697,6 @@
     QSqlDatabase db = QSqlDatabase::database(priv->m_connectionName);
 
     bool dbopen = db.isOpen();
-    int i=0;
 
     if(dbopen)
         {