radioapp/radiouiengine/src/radiostationmodel.cpp
changeset 36 ba22309243a1
parent 34 bc10a61bd7d3
child 38 f8c3d4e6102c
equal deleted inserted replaced
35:de7c4a48dcb4 36:ba22309243a1
   177         RadioStation station;
   177         RadioStation station;
   178 
   178 
   179         RadioStationIf* stationInterface = static_cast<RadioStationIf*>( station.data_ptr() );
   179         RadioStationIf* stationInterface = static_cast<RadioStationIf*>( station.data_ptr() );
   180         if ( d->mPresetStorage->readPreset( index, *stationInterface ) ) {
   180         if ( d->mPresetStorage->readPreset( index, *stationInterface ) ) {
   181             if ( station.isValid() && d->mWrapper->isFrequencyValid( station.frequency() ) ) {
   181             if ( station.isValid() && d->mWrapper->isFrequencyValid( station.frequency() ) ) {
       
   182 
       
   183                 // Check if the station seems to send RDS or not.
       
   184                 // Note that radiotext is not checked because it is not saved to cenrep
       
   185                 // TODO: Consider saving this state flag to cenrep
       
   186                 if ( ( station.hasName() && !station.isRenamed() ) || station.hasUrl() ) {
       
   187                     static_cast<RadioStationIf*>( station.data_ptr() )->setStationHasSentRds( true );
       
   188                 }
       
   189 
   182                 d->mStations.insert( station.frequency(), station );
   190                 d->mStations.insert( station.frequency(), station );
   183             } else {
   191             } else {
   184                 LOG( "RadioStationModel::initialize: Invalid station!" );
   192                 LOG( "RadioStationModel::initialize: Invalid station!" );
   185                 LOG_FORMAT( "Invalid station freq: %d", station.frequency() );
   193                 LOG_FORMAT( "Invalid station freq: %d", station.frequency() );
   186             }
   194             }