radioapp/radioenginewrapper/src/radiosettings_p.cpp
changeset 23 a2b50a479edf
parent 19 afea38384506
child 24 6df133bd92e1
equal deleted inserted replaced
19:afea38384506 23:a2b50a479edf
     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 "radiosettings.h"
       
    19 #include "radiosettings_p.h"
       
    20 #include "mradioapplicationsettings.h"
       
    21 
       
    22 
       
    23 /*!
       
    24  *
       
    25  */
       
    26 RadioSettingsPrivate::RadioSettingsPrivate( RadioSettings* settingsPublic ) :
       
    27     q_ptr( settingsPublic ),
       
    28     mFlags( 0 )
       
    29 {
       
    30 }
       
    31 
       
    32 /*!
       
    33  *
       
    34  */
       
    35 RadioSettingsPrivate::~RadioSettingsPrivate()
       
    36 {
       
    37 }
       
    38 
       
    39 /*!
       
    40  *
       
    41  */
       
    42 void RadioSettingsPrivate::init( MRadioApplicationSettings* storage )
       
    43 {
       
    44     mSettingsStorage = storage;
       
    45     if ( mSettingsStorage ) {
       
    46         mFlags = Toggles( mSettingsStorage->UiFlags() );
       
    47     }
       
    48 }
       
    49 
       
    50 /*!
       
    51  *
       
    52  */
       
    53 bool RadioSettingsPrivate::isFirstTimeStart()
       
    54 {
       
    55     if ( mSettingsStorage ) {
       
    56         return mSettingsStorage->UpdateStartCount() == 0;
       
    57     }
       
    58     return false;
       
    59 }
       
    60 
       
    61 /*!
       
    62  *
       
    63  */
       
    64 bool RadioSettingsPrivate::isFlagSet( ToggleFlag flag ) const
       
    65 {
       
    66     return mFlags.testFlag( flag );
       
    67 }
       
    68 
       
    69 /*!
       
    70  *
       
    71  */
       
    72 void RadioSettingsPrivate::toggleFlag( ToggleFlag flag )
       
    73 {
       
    74     mFlags ^= flag;
       
    75 }
       
    76 
       
    77 /*!
       
    78  *
       
    79  */
       
    80 void RadioSettingsPrivate::saveFlags()
       
    81 {
       
    82     if ( mSettingsStorage ) {
       
    83         mSettingsStorage->SetUiFlags( mFlags );
       
    84     }
       
    85 }