diff -r 61bc0f252b2b -r bac7acad7cb3 camerauis/cameraxui/cxengine/inc/api/cxesettings.inl --- a/camerauis/cameraxui/cxengine/inc/api/cxesettings.inl Tue Aug 31 15:03:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// specializations for getters -// throwing versions -template<> -inline int CxeSettings::get(const QString &key) const { - QVariant v; - getValue(key, v); - return v.value(); -} - -template<> -inline bool CxeSettings::get(const QString &key) const { - QVariant v; - getValue(key, v); - return v.value(); -} - -template<> -inline qreal CxeSettings::get(const QString &key) const { - QVariant v; - getValue(key, v); - return v.value(); -} - -template<> -inline QString CxeSettings::get(const QString &key) const { - QVariant v; - getValue(key, v); - return v.value(); -} - -template<> -inline QVariantMap CxeSettings::get(const QString &key) const { - QVariant v; - getValue(key, v); - return v.value(); -} - -// non-throwing versions -template<> -inline int CxeSettings::get(const QString &key, const int &defaultValue) const { - try { - return get(key); - } catch (CxeException &e) { - return defaultValue; - } -} - -template<> -inline bool CxeSettings::get(const QString &key, const bool &defaultValue) const { - try { - return get(key); - } catch (CxeException &e) { - return defaultValue; - } -} - -template<> -inline qreal CxeSettings::get(const QString &key, const qreal &defaultValue) const { - try { - return get(key); - } catch (CxeException &e) { - return defaultValue; - } -} - -template<> -inline QString CxeSettings::get(const QString &key, const QString &defaultValue) const { - try { - return get(key); - } catch (CxeException &e) { - return defaultValue; - } -} - -template<> -inline QVariantMap CxeSettings::get(const QString &key, const QVariantMap &defaultValue) const { - try { - return get(key); - } catch (CxeException &e) { - return defaultValue; - } -} - -// specializations for setters -template<> -inline void CxeSettings::set(const QString &key, const int &value) { - QVariant v; - v.setValue(value); - setValue(key, v); -} - -template<> -inline void CxeSettings::set(const QString &key, const bool &value) { - QVariant v; - v.setValue(value); - setValue(key, v); -} - -template<> -inline void CxeSettings::set(const QString &key, const qreal &value) { - QVariant v; - v.setValue(value); - setValue(key, v); -} - -template<> -inline void CxeSettings::set(const QString &key, const QString &value) { - QVariant v; - v.setValue(value); - setValue(key, v); -} - -template<> -inline void CxeSettings::set(const QString &key, const QVariantMap &value) { - QVariant v; - v.setValue(value); - setValue(key, v); -}