secureswitools/swisistools/source/dbmanager/dblayer.cpp
changeset 67 3a625661d1ce
parent 60 245df5276b97
child 76 f36d4ce8961e
--- a/secureswitools/swisistools/source/dbmanager/dblayer.cpp	Wed Aug 18 09:55:45 2010 +0300
+++ b/secureswitools/swisistools/source/dbmanager/dblayer.cpp	Thu Sep 02 20:34:03 2010 +0300
@@ -21,7 +21,7 @@
 #include "logs.h"
 #include "util.h"
 #include "symbiantypes.h"
-#include "../sisxlibrary/utility.h"
+#include "utility.h"
 
 #include <string>
 #include <vector>
@@ -680,6 +680,8 @@
 
 	//Assigning Default Values
 	TInt64 intVal = 0; 
+	stmtAppAttribute->BindInt64(1, intVal); //AppUid
+	stmtAppAttribute->BindInt64(4, intVal); //TypeId
 	stmtAppAttribute->BindInt64(5, intVal); //Attributes
 	stmtAppAttribute->BindInt64(6, intVal); //Hidden
 	stmtAppAttribute->BindInt64(7, intVal); //Embeddable
@@ -687,6 +689,7 @@
 	stmtAppAttribute->BindInt64(9, intVal); //Launch
 	stmtAppAttribute->BindInt64(11, intVal); //DefaultScreenNumber
 	std::wstring strVal(L"");
+	stmtAppAttribute->BindStr(3, strVal);  //AppFile
 	stmtAppAttribute->BindStr(10, strVal); //GroupName
 	
 	int appUid = 0;
@@ -854,15 +857,22 @@
 	//Assigning default value
 	TInt64 intVal = 0;
 	stmtAppLocalizableInfo->BindInt64(4, intVal); //Locale
+	stmtAppLocalizableInfo->BindInt64(5, intVal); //CaptionAndIconId
 	std::wstring strVal(L"");
-	stmtAppLocalizableInfo->BindStr(2, strVal); //ShortCaption
-	stmtAppLocalizableInfo->BindStr(3, strVal); //GroupName
-
+	stmtAppLocalizableInfo->BindStr(2, strVal);   //ShortCaption
+	stmtAppLocalizableInfo->BindStr(3, strVal);   //GroupName
+	
 	std::string insertCaptionAndIconInfo;
 		
 	insertCaptionAndIconInfo = "INSERT INTO CaptionAndIconInfo(Caption,NumberOfIcons,IconFile) VALUES(?,?,?);";
 	std::auto_ptr<CStatement> stmtCaptionAndIconInfo(iScrDbHandler->PrepareStatement(insertCaptionAndIconInfo));
 
+	//Assigning default value
+	stmtCaptionAndIconInfo->BindStr(1, strVal);   //Caption
+	stmtCaptionAndIconInfo->BindInt64(2, intVal); //NumberOfIcons
+	stmtCaptionAndIconInfo->BindStr(3, strVal);   //IconFile
+
+
 	bool captionAndIconInfoPresent = 0;
 	//for every TLocalizableAttribute
 	stmtAppLocalizableInfo->BindInt64(1, aAppUid);
@@ -938,16 +948,22 @@
 	insertViewData = "INSERT INTO ViewData(LocalAppInfoId,Uid,ScreenMode,CaptionAndIconId) VALUES(?,?,?,?);";
 	std::auto_ptr<CStatement> stmtViewData(iScrDbHandler->PrepareStatement(insertViewData));
 
+
+	//Assigning Default Value
+	TInt64 intVal = 0;
+	stmtViewData->BindInt64(2, intVal); //Uid
+	stmtViewData->BindInt64(3, intVal); //ScreenMode
+	stmtViewData->BindInt64(4, intVal); //CaptionAndIconId
+
 	std::string insertCaptionAndIconInfo;
 		
 	insertCaptionAndIconInfo = "INSERT INTO CaptionAndIconInfo(Caption,NumberOfIcons,IconFile) VALUES(?,?,?);";
 	std::auto_ptr<CStatement> stmtCaptionAndIconInfo(iScrDbHandler->PrepareStatement(insertCaptionAndIconInfo));
 
 	//Assigning Default Value
-	TInt64 intVal = 0;
-	stmtViewData->BindInt64(3, intVal); //ScreenMode
 	stmtCaptionAndIconInfo->BindInt64(2, intVal); //NumberOfIcons
 	std::wstring strVal(L"");
+	stmtCaptionAndIconInfo->BindStr(1, strVal); //Caption
 	stmtCaptionAndIconInfo->BindStr(3, strVal); //IconFile
 
 	bool captionAndIconInfoPresent = 0;
@@ -1020,9 +1036,10 @@
 
 		if(appPropertyIter->iIsStr8Bit)
 			{
-				std::string str = wstring2string(appPropertyIter->iStrValue);
-				std::string decodedString = Util::Base64Decode(str);
-				stmtAppProperty->BindBinary(6, decodedString);
+				std::string str;
+				int len = appPropertyIter->iStrValue.length();
+				str.assign(appPropertyIter->iStrValue.c_str(),appPropertyIter->iStrValue.c_str()+len);
+				stmtAppProperty->BindBinary(6, str);
 			}
 		else
 			{