Show
Ignore:
Timestamp:
01/13/08 21:39:50 (11 months ago)
Author:
cyrusdaboo
Message:

Support for reading/writing preferences as a flat file on a WebDAV server. This is the final piece to
provide a full replacement for IMSP/ACAP via WebDAV technologies. Ultimately an XCAP-like solution
allowing partial reads/writes would be better but this is a good first step.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/branches/v4.1d1/Sources_Common/Mail/Protocols/COptionsProtocol.cp

    r19 r150  
    2323#include "CConnectionManager.h" 
    2424#include "CIMSPClient.h" 
     25#include "CLocalPrefsClient.h" 
    2526#include "CMulberryApp.h" 
    2627#include "COptionsClient.h" 
     
    2829#include "CPreferencesFile.h" 
    2930#include "CPreferenceKeys.h" 
    30 #include "CLocalPrefsClient.h" 
     31#include "CWebDAVPrefsClient.h" 
    3132 
    3233// COptionsProtocol: Handles quotas for all resources 
    3334 
    3435// Constructor 
    35 COptionsProtocol::COptionsProtocol(CINETAccount* account) 
     36COptionsProtocol::COptionsProtocol(COptionsAccount* account) 
    3637        : CINETProtocol(account) 
    3738{ 
     
    6970                switch(GetAccountType()) 
    7071                { 
     72                case CINETAccount::eWebDAVPrefs: 
     73                        mClient = new prefsstore::CWebDAVPrefsClient(this); 
     74                        mFlags.Set(eCanPartialReadWrite, false); 
     75                        break; 
    7176                case CINETAccount::eIMSP: 
    7277                        mClient = new CIMSPClient(this, NULL); 
     78                        mFlags.Set(eCanPartialReadWrite, true); 
    7379                        break; 
    7480                case CINETAccount::eACAP: 
    7581                        mClient = new CACAPClient(this, NULL); 
     82                        mFlags.Set(eCanPartialReadWrite, true); 
    7683                        break; 
    7784                default:; 
     
    8491                InitDisconnect(); 
    8592                mClient = new CLocalPrefsClient(this); 
     93                mFlags.Set(eCanPartialReadWrite, false); 
    8694        } 
    8795 
     
    101109bool COptionsProtocol::DoesPartialPrefs() const 
    102110{ 
    103         // Test if disconnected 
    104         return !IsOffline(); 
     111        // Test if partial read-write 
     112        return mFlags.IsSet(eCanPartialReadWrite); 
    105113} 
    106114