qtinternetradio/irdb/src/irdbwrapper.cpp
changeset 17 38bbf2dcd608
parent 16 5723da102db1
--- a/qtinternetradio/irdb/src/irdbwrapper.cpp	Fri Sep 17 08:27:59 2010 +0300
+++ b/qtinternetradio/irdb/src/irdbwrapper.cpp	Mon Oct 04 00:07:46 2010 +0300
@@ -132,7 +132,8 @@
                                 QString& insSqlStr, 
                                 QString& updSqlStr,
                                 const logoMap* const logoData,
-                                QList<QByteArray>* logoArrayList)
+                                QList<QByteArray>* logoArrayList,
+                                int* logoType)
 {
     bool bContinue = false;
     columnMap::const_iterator it;
@@ -140,6 +141,7 @@
     QString escStr;
     insSqlStr += "(";
     
+    
     if(NULL != RowData)
     {
         bContinue = true;
@@ -159,6 +161,14 @@
     
     if(NULL != logoData)
     {
+        if(logoType)
+        {
+            *logoType = 0x00; //
+        }
+        else
+        {
+            return;
+        }
         itLogoMap = logoData->begin();
         while(itLogoMap != logoData->end())
         {
@@ -166,7 +176,15 @@
             {
                      insSqlStr += ",";  
             }
- 
+            if(bLogo ==itLogoMap.key())
+            {
+                *logoType += IRDB_BIG_LOGO;
+            }
+            if(sLogo ==itLogoMap.key())
+            {
+                *logoType += IRDB_SMALL_LOGO;
+            }
+             
             insSqlStr += colNameLogo[itLogoMap.key()];
             ++itLogoMap;        
         }
@@ -195,6 +213,7 @@
 
     if(NULL != logoData)
     {
+      
         itLogoMap = logoData->begin();
         while(itLogoMap != logoData->end())
         {
@@ -202,6 +221,7 @@
             {
                  insSqlStr += ",";  
             }
+            
             insSqlStr = insSqlStr + " :"+colNameLogo[itLogoMap.key()];
             *logoArrayList<<itLogoMap.value();
 
@@ -239,6 +259,7 @@
     
     if(NULL != logoData)
     {
+
         itLogoMap = logoData->begin();
         while(itLogoMap != logoData->end())
         {
@@ -247,7 +268,7 @@
                  updSqlStr += ",";  
             }
 
-            updSqlStr = updSqlStr + colNameLogo[itLogoMap.key()] + "=:"+colNameLogo[itLogoMap.key()];
+            updSqlStr = updSqlStr + colNameLogo[itLogoMap.key()] + "=:"+colNameLogo[itLogoMap.key()] + " ";
             ++itLogoMap;        
         }
     }    
@@ -264,6 +285,7 @@
 {
     bool bDone = false;
     columnMap::const_iterator it;
+    QString escStr;
     
     if(NULL != condAND)
     {
@@ -279,8 +301,9 @@
                 {
                     condSqlStr += " AND ";
                 }
-                
-                condSqlStr = condSqlStr + pArryColName[it.key()] + "=" + "'" + it.value()+ "'" ;
+                escStr = it.value();
+                escStr.replace('\'', "\'\'");
+                condSqlStr = condSqlStr + pArryColName[it.key()] + "=" + "'" + escStr + "'" ;
                     
                 ++it;
             }
@@ -307,7 +330,8 @@
                 {
                     condSqlStr += " OR ";
                 }
-                
+                escStr = it.value();
+                escStr.replace('\'', "\'\'");
                 condSqlStr = condSqlStr + pArryColName[it.key()] + "=" + "'" + it.value()+ "'" ;
                 ++it;
              }