Index: scandialog.cpp =================================================================== --- scandialog.cpp (revision 659295) +++ scandialog.cpp (working copy) @@ -650,6 +650,19 @@ chan->name = name; } +bool ScanDialog::checkChannUpdate( ChannelDesc *chan ) +{ + int i; + for ( i=0; i<(int)chandesc->count(); i++ ) { + if (chan->sid == chandesc->at(i)->sid && chan->tp.tsid == chandesc->at(i)->tp.tsid && chan->tp.source == chandesc->at(i)->tp.source && chan->vpid == chandesc->at(i)->vpid) { + chan->category=chandesc->at(i)->category; + chan->num=chandesc->at(i)->num; + chandesc->replace(i,new ChannelDesc(*chan)); + return false; + } + } + return true; +} void ScanDialog::addSelected() @@ -670,24 +683,25 @@ dit = (DListViewItem*)dit->nextSibling(); continue; } + if(checkChannUpdate(chan)){ + checkDuplicateName( chan ); - checkDuplicateName( chan ); - - chan->num = chandesc->count()+1; - chandesc->append( new ChannelDesc( *chan ) ); - it = new QListViewItem( channelsList, chan->name ); - if ( chan->type==1 ) { - if ( chan->fta ) - it->setPixmap( 0, tvcPix ); - else - it->setPixmap( 0, tvPix ); + chan->num = chandesc->count()+1; + chandesc->append( new ChannelDesc( *chan ) ); + it = new QListViewItem( channelsList, chan->name ); + if ( chan->type==1 ) { + if ( chan->fta ) + it->setPixmap( 0, tvcPix ); + else + it->setPixmap( 0, tvPix ); + } + else { + if ( chan->fta ) + it->setPixmap( 0, racPix ); + else + it->setPixmap( 0, raPix ); + } } - else { - if ( chan->fta ) - it->setPixmap( 0, racPix ); - else - it->setPixmap( 0, raPix ); - } odit = dit; dit = (DListViewItem*)dit->nextSibling(); delete odit; @@ -775,25 +789,25 @@ dit = (DListViewItem*)dit->nextSibling(); continue; } + if(checkChannUpdate(chan)){ + checkDuplicateName( chan ); - checkDuplicateName( chan ); - - chan->num = chandesc->count()+1; - chandesc->append( new ChannelDesc( *chan ) ); - it = new QListViewItem( channelsList, chan->name ); - if ( chan->type==1 ) { - if ( chan->fta ) - it->setPixmap( 0, tvcPix ); - else - it->setPixmap( 0, tvPix ); + chan->num = chandesc->count()+1; + chandesc->append( new ChannelDesc( *chan ) ); + it = new QListViewItem( channelsList, chan->name ); + if ( chan->type==1 ) { + if ( chan->fta ) + it->setPixmap( 0, tvcPix ); + else + it->setPixmap( 0, tvPix ); + } + else { + if ( chan->fta ) + it->setPixmap( 0, racPix ); + else + it->setPixmap( 0, raPix ); + } } - else { - if ( chan->fta ) - it->setPixmap( 0, racPix ); - else - it->setPixmap( 0, raPix ); - } - odit = dit; dit = (DListViewItem*)dit->nextSibling(); delete odit; Index: scandialog.h =================================================================== --- scandialog.h (revision 659295) +++ scandialog.h (working copy) @@ -86,6 +86,7 @@ void parseTp( QString s, fe_type_t type, QString src ); void addFound( ChannelDesc *chan, bool scan ); void checkDuplicateName( ChannelDesc *chan ); + bool checkChannUpdate( ChannelDesc *chan ); QPtrList *dvb; DvbStream *ds;