radioapp/radiouiengine/src/radiostationmodel_p.cpp
changeset 28 075425b8d9a4
parent 24 6df133bd92e1
child 32 189d20c34778
equal deleted inserted replaced
24:6df133bd92e1 28:075425b8d9a4
    32 
    32 
    33 // Constants
    33 // Constants
    34 /**
    34 /**
    35  * Timeout period for checking if station is sending dynamic PS in milliseconds
    35  * Timeout period for checking if station is sending dynamic PS in milliseconds
    36  */
    36  */
    37 const int KDynamicPsCheckTimeout = 10 * 1000;
    37 const int DYNAMIC_PS_CHECK_TIMEOUT = 10 * 1000;
    38 
    38 
    39 /*!
    39 /*!
    40  *
    40  *
    41  */
    41  */
    42 RadioStationModelPrivate::RadioStationModelPrivate( RadioStationModel* model,
    42 RadioStationModelPrivate::RadioStationModelPrivate( RadioStationModel* model,
    44     q_ptr( model ),
    44     q_ptr( model ),
    45     mUiEngine( uiEngine ),
    45     mUiEngine( uiEngine ),
    46     mCurrentStation( &mManualStation ),
    46     mCurrentStation( &mManualStation ),
    47     mDynamicPsTimer( new QTimer() )
    47     mDynamicPsTimer( new QTimer() )
    48 {
    48 {
    49     connectAndTest( mDynamicPsTimer.data(), SIGNAL(timeout()),
    49     Radio::connect( mDynamicPsTimer.data(), SIGNAL(timeout()),
    50                     q_ptr,                  SLOT(dynamicPsCheckEnded()) );
    50                     q_ptr,                  SLOT(dynamicPsCheckEnded()) );
    51     mDynamicPsTimer->setInterval( KDynamicPsCheckTimeout );
    51     mDynamicPsTimer->setInterval( DYNAMIC_PS_CHECK_TIMEOUT );
    52     mDynamicPsTimer->setSingleShot( true );
    52     mDynamicPsTimer->setSingleShot( true );
    53 }
    53 }
    54 
    54 
    55 /*!
    55 /*!
    56  *
    56  *
    94     }
    94     }
    95 
    95 
    96     Q_Q( RadioStationModel );
    96     Q_Q( RadioStationModel );
    97     if ( oldStation && oldStation->isValid() ) {
    97     if ( oldStation && oldStation->isValid() ) {
    98         q->emitDataChanged( *oldStation );
    98         q->emitDataChanged( *oldStation );
       
    99         q->emitDataChanged( *mCurrentStation );
    99     }
   100     }
   100 }
   101 }
   101 
   102 
   102 /*!
   103 /*!
   103  * \reimp
   104  * \reimp
   308     mStations.insert( station.frequency(), station );
   309     mStations.insert( station.frequency(), station );
   309 
   310 
   310     if ( persistentSave ) {
   311     if ( persistentSave ) {
   311         const bool success = mPresetStorage->savePreset( *station.data_ptr() );
   312         const bool success = mPresetStorage->savePreset( *station.data_ptr() );
   312         RADIO_ASSERT( success, "RadioStationModelPrivate::saveStation", "Failed to add station" );
   313         RADIO_ASSERT( success, "RadioStationModelPrivate::saveStation", "Failed to add station" );
       
   314         Q_UNUSED( success );
   313     }
   315     }
   314 }
   316 }
   315 
   317 
   316 /*!
   318 /*!
   317  *
   319  *