diff -r 000000000000 -r c53acadfccc6 harvester/monitorplugins/inc/fsutil.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/monitorplugins/inc/fsutil.inl Mon Jan 18 20:34:07 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2007-2009 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: Some generic utilities.* +*/ + + +#include "mdscommoninternal.h" +#include "mdeharvestersession.h" +#include + +inline TUint32 FSUtil::MediaID( const RFs& aFs, TInt aDrive ) + { + TVolumeInfo vi; + + TInt err = aFs.Volume(vi, aDrive); + if(err == KErrNone) + { + return vi.iUniqueID; + } + + return 0; + } + +inline TUint32 FSUtil::MediaID( const RFs& aFs, const TDesC& aUri ) + { + TInt drive = DriveNumber(aUri); + if(drive == -1) + { + return 0; + } + + return MediaID(aFs, drive); + } + +inline TUint32 FSUtil::GetPreviousMediaIDL( const CMdEHarvesterSession* aMdeSession, + TChar aDrive ) + { + RArray presentMedias; + CleanupClosePushL( presentMedias ); + CMdEHarvesterSession* sess = (CMdEHarvesterSession*) aMdeSession; + sess->GetPresentMediasL( presentMedias ); + + TUint32 mediaid = 0; + TInt count = presentMedias.Count(); + for( TInt i=0;i