sysstatemgmt/systemstateplugins/conditionevaluator/src/cndsystemwideproperty.cpp
changeset 63 09d657f1ee00
parent 0 4e1aa6a622a0
child 61 8cb079868133
equal deleted inserted replaced
54:072a9626b290 63:09d657f1ee00
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 /**
    18 /**
    19  @internalComponent
    19  @internalComponent
    20 */
    20 */
    21 
    21 
       
    22 #include "ssmdebug.h"
    22 #include "cndsystemwideproperty.h"
    23 #include "cndsystemwideproperty.h"
    23 #include <ssm/ssmsystemwideproperty.h>
    24 #include <ssm/ssmsystemwideproperty.h>
    24 
    25 
    25 CCndSwp::CCndSwp(const TConditionCheckType aConditionCheckType,
    26 CCndSwp::CCndSwp(const TConditionCheckType aConditionCheckType,
    26         			const TUint aKey, const TInt aCndValue): iConditionCheckType(aConditionCheckType),
    27         			const TUint aKey, const TInt aCndValue): iConditionCheckType(aConditionCheckType),
    46     {
    47     {
    47     TInt value = 0;
    48     TInt value = 0;
    48   
    49   
    49     RSsmSystemWideProperty property;
    50     RSsmSystemWideProperty property;
    50 	User::LeaveIfError(property.Connect(iKey));
    51 	User::LeaveIfError(property.Connect(iKey));
    51 	User::LeaveIfError(property.GetValue(value));
    52 	CleanupClosePushL(property);
    52 	property.Close();
    53 
       
    54 	SSMLOGLEAVEIFERROR(property.GetValue(value));
    53 	
    55 	
    54     TBool retVal = EFalse;
    56     TBool retVal = EFalse;
    55     if (iConditionCheckType == ECompareValue)
    57     if (iConditionCheckType == ECompareValue)
    56         {
    58         {
    57         retVal = (value == iCndValue);
    59         retVal = (value == iCndValue);
    58         }
    60         }
    59     else
    61     else
    60         {
    62         {
    61         retVal = ((value & iCndValue) == iCndValue);
    63         retVal = ((value & iCndValue) == iCndValue);
    62         }
    64         }
       
    65 
       
    66 	CleanupStack::PopAndDestroy(&property);
    63     return retVal;
    67     return retVal;
    64     }
    68     }