camerauis/cameraxui/cxengine/src/cxefeaturemanagerimp.cpp
changeset 46 c826656d6714
parent 19 d9aefe59d544
equal deleted inserted replaced
42:feebad15db8c 46:c826656d6714
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    21 #include <QCoreApplication>
    21 #include <QCoreApplication>
    22 #include <QVariant>
    22 #include <QVariant>
    23 #include <QList>
    23 #include <QList>
    24 #include <QMetaType>
    24 #include <QMetaType>
    25 
    25 
    26 #include "cxesettingsmodel.h"
    26 #include "cxesettings.h"
    27 #include "cxefeaturemanagerimp.h"
    27 #include "cxefeaturemanagerimp.h"
    28 #include "cxutils.h"
    28 #include "cxutils.h"
    29 #include "cxeerror.h"
    29 #include "cxeerror.h"
    30 
    30 
    31 
    31 
    32 /*
    32 /*!
    33 * CxeFeatureManagerImp::isFeatureSupported
    33 * Returns if a feature is supported or not
       
    34 * @param key Feature key
       
    35 * @param supported Returned boolean to indicate whether feature is supported or not
       
    36 * @return Error code
    34 */
    37 */
    35 CxeError::Id CxeFeatureManagerImp::isFeatureSupported(const QString& key, bool& supported) const
    38 CxeError::Id CxeFeatureManagerImp::isFeatureSupported(const QString& key, bool& supported) const
    36 {
    39 {
    37     CX_DEBUG_ENTER_FUNCTION();
    40     CX_DEBUG_ENTER_FUNCTION();
    38 
    41 
    39     QVariant value;
    42     QVariant value;
    40     CxeError::Id err = mSettingsModel.getRuntimeValue(key, value);
    43     CxeError::Id err = mSettings.getVariationValue(key, value);
    41     if (err == CxeError::None) {
    44     if (err == CxeError::None) {
    42         QList<QVariant> values = qVariantValue<QList<QVariant> >(value);
    45         QList<QVariant> values = qVariantValue<QList<QVariant> >(value);
    43         supported = values[0].toInt();
    46         supported = values[0].toInt();
    44     } else {
    47     } else {
    45         supported = false;
    48         supported = false;
    50     return err;
    53     return err;
    51 }
    54 }
    52 
    55 
    53 
    56 
    54 
    57 
    55 /*
    58 /*!
    56 * CxeFeatureManagerImp::configuredValues
    59 * Retrieves all the configured values for the given key
       
    60 * @param key Feature key
       
    61 * @param values Returned values
       
    62 * @return Error code
    57 */
    63 */
    58 CxeError::Id CxeFeatureManagerImp::configuredValues(const QString& key,QList<int>& values)
    64 CxeError::Id CxeFeatureManagerImp::configuredValues(const QString& key,QList<int>& values)
    59 {
    65 {
    60     CX_DEBUG_ENTER_FUNCTION();
    66     CX_DEBUG_ENTER_FUNCTION();
    61 
    67 
    62     values.clear();
    68     values.clear();
    63 
    69 
    64     QVariant variant;
    70     QVariant variant;
    65     CxeError::Id err = mSettingsModel.getRuntimeValue(key, variant);
    71     CxeError::Id err = mSettings.getVariationValue(key, variant);
    66 
    72 
    67     if(CxeError::None == err) {
    73     if(CxeError::None == err) {
    68         QVariantList list;
    74         QVariantList list;
    69         list = qVariantValue<QVariantList>(variant);
    75         list = qVariantValue<QVariantList>(variant);
    70 
    76 
    92 
    98 
    93 
    99 
    94 /*
   100 /*
    95 *CxeFeatureManagerImp::CxeFeatureManagerImp
   101 *CxeFeatureManagerImp::CxeFeatureManagerImp
    96 */
   102 */
    97 CxeFeatureManagerImp::CxeFeatureManagerImp(CxeSettingsModel& settingsModel)
   103 CxeFeatureManagerImp::CxeFeatureManagerImp(CxeSettings &settings)
    98 : mSettingsModel(settingsModel)
   104 : mSettings(settings)
    99 {
   105 {
   100     CX_DEBUG_ENTER_FUNCTION();
   106     CX_DEBUG_ENTER_FUNCTION();
   101     CX_DEBUG_EXIT_FUNCTION();
   107     CX_DEBUG_EXIT_FUNCTION();
   102 }
   108 }
   103 
   109