bookmarksengine/browsercontentdll/src/browsercontentdll.cpp
changeset 6 aecf83d556aa
parent 3 9b96c4b50d96
child 9 1d51612454b5
child 13 8f58c9334c71
--- a/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp	Tue Jun 29 00:44:32 2010 -0400
+++ b/bookmarksengine/browsercontentdll/src/browsercontentdll.cpp	Fri Aug 06 17:21:45 2010 -0400
@@ -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)
         {