Revision: 201015
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:24:32 +0300
changeset 21 c707676bf59f
parent 18 7d11f9a6646f
child 22 689bac7da8bd
child 24 408f75ba5bc2
Revision: 201015 Kit: 201018
deviceupdatesui/deviceupdates/inc/nsmldmdef.h
deviceupdatesui/deviceupdates/inc/nsmldmsyncprofile.h
deviceupdatesui/deviceupdates/inc/settingsdataformcustomitem.h
deviceupdatesui/deviceupdates/src/nsmldmsyncprofile.cpp
deviceupdatesui/deviceupdates/src/serversettingsview.cpp
deviceupdatesui/deviceupdates/src/settingsdataformcustomitem.cpp
--- a/deviceupdatesui/deviceupdates/inc/nsmldmdef.h	Fri Apr 16 14:53:31 2010 +0300
+++ b/deviceupdatesui/deviceupdates/inc/nsmldmdef.h	Mon May 03 12:24:32 2010 +0300
@@ -69,7 +69,7 @@
 _LIT( KSlash,       "/" );
 _LIT( KSmlEOL,      "\n" );
 _LIT( KNSmlTab,     "\t" );
-
+_LIT( KBackSlash,       "\\" );
 _LIT( KZDrive, "z:" );
 
 #ifdef __SCALABLE_ICONS
--- a/deviceupdatesui/deviceupdates/inc/nsmldmsyncprofile.h	Fri Apr 16 14:53:31 2010 +0300
+++ b/deviceupdatesui/deviceupdates/inc/nsmldmsyncprofile.h	Mon May 03 12:24:32 2010 +0300
@@ -24,7 +24,7 @@
 #include <e32base.h>
 #include <SyncMLClient.h>
 #include <SyncMLClientDM.h>
-#include "NSmlDMdef.h"
+#include "nsmldmdef.h"
 
 //#include "NSmlDMSyncApp.h"
 
@@ -260,6 +260,16 @@
         */
         void SetHostAddressL( const TDesC& aText, const TInt aPort );
         
+        
+        /**
+         * converts backslash in host address to forward slash 
+         * @param aUrl host address with out backslash
+         * @param aModifiedUrl host address with out backslash
+         * @return None
+         */
+        void convertBackslashinUrl( const TDesC& aUrl, TDes& aModifiedUrl );
+        
+        
         /**
 		* Get port number 
         * @param None
--- a/deviceupdatesui/deviceupdates/inc/settingsdataformcustomitem.h	Fri Apr 16 14:53:31 2010 +0300
+++ b/deviceupdatesui/deviceupdates/inc/settingsdataformcustomitem.h	Mon May 03 12:24:32 2010 +0300
@@ -30,6 +30,7 @@
     ~SettingsDataFormCustomItem();
 
     virtual HbAbstractViewItem* createItem();
+     bool canSetModelIndex( const QModelIndex& aIndex ) const; 
 
 protected:
     virtual HbWidget* createCustomWidget();
--- a/deviceupdatesui/deviceupdates/src/nsmldmsyncprofile.cpp	Fri Apr 16 14:53:31 2010 +0300
+++ b/deviceupdatesui/deviceupdates/src/nsmldmsyncprofile.cpp	Mon May 03 12:24:32 2010 +0300
@@ -617,14 +617,17 @@
     	{
     	return;
     	}
+    TBuf<KBufSize256> newUrl;
+    convertBackslashinUrl(aText,newUrl);
+    
 	if (BearerType() != EAspBearerInternet)
 		{
 		// port number handling is for internet bearer only 
-		TUtil::StrCopy(iBuf, aText); 
+		TUtil::StrCopy(iBuf, newUrl); 
 		}
 	else
 		{
-		TURIParser parser(aText);
+		TURIParser parser(newUrl);
 	    parser.GetUri(iBuf, aPort);
 		}
 	
@@ -632,6 +635,23 @@
 	iConnection.SetServerURIL( iBuf8 );
 	}
 
+void CNSmlDMSyncProfile::convertBackslashinUrl(const TDesC& aUrl, TDes& aModifiedUrl )
+    {    
+    TBuf<KBufSize16> backSlash(KBackSlash);  
+    TBuf<KBufSize16> forwardSlash(KSlash);
+    for (TInt i = 0; i < aUrl.Length(); i++)
+        {
+        TChar ch = aUrl[i];        
+        if (ch == backSlash[0] )
+            {
+            aModifiedUrl.Append(forwardSlash[0]);
+            }
+        else
+            {
+            aModifiedUrl.Append(ch);
+            }
+        }   
+    }
 // -----------------------------------------------------------------------------
 // CNSmlDMSyncProfile::GetUserNameL
 // -----------------------------------------------------------------------------
--- a/deviceupdatesui/deviceupdates/src/serversettingsview.cpp	Fri Apr 16 14:53:31 2010 +0300
+++ b/deviceupdatesui/deviceupdates/src/serversettingsview.cpp	Mon May 03 12:24:32 2010 +0300
@@ -42,8 +42,10 @@
         {
         //custom prototype    
         form = new HbDataForm();
+        QList <HbAbstractViewItem*> protos = form->itemPrototypes();
         customPrototype = new SettingsDataFormCustomItem(form);
-        form->setItemPrototype(customPrototype);        
+        protos.append(customPrototype);
+        form->setItemPrototypes(protos);
         dataformmodel =  new HbDataFormModel();    
         makeviewItemsVisible(header);
         form->setModel(dataformmodel); 
--- a/deviceupdatesui/deviceupdates/src/settingsdataformcustomitem.cpp	Fri Apr 16 14:53:31 2010 +0300
+++ b/deviceupdatesui/deviceupdates/src/settingsdataformcustomitem.cpp	Mon May 03 12:24:32 2010 +0300
@@ -57,3 +57,9 @@
             return 0;
     }
 }
+
+ bool SettingsDataFormCustomItem::canSetModelIndex( const QModelIndex& aIndex ) const
+ {
+     int itemType = aIndex.data(HbDataFormModelItem::ItemTypeRole).toInt();
+     return itemType == HbDataFormModelItem::CustomItemBase;
+ }