camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/xqsettingsmanager.cpp
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 2010 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 /*!
       
    19 * XQSettingsManager class fake implementation
       
    20 */
       
    21 
       
    22 #include <QVariant>
       
    23 #include <QList>
       
    24 #include <QMetaType>
       
    25 #include <QObject>
       
    26 
       
    27 #include "xqsettingsmanager.h"
       
    28 #include "xqsettingskey.h"
       
    29 #include "cxenamespace.h"
       
    30 #include "cxutils.h"
       
    31 
       
    32 
       
    33 
       
    34 
       
    35 /*!
       
    36 * write value to cenrep key
       
    37 */
       
    38 bool XQSettingsManager::writeItemValue(const XQSettingsKey& key, const QVariant& value)
       
    39 {
       
    40     CX_DEBUG_ENTER_FUNCTION();
       
    41 
       
    42     mError = XQSettingsManager::NoError;
       
    43     mStore[key.key()] = value;
       
    44 
       
    45     CX_DEBUG_EXIT_FUNCTION();
       
    46     return true;
       
    47 }
       
    48 
       
    49 
       
    50 
       
    51 /*!
       
    52 * Reads the setting value for the given key from cenrep
       
    53 */
       
    54 QVariant XQSettingsManager::readItemValue(const XQSettingsKey& settkey, XQSettingsManager::Type /*type*/)
       
    55 {
       
    56     CX_DEBUG_ENTER_FUNCTION();
       
    57     mError = XQSettingsManager::NoError;
       
    58     if(mStore.contains(settkey.key())) {
       
    59         return mStore[settkey.key()];
       
    60     }
       
    61     return QVariant(1);
       
    62 }
       
    63 
       
    64 
       
    65 XQSettingsManager::Error XQSettingsManager::error() const
       
    66 {
       
    67     return mError;
       
    68 }
       
    69 
       
    70 
       
    71 /*!
       
    72 * XQSettingsManager::XQSettingsManager
       
    73 */
       
    74 XQSettingsManager::XQSettingsManager(QObject* /*parent*/)
       
    75 {
       
    76 }
       
    77 
       
    78 
       
    79 
       
    80 /*!
       
    81 * XQSettingsManager::close
       
    82 */
       
    83 XQSettingsManager::~XQSettingsManager()
       
    84 {
       
    85 }
       
    86 
       
    87 
       
    88 /*! Instead of monitoring value changes for a P&S key 
       
    89 *   this fake class implementation emits valueChanged signal for the given key
       
    90 */
       
    91 bool XQSettingsManager::startMonitoring(const XQSettingsKey& key, XQSettingsManager::Type type)
       
    92 {
       
    93     emit valueChanged(key, type);
       
    94     return true;
       
    95 }
       
    96 
       
    97 // end of file