videocollection/tsrc/stubs/src/xqsettingsmanagerstub.cpp
branchRCL_3
changeset 56 839377eedc2b
equal deleted inserted replaced
54:315810614048 56:839377eedc2b
       
     1 /**
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "xqsettingsmanagerstub.h"
       
    19 
       
    20 int XQSettingsManager::mReadItemSucceedCounter = 0;
       
    21 int XQSettingsManager::mWriteItemSucceedCounter = 0;
       
    22 QHash<int, QVariant> XQSettingsManager::mWrittenValueHash = QHash<int, QVariant>();
       
    23 
       
    24 QVariant XQSettingsManager::readItemValue(XQCentralRepositorySettingsKey &key, int type)
       
    25 {
       
    26     Q_UNUSED(type);
       
    27     mReadItemSucceedCounter--;
       
    28     if(mReadItemSucceedCounter >= 0)
       
    29     {
       
    30         return mWrittenValueHash.value(key.mKey);
       
    31     }
       
    32     return QVariant();
       
    33 }
       
    34 
       
    35 bool XQSettingsManager::writeItemValue(const XQCentralRepositorySettingsKey& key, const QVariant& value)
       
    36 {
       
    37     mWriteItemSucceedCounter--;
       
    38     if(mWriteItemSucceedCounter >= 0)
       
    39     {
       
    40         mWrittenValueHash.insert(key.mKey, value);
       
    41         return true;
       
    42     }    
       
    43     return false;
       
    44 }
       
    45 
       
    46 XQSettingsManager::XQSettingsManager()
       
    47 {
       
    48     
       
    49 }
       
    50 
       
    51 XQSettingsManager::~XQSettingsManager()
       
    52 {
       
    53 }