omads/omadsextensions/adapters/notes/src/NSmlNotepadDataStore.cpp
changeset 38 1bb40c16ad33
parent 22 1a3f0bca12c6
child 41 e32446434994
child 54 13ecdfc9a581
--- a/omads/omadsextensions/adapters/notes/src/NSmlNotepadDataStore.cpp	Tue Jul 13 03:28:47 2010 +0530
+++ b/omads/omadsextensions/adapters/notes/src/NSmlNotepadDataStore.cpp	Tue Jul 13 03:31:55 2010 +0530
@@ -195,9 +195,8 @@
 		iDefaultStoreName = NULL;
 	    }
 	iDefaultStoreName = HBufC::NewL( KNSmlDefaultStoreNameMaxSize );
-	TInt len = iDefaultStoreName->Length();
-	TPtr obptr = iDefaultStoreName->Des();
-	iNpdDb->GetDefaultDatastoreName(obptr);
+	*iDefaultStoreName = KNSmlNotepadStoreName; 
+	
 	if(iOwnStoreFormat)
 	    {
 		delete iOwnStoreFormat;
@@ -232,9 +231,10 @@
 CDesCArray* CNSmlNotepadDataStore::DoListStoresLC()
 	{
 	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoListStoresLC(): begin");
-	CDesCArray* npdStores = iNpdDb->ListDatabasesL();
-	CleanupStack::PushL( npdStores );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoListStoresLC(): end");
+	CDesCArrayFlat *npdStores = new (ELeave)CDesCArrayFlat(1);
+    CleanupStack::PushL(npdStores);
+    npdStores->AppendL(KNSmlNotepadStoreName);
+    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoListStoresLC(): end");
 	return npdStores;
 	}
 	
@@ -247,10 +247,12 @@
 									MSmlSyncRelationship& aContext, 
 									TRequestStatus& aStatus )
     {
-	iCallerStatus = &aStatus;
+    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoOpenL(): begin");	
+    iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	if( iState != ENSmlClosed || iDataBaseOpened )
 	    {
+        
 		User::RequestComplete( iCallerStatus, KErrInUse );	
 		return;	
 	    }
@@ -264,7 +266,7 @@
 		
 	// Open the Database
 	TInt err( KErrNone );
-	TRAP(err,iNpdDb->OpenL( aStoreName ));
+	TRAP(err,iNpdDb->OpenL( KNSmlNotepadDefaultStoreName ));
 	if ( err )
         {
         User::RequestComplete( iCallerStatus, err );
@@ -276,7 +278,8 @@
         delete iOpenedStoreName;
         iOpenedStoreName = NULL;
         }
-    iOpenedStoreName = aStoreName.Alloc();
+    iOpenedStoreName = HBufC::NewL( KNSmlDefaultStoreNameMaxSize );
+    *iOpenedStoreName = KNSmlNotepadStoreName;
     
     iDataBaseOpened = ETrue;
 		
@@ -290,6 +293,7 @@
 	
 	err = FetchModificationsL();
 	
+	
 	iState = ENSmlOpenAndWaiting;	
 	User::RequestComplete( iCallerStatus, err );