diff -r 000000000000 -r a2952bb97e68 mmappcomponents/harvester/server/src/mpxfsformatmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/harvester/server/src/mpxfsformatmonitor.cpp Thu Dec 17 08:55:47 2009 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File System format monitor +* +*/ + + +#include +#include +#ifdef RD_MULTIPLE_DRIVE +#include +#endif //RD_MULTIPLE_DRIVE +#include +#include "mpxfsformatmonitor.h" + +#ifdef RD_MULTIPLE_DRIVE + static const TInt KDriveCount = 2; +#else + static const TInt KDriveCount = 1; +#endif + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Default Constructor +// --------------------------------------------------------------------------- +// +CMPXFsFormatMonitor::CMPXFsFormatMonitor( MMPXSystemEventObserver& aObserver ) : + iObserver( aObserver ) + { + + } + + +// --------------------------------------------------------------------------- +// Second Phase Constructor +// --------------------------------------------------------------------------- +// +void CMPXFsFormatMonitor::ConstructL() + { + MPX_DEBUG1(_L("CMPXFsFormatMonitor::ConstructL <---")); + + iBackupSession = CBaBackupSessionWrapper::NewL(); + iBackupSession->RegisterBackupOperationObserverL( *this ); + + TInt drive = EDriveE; + for(TInt i=0; i")); + } + + +// --------------------------------------------------------------------------- +// Two-Phased Constructor +// --------------------------------------------------------------------------- +// +CMPXFsFormatMonitor* CMPXFsFormatMonitor::NewL + ( MMPXSystemEventObserver& aObserver ) + { + CMPXFsFormatMonitor* self = CMPXFsFormatMonitor::NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Two-Phased Constructor +// --------------------------------------------------------------------------- +// +CMPXFsFormatMonitor* CMPXFsFormatMonitor::NewLC + ( MMPXSystemEventObserver& aObserver ) + { + CMPXFsFormatMonitor* self = new( ELeave ) CMPXFsFormatMonitor( aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +// +CMPXFsFormatMonitor::~CMPXFsFormatMonitor() + { + iBackupDrives.Close(); + + if( iBackupSession ) + { + iBackupSession->DeRegisterBackupOperationObserver( *this ); + } + delete iBackupSession; + } + +// --------------------------------------------------------------------------- +// Checks the current status +// --------------------------------------------------------------------------- +// +void CMPXFsFormatMonitor::PollStatus() + { + TBool aFormatting = iBackupSession->IsBackupOperationRunning(); + if( aFormatting ) + { + for(TInt i=0; i")); + }