radiohswidget/stub/xqsettingsmanager.cpp
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     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:  XQSettingsManager stub for FM Radio home screen widget
       
    15 *               unit testing.
       
    16 *
       
    17 */
       
    18 
       
    19 // User includes
       
    20 #include "xqsettingsmanager.h"
       
    21 #include "radiologger.h"
       
    22 
       
    23 extern QVariant settings_manager_mock_return_profile;
       
    24 extern QVariant settings_manager_mock_return_2nd_profile;
       
    25 extern bool settings_manager_mock_bool_return;
       
    26 
       
    27 /*!
       
    28     \class XQSettingsManager
       
    29     \brief Stub implementation of XQSettingsManager for unit testing
       
    30 */
       
    31 
       
    32 // ======== MEMBER FUNCTIONS ========
       
    33 
       
    34 XQSettingsManager::XQSettingsManager(QObject* parent) : QObject(parent)
       
    35 {
       
    36     LOG_METHOD_ENTER;
       
    37 }
       
    38 
       
    39 XQSettingsManager::~XQSettingsManager()
       
    40 {
       
    41     LOG_METHOD_ENTER;
       
    42 }
       
    43 
       
    44 QVariant XQSettingsManager::readItemValue(const XQSettingsKey& key, XQSettingsManager::Type type)
       
    45 {
       
    46     LOG_METHOD_ENTER;
       
    47     Q_UNUSED(key);
       
    48     Q_UNUSED(type);
       
    49     return settings_manager_mock_return_profile;
       
    50 }
       
    51 
       
    52 bool XQSettingsManager::startMonitoring(const XQSettingsKey& key, XQSettingsManager::Type type)
       
    53 {
       
    54     LOG_METHOD_ENTER;
       
    55     // Set the 2nd startup mode.
       
    56     settings_manager_mock_return_profile = settings_manager_mock_return_2nd_profile;
       
    57     emit valueChanged(key, type);
       
    58     return settings_manager_mock_bool_return;
       
    59 }
       
    60 
       
    61 bool XQSettingsManager::stopMonitoring(const XQSettingsKey& key)
       
    62 {
       
    63     return true;
       
    64 }
       
    65