diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 8a2f6c4fc..a29e395c2 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -366,7 +366,7 @@ printf("CRemoteControl::handleMsg: EVT_TUNE_COMPLETE (%016llx)\n", chid); void CRemoteControl::getSubChannels() { //printf("[neutrino] getSubChannels, current_EPGid %llx\n", current_EPGid); - if ( subChannels.size() == 0 ) + if ( subChannels.empty() ) { CSectionsdClient::LinkageDescriptorList linkedServices; //if ( g_Sectionsd->getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices ) ) @@ -400,7 +400,7 @@ void CRemoteControl::getSubChannels() void CRemoteControl::getNVODs() { //printf("[neutrino] getNVODs, current_EPGid %llx\n", current_EPGid); - if ( subChannels.size() == 0 ) + if ( subChannels.empty() ) { CSectionsdClient::NVODTimesList NVODs; //if ( g_Sectionsd->getNVODTimesServiceKey( current_channel_id & 0xFFFFFFFFFFFFULL, NVODs ) ) @@ -630,15 +630,15 @@ const std::string & CRemoteControl::setSubChannel(const int numSub, const bool f const std::string & CRemoteControl::subChannelUp(void) { - //return setSubChannel((subChannels.size() == 0) ? -1 : (int)((selected_subchannel + 1) % subChannels.size())); + //return setSubChannel((subChannels.empty()) ? -1 : (int)((selected_subchannel + 1) % subChannels.size())); // if there are any NVOD/subchannels switch these else switch audio channel (if any) - if (subChannels.size() > 0 || !g_settings.audiochannel_up_down_enable) + if ( !subChannels.empty() || !g_settings.audiochannel_up_down_enable) { - return setSubChannel((subChannels.size() == 0) ? -1 : (int)((selected_subchannel + 1) % subChannels.size())); + return setSubChannel( subChannels.empty() ? -1 : (int)((selected_subchannel + 1) % subChannels.size())); } else { - if (current_PIDs.APIDs.size() > 0) + if ( !current_PIDs.APIDs.empty() ) { setAPID((current_PIDs.PIDs.selected_apid + 1) % current_PIDs.APIDs.size()); } @@ -650,13 +650,13 @@ const std::string & CRemoteControl::subChannelDown(void) { //return setSubChannel((selected_subchannel <= 0) ? (subChannels.size() - 1) : (selected_subchannel - 1)); // if there are any NVOD/subchannels switch these else switch audio channel (if any) - if (subChannels.size() > 0 || !g_settings.audiochannel_up_down_enable) + if ( !subChannels.empty() || !g_settings.audiochannel_up_down_enable) { return setSubChannel((selected_subchannel <= 0) ? (subChannels.size() - 1) : (selected_subchannel - 1)); } else { - if (current_PIDs.APIDs.size() > 0) + if ( !current_PIDs.APIDs.empty() ) { if (current_PIDs.PIDs.selected_apid <= 0) setAPID(current_PIDs.APIDs.size() - 1); diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 2104bf8c8..8b6083df6 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -1241,7 +1241,7 @@ void CLCD::showFilelist(int flist_pos,CFileList* flist,const char * const mainDi if (mode == MODE_FILEBROWSER && m_fileList != NULL && - m_fileList->size() > 0) + !m_fileList->empty() ) { printf("[lcdd] FileList:OK\n"); diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 8365837e5..a967ff0bc 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -538,7 +538,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 #endif while(1) { timer_id = 0; - if ( timers.size()> 0 ) + if ( !timers.empty() ) { #ifdef USE_GETTIMEOFDAY gettimeofday( &tv, NULL ); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 9ce51534b..51d7b69d6 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -522,7 +522,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis info2 = epgdata.info2; recMovieInfo->parentalLockAge = epgdata.fsk; - if(epgdata.contentClassification.size() > 0 ) + if( !epgdata.contentClassification.empty() ) recMovieInfo->genreMajor = epgdata.contentClassification[0]; recMovieInfo->length = epgdata.epg_times.dauer / 60; @@ -555,7 +555,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis } } /* FIXME sometimes no apid in xml ?? */ - if(recMovieInfo->audioPids.empty() && allpids.APIDs.size()) { + if(recMovieInfo->audioPids.empty() && !allpids.APIDs.empty()) { int i = 0; audio_pids.epgAudioPid = allpids.APIDs[i].pid; audio_pids.epgAudioPidName = g_RemoteControl->current_PIDs.APIDs[i].desc; @@ -791,7 +791,7 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons #if 1 // FIXME test StopSectionsd = false; - if(recmap.size()) + if( !recmap.empty() ) StopSectionsd = true; #endif RunStartScript(); @@ -922,7 +922,7 @@ void CRecordManager::StartNextRecording() for(nextmap_iterator_t it = nextmap.begin(); it != nextmap.end(); it++) { bool tested = true; eventinfo = *it; - if(recmap.size() > 0) { + if( !recmap.empty() ) { CRecordInstance * inst = FindInstance(eventinfo->channel_id); /* same channel recording and not auto - skip */ if(inst && !inst->Timeshift()) @@ -958,7 +958,7 @@ bool CRecordManager::RecordingStatus(const t_channel_id channel_id) CRecordInstance * inst = FindInstance(channel_id); ret = (inst != NULL); } else - ret = recmap.size() != 0; + ret = !recmap.empty(); mutex.unlock(); return ret; @@ -1464,7 +1464,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, const int mo last_mode = CNeutrinoApp::getInstance()->getMode(); - if(last_mode == NeutrinoMessages::mode_standby && !recmap.size()) + if(last_mode == NeutrinoMessages::mode_standby && recmap.empty()) g_Zapit->setStandby(false); // this zap to live_channel_id t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); @@ -1546,7 +1546,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, const int mo void CRecordManager::RestoreNeutrino(void) { - if(recmap.size()) + if(!recmap.empty()) return; /* after this zapit send EVT_RECORDMODE_DEACTIVATED, so neutrino getting NeutrinoMessages::EVT_RECORDMODE */ diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index b1348aa8a..e94d90fed 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -802,7 +802,7 @@ void CVFD::showFilelist(int flist_pos,CFileList* flist,const char * const mainDi if (mode == MODE_FILEBROWSER && m_fileList != NULL && - m_fileList->size() > 0) + !m_fileList->empty() ) { printf("[lcdd] FileList:OK\n"); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index dc4686d32..2759b8e82 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1825,7 +1825,7 @@ static bool addService(const SIservice &s, const int is_actual) mySIservicesOrderUniqueKey.insert(std::make_pair(sptr->uniqueKey(), sptr)); unlockServices(); - if (sptr->nvods.size()) + if (!sptr->nvods.empty()) { writeLockServices(); mySIservicesNVODorderUniqueKey.insert(std::make_pair(sptr->uniqueKey(), sptr)); @@ -2700,7 +2700,7 @@ bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSect { dprintf("NVODServices: %u\n", si->second->nvods.size()); - if (si->second->nvods.size()) { + if (!si->second->nvods.empty()) { for (SInvodReferences::iterator ni = si->second->nvods.begin(); ni != si->second->nvods.end(); ++ni) { SItime zeitEvt1(0, 0); findActualSIeventForServiceUniqueKey(ni->uniqueKey(), zeitEvt1, 15*60); diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 86035f753..47b48f627 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -581,7 +581,7 @@ int CAudioPlayerGui::show() //stop(); // Stop if song is deleted, next song will be startet automat. } if (m_selected >= m_playlist.size()) - m_selected = m_playlist.size() == 0 ? m_playlist.size() : m_playlist.size() - 1; + m_selected = m_playlist.empty() ? m_playlist.size() : m_playlist.size() - 1; update = true; } } @@ -2462,7 +2462,7 @@ void CAudioPlayerGui::removeFromPlaylist(long pos) item->second.erase(pos); // delete empty entries - if (item->second.size() == 0) + if (item->second.empty()) { m_title2Pos.erase(item); } @@ -2522,7 +2522,7 @@ void CAudioPlayerGui::selectTitle(unsigned char selectionChar) } else { - if (it->second.size() > 0) + if ( !it->second.empty() ) { i = *(it->second.begin()); //printf("using begin i: %ld\n",i); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 0659dc7f4..0d9d99526 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -83,7 +83,7 @@ void CBEBouquetWidget::paintItem(int pos) } else { bool has_channels = true; if(current < Bouquets->size()) - has_channels = ((*Bouquets)[current]->tvChannels.size() > 0) || ((*Bouquets)[current]->radioChannels.size() > 0); + has_channels = (!(*Bouquets)[current]->tvChannels.empty() ) || (!(*Bouquets)[current]->radioChannels.empty()); color = has_channels ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; bgcolor = has_channels ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 0b363dd76..056799fbd 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -244,7 +244,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent) listmaxshow=bookmarks.size(); height = theight+0+listmaxshow*fheight*2; // recalc height } - if (selected==bookmarks.size() && !(bookmarks.empty())) + if (!(bookmarks.empty() && selected==bookmarks.size())) { selected=bookmarks.size()-1; liststart = (selected/listmaxshow)*listmaxshow; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 5e84ab9f5..0a0f3134d 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -224,7 +224,7 @@ int CBouquetList::doMenu() CZapitBouquet * tmp, * zapitBouquet; ZapitChannelList* channels; - if(!Bouquets.size() || g_settings.minimode) + if(Bouquets.empty() || g_settings.minimode) return 0; zapitBouquet = Bouquets[selected]->zapitBouquet; @@ -383,7 +383,7 @@ int CBouquetList::show(bool bShowChannelList) return -3; } } - else if(Bouquets.size() == 0) + else if(Bouquets.empty()) continue; //FIXME msgs not forwarded to neutrino !! else if ( msg == CRCInput::RC_setup) { int ret = doMenu(); @@ -593,7 +593,7 @@ void CBouquetList::paint() { liststart = (selected/listmaxshow)*listmaxshow; int lastnum = liststart + listmaxshow; - int bsize = Bouquets.size() > 0 ? Bouquets.size() : 1; + int bsize = Bouquets.empty() ? 1 : Bouquets.size(); if(lastnum<10) numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("0"); @@ -610,7 +610,7 @@ void CBouquetList::paint() ::paintButtons(x, y + (height - footerHeight), width, sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]), CBouquetListButtons, footerHeight); - if(Bouquets.size()) + if(!Bouquets.empty()) { for(unsigned int count=0;countBouquets.size() > 0) { + if (!bouquetList->Bouquets.empty()) { bool found = true; uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size(); if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { @@ -700,7 +700,7 @@ int CChannelList::show() } } else if (msg == (neutrino_msg_t)g_settings.key_bouquet_down) { - if (bouquetList->Bouquets.size() > 0) { + if (!bouquetList->Bouquets.empty()) { bool found = true; int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { @@ -1421,7 +1421,7 @@ void CChannelList::virtual_zap_mode(bool up) void CChannelList::quickZap(int key, bool /* cycle */) { - if(chanlist.size() == 0) + if(chanlist.empty()) return; unsigned int sl = selected; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index d19a778ed..35bbcaca7 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -881,7 +881,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu this->paint(); } if (msg == CRCInput::RC_yellow) { - if (bouquetList->Bouquets.size() > 0) { + if (!bouquetList->Bouquets.empty()) { bool found = true; uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size(); //printf("**************************** EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext); @@ -908,7 +908,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } } else if (msg == CRCInput::RC_green) { - if (bouquetList->Bouquets.size() > 0) { + if (!bouquetList->Bouquets.empty()) { bool found = true; int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { @@ -1263,7 +1263,7 @@ int CEPGplusHandler::exec (CMenuTarget * parent, const std::string & /*actionKey //channelList = CNeutrinoApp::getInstance()->channelList; int bnum = bouquetList->getActiveBouquetNumber(); current_bouquet = bnum; - if(bouquetList->Bouquets.size() && bouquetList->Bouquets[bnum]->channelList->getSize() > 0) + if(!bouquetList->Bouquets.empty() && bouquetList->Bouquets[bnum]->channelList->getSize() > 0) channelList = bouquetList->Bouquets[bnum]->channelList; else channelList = CNeutrinoApp::getInstance()->channelList; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 279df0740..d34d4205f 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -567,7 +567,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // 21.07.2005 - rainerk // Show extended information - if (0 != epgData.itemDescriptions.size() && 0 != epgData.items.size()) { + if ( !epgData.itemDescriptions.empty() && !epgData.items.empty()) { char line[256]; std::vector::iterator description; std::vector::iterator item; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 42e1b5a80..db0901179 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -230,7 +230,7 @@ void CNeutrinoEventList::readEvents(const t_channel_id channel_id) current_event++; } - if ( evtlist.size() == 0 ) + if ( evtlist.empty() ) { CChannelEvent evt; @@ -1066,7 +1066,7 @@ bool CNeutrinoEventList::findEvents(void) } if(evtlist.empty()) { - if ( evtlist.size() == 0 ) + if ( evtlist.empty() ) { CChannelEvent evt; //evt.description = m_search_keyword + ": " + g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 6b0049c6e..fb36e479a 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -982,7 +982,7 @@ bool CFileBrowser::exec(const char * const dirname) } else #endif - if (selections.size() > 0) + if (!selections.empty()) { ChangeDir("..",selections.back()); selections.pop_back(); @@ -1042,7 +1042,7 @@ bool CFileBrowser::exec(const char * const dirname) else #endif { - if (selections.size() > 0) + if ( !selections.empty() ) { ChangeDir("..",selections.back()); selections.pop_back(); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index df1976489..3ff3e5531 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -223,7 +223,7 @@ void CInfoViewerBB::getBBButtonInfo() text = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN]; if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD)) text = ""; - if (g_RemoteControl->current_PIDs.APIDs.size() > 0) { + if (!g_RemoteControl->current_PIDs.APIDs.empty()) { int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid; if (text.empty()) text = g_RemoteControl->current_PIDs.APIDs[selected].desc; @@ -698,7 +698,7 @@ void CInfoViewerBB::showIcon_CA_Status(int notfirst) return; if (g_settings.casystem_display == 2) { - fta = (channel->camap.size() == 0); + fta = channel->camap.empty(); showOne_CAIcon(); return; } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 6daa81ca8..5b4f8e2d1 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1206,7 +1206,7 @@ void CMovieBrowser::refreshMovieInfo(void) { //TRACE("[mb]->refreshMovieInfo m_vMovieInfo.size %d\n", m_vMovieInfo.size()); std::string emptytext = " "; - if(m_vMovieInfo.size() <= 0) { + if(m_vMovieInfo.empty()) { if(m_pcInfo != NULL) m_pcInfo->setText(&emptytext); return; @@ -1286,7 +1286,7 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) } void CMovieBrowser::refreshLCD(void) { - if(m_vMovieInfo.size() <= 0) return; + if(m_vMovieInfo.empty()) return; //CVFD * lcd = CVFD::getInstance(); if(m_movieSelectionHandler == NULL) @@ -1313,7 +1313,7 @@ void CMovieBrowser::refreshFilterList(void) m_FilterLines.rowWidth[0] = 100; m_FilterLines.lineHeader[0]= ""; - if(m_vMovieInfo.size() <= 0) + if(m_vMovieInfo.empty()) return; // exit here if nothing else is to do if(m_settings.filter.item == MB_INFO_MAX_NUMBER) @@ -1389,7 +1389,7 @@ void CMovieBrowser::refreshLastPlayList(void) //P2 } m_vHandlePlayList.clear(); - if(m_vMovieInfo.size() <= 0) { + if(m_vMovieInfo.empty()) { if(m_pcLastPlay != NULL) m_pcLastPlay->setLines(&m_playListLines); return; // exit here if nothing else is to do @@ -1447,7 +1447,7 @@ void CMovieBrowser::refreshLastRecordList(void) //P2 } m_vHandleRecordList.clear(); - if(m_vMovieInfo.size() <= 0) { + if(m_vMovieInfo.empty()) { if(m_pcLastRecord != NULL) m_pcLastRecord->setLines(&m_recordListLines); return; // exit here if nothing else is to do @@ -1506,7 +1506,7 @@ void CMovieBrowser::refreshBrowserList(void) //P1 } m_vHandleBrowserList.clear(); - if(m_vMovieInfo.size() <= 0) + if(m_vMovieInfo.empty()) { m_currentBrowserSelection = 0; m_movieSelectionHandler = NULL; @@ -1727,7 +1727,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_spkr) { - if ((m_vMovieInfo.size() > 0) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) + if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) onDeleteFile(*m_movieSelectionHandler); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) @@ -2318,7 +2318,7 @@ void CMovieBrowser::onSetFocusNext(void) bool CMovieBrowser::onSortMovieInfoHandleList(std::vector& handle_list, MB_INFO_ITEM sort_item, MB_DIRECTION direction) { //TRACE("sort: %d\r\n",direction); - if(handle_list.size() <= 0) + if(handle_list.empty()) return (false); // nothing to sort, return immedately if(sortBy[sort_item] == NULL) return (false); @@ -2575,23 +2575,23 @@ bool CMovieBrowser::delFile_vlc(CFile& /*file*/) bool CMovieBrowser::delFile_std(CFile& file) { bool result = true; - char buf[FILENAME_MAX]={0}; - snprintf(buf,sizeof(buf), "nice -n 20 rm -f \"%s\" &", file.Name.c_str()); - system(buf); + int errno = unlink(file.Name.c_str()); TRACE(" delete file: %s\r\n",file.Name.c_str()); + if(errno) + result = false; return(result); } void CMovieBrowser::updateMovieSelection(void) { //TRACE("[mb]->updateMovieSelection %d\r\n",m_windowFocus); - if (m_vMovieInfo.size() == 0) return; + if (m_vMovieInfo.empty()) return; bool new_selection = false; unsigned int old_movie_selection; if(m_windowFocus == MB_FOCUS_BROWSER) { - if(m_vHandleBrowserList.size() == 0) + if(m_vHandleBrowserList.empty()) { // There are no elements in the Filebrowser, clear all handles m_currentBrowserSelection = 0; @@ -2612,7 +2612,7 @@ void CMovieBrowser::updateMovieSelection(void) } else if(m_windowFocus == MB_FOCUS_LAST_PLAY) { - if(m_vHandlePlayList.size() == 0) + if(m_vHandlePlayList.empty()) { // There are no elements in the Filebrowser, clear all handles m_currentPlaySelection = 0; @@ -2633,7 +2633,7 @@ void CMovieBrowser::updateMovieSelection(void) } else if(m_windowFocus == MB_FOCUS_LAST_RECORD) { - if(m_vHandleRecordList.size() == 0) + if(m_vHandleRecordList.empty()) { // There are no elements in the Filebrowser, clear all handles m_currentRecordSelection = 0; @@ -2666,7 +2666,7 @@ void CMovieBrowser::updateMovieSelection(void) void CMovieBrowser::updateFilterSelection(void) { //TRACE("[mb]->updateFilterSelection \r\n"); - if(m_FilterLines.lineArray[0].size() == 0) return; + if(m_FilterLines.lineArray[0].empty()) return; bool result = true; int selected_line = m_pcFilter->getSelectedLine(); @@ -3214,7 +3214,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = movie_info.file.getFileName(); break; case MB_INFO_FILEPATH: // = 1, - if(m_dirNames.size() > 0) + if(!m_dirNames.empty()) *item_string = m_dirNames[movie_info.dirItNr]; break; case MB_INFO_TITLE: // = 2, @@ -3557,7 +3557,7 @@ CDirMenu::CDirMenu(std::vector* dir_list) { std::string tmp = g_settings.network_nfs_local_dir[nfs]; int result = -1; - if(tmp.size()) + if(!tmp.empty()) result = (*dirList)[i].name.compare( 0,tmp.size(),tmp) ; printf("[CDirMenu] (nfs%d) %s == (mb%d) %s (%d)\n",nfs,g_settings.network_nfs_local_dir[nfs],i,(*dirList)[i].name.c_str(),result); diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 32d3ae023..7e0a785a5 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -182,7 +182,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); //%d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); //%u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); //%u - if (movie_info->audioPids.size() > 0) { + if ( !movie_info->audioPids.empty() ) { //*extMessage += "\t\t<"MI_XML_TAG_AUDIOPIDS" selected=\""; //sprintf(tmp, "%u", movie_info->audioPids[0].epgAudioPid); //pids.APIDs[i].pid); //*extMessage += tmp; @@ -426,7 +426,7 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) print_buffer += "\n"; print_buffer += movie_info.epgInfo2; - if (movie_info.productionCountry.size() != 0 || movie_info.productionDate != 0) { + if ( !movie_info.productionCountry.empty() || movie_info.productionDate != 0) { print_buffer += "\n"; print_buffer += movie_info.productionCountry; print_buffer += " "; @@ -468,7 +468,7 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) snprintf(date_char, 12, "%3d", movie_info.length); print_buffer += date_char; } - if (movie_info.audioPids.size() != 0) { + if ( !movie_info.audioPids.empty() ) { print_buffer += "\n"; print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_AUDIO); print_buffer += ": "; @@ -828,7 +828,7 @@ bool CMovieInfo::addNewBookmark(MI_MOVIE_INFO * movie_info, MI_BOOKMARK & new_bo movie_info->bookmarks.user[i].pos = new_bookmark.pos; movie_info->bookmarks.user[i].length = new_bookmark.length; //if(movie_info->bookmarks.user[i].name.empty()) - if (movie_info->bookmarks.user[i].name.size() == 0) { + if (movie_info->bookmarks.user[i].name.empty() ) { if (new_bookmark.length == 0) movie_info->bookmarks.user[i].name = g_Locale->getText(LOCALE_MOVIEBROWSER_BOOK_NEW); if (new_bookmark.length < 0) diff --git a/src/gui/nfs.cpp b/src/gui/nfs.cpp index bef2fe9d4..79122a775 100644 --- a/src/gui/nfs.cpp +++ b/src/gui/nfs.cpp @@ -318,7 +318,7 @@ int CNFSUmountGui::menu() umountMenu.addItem(forwarder); } } - if(infos.size() > 0) + if( !infos.empty() ) return umountMenu.exec(this,""); else return menu_return::RETURN_REPAINT; diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 64eb145a4..30a407b36 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -801,7 +801,7 @@ int CStreamInfo2::ts_setup () unsigned short vpid, apid = 0; vpid = g_RemoteControl->current_PIDs.PIDs.vpid; - if(g_RemoteControl->current_PIDs.APIDs.size() > 0) + if( !g_RemoteControl->current_PIDs.APIDs.empty() ) apid = g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid; if(vpid == 0 && apid == 0) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 71b71a3cb..1addca84d 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -606,6 +606,8 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) void CFlashExpert::showMTDSelector(const std::string & actionkey) { + int shortcut = 0; + mn_widget_id_t widget_id = NO_WIDGET_ID; if (actionkey == "readmtd") widget_id = MN_WIDGET_ID_MTDREAD_SELECTOR; @@ -624,7 +626,7 @@ void CFlashExpert::showMTDSelector(const std::string & actionkey) if ((actionkey == "writemtd") && (lx == 0)) enabled = false; sprintf(sActionKey, "%s%d", actionkey.c_str(), lx); - mtdselector->addItem(new CMenuForwarderNonLocalized(mtdInfo->getMTDName(lx).c_str(), enabled, NULL, this, sActionKey)); + mtdselector->addItem(new CMenuForwarderNonLocalized(mtdInfo->getMTDName(lx).c_str(), enabled, NULL, this, sActionKey, CRCInput::convertDigitToKey(shortcut++))); } mtdselector->exec(NULL,""); delete mtdselector; diff --git a/src/gui/update_menue.cpp b/src/gui/update_menue.cpp index bf33a9264..aeb7f471c 100644 --- a/src/gui/update_menue.cpp +++ b/src/gui/update_menue.cpp @@ -101,6 +101,6 @@ void CSoftwareUpdate::showSoftwareUpdateExpert(CMenuWidget *w_mtd_expert) { w_mtd_expert->addIntroItems(); - w_mtd_expert->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_READFLASHMTD , true, NULL, fe, "readflashmtd" )); - w_mtd_expert->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_WRITEFLASHMTD, true, NULL, fe, "writeflashmtd")); + w_mtd_expert->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_READFLASHMTD , true, NULL, fe, "readflashmtd" , CRCInput::RC_red , NEUTRINO_ICON_BUTTON_RED)); + w_mtd_expert->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_WRITEFLASHMTD, true, NULL, fe, "writeflashmtd", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); } diff --git a/src/gui/update_settings.cpp b/src/gui/update_settings.cpp index 14c0b9728..93ca1fd8d 100644 --- a/src/gui/update_settings.cpp +++ b/src/gui/update_settings.cpp @@ -107,17 +107,17 @@ int CUpdateSettings::initMenu() w_upsettings.addIntroItems(LOCALE_FLASHUPDATE_SETTINGS); #ifdef USE_SMS_INPUT - CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, input_url_file, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, input_url_file, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); #else - CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); #endif - CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, !g_settings.softupdate_mode, g_settings.update_dir , this, "update_dir", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, !g_settings.softupdate_mode, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); CUrlConfigSetupNotifier url_setup_notifier(fw_url, fw_update_dir); CMenuOptionChooser *oj_mode = new CMenuOptionChooser(LOCALE_FLASHUPDATE_UPDATEMODE, &g_settings.softupdate_mode, FLASHUPDATE_UPDATEMODE_OPTIONS, FLASHUPDATE_UPDATEMODE_OPTION_COUNT, true, &url_setup_notifier); - w_upsettings.addItem(oj_mode); + w_upsettings.addItem(oj_mode, true); w_upsettings.addItem(GenericMenuSeparatorLine); w_upsettings.addItem(fw_update_dir); w_upsettings.addItem(fw_url); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f95fe0e0b..b8ca3037a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1239,7 +1239,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) satellite_map_t satlist = CServiceManager::getInstance()->SatelliteList(); for(sit = satlist.begin(); sit != satlist.end(); sit++) { CServiceManager::getInstance()->GetAllSatelliteChannels(zapitList, sit->first); - if(!zapitList.size()) + if( zapitList.empty() ) continue; tvi = 0, ri = 0; @@ -2044,7 +2044,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) switchTvRadioMode(); //used with defined rc key TODO: do we really need this, because we already have a specified key on the remote control } else if( msg == (neutrino_msg_t) g_settings.key_subchannel_up ) { - if(g_RemoteControl->subChannels.size() > 0) { + if( !g_RemoteControl->subChannels.empty() ) { StopSubtitles(); g_RemoteControl->subChannelUp(); g_InfoViewer->showSubchan(); @@ -2058,7 +2058,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) quickZap( msg ); } else if( msg == (neutrino_msg_t) g_settings.key_subchannel_down ) { - if(g_RemoteControl->subChannels.size()> 0) { + if( !g_RemoteControl->subChannels.empty() ) { StopSubtitles(); g_RemoteControl->subChannelDown(); g_InfoViewer->showSubchan(); @@ -2290,7 +2290,7 @@ _show: //_show: if(msg == CRCInput::RC_ok) { - if(bouquetList->Bouquets.size() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) + if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! else nNewChannel = bouquetList->exec(true); @@ -2626,7 +2626,7 @@ _repeat: tmpTimerList.clear(); tmpTimerdClient.getTimerList( tmpTimerList ); - if(tmpTimerList.size() > 0) { + if( !tmpTimerList.empty() ) { sort( tmpTimerList.begin(), tmpTimerList.end() ); CTimerd::responseGetTimer &timer = tmpTimerList[0]; diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 0da793884..e53469824 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -136,7 +136,7 @@ THandleStatus CControlAPI::Hook_SendResponse(CyhookHandler *hh) void CControlAPI::compatibility_Timer(CyhookHandler *hh) { log_level_printf(4,"CControlAPI Compatibility Timer Start url:%s\n",hh->UrlData["url"].c_str()); - if(NeutrinoAPI->Timerd->isTimerdAvailable() && hh->ParamList.size() > 0) + if(NeutrinoAPI->Timerd->isTimerdAvailable() && !hh->ParamList.empty() ) { if(hh->ParamList["action"] == "remove") { @@ -390,7 +390,7 @@ void CControlAPI::ExecCGI(CyhookHandler *hh) hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); else hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - if (hh->ParamList.size() > 0) + if ( !hh->ParamList.empty() ) { script = hh->ParamList["1"]; unsigned int len = hh->ParamList.size(); diff --git a/src/nhttpd/tuxboxapi/dbox/controlapi.cpp b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp index 1fe9f694a..9b39fbce9 100644 --- a/src/nhttpd/tuxboxapi/dbox/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp @@ -110,7 +110,7 @@ THandleStatus CControlAPI::Hook_SendResponse(CyhookHandler *hh) void CControlAPI::compatibility_Timer(CyhookHandler *hh) { log_level_printf(4,"CControlAPI Compatibility Timer Start url:%s\n",hh->UrlData["url"].c_str()); - if(NeutrinoAPI->Timerd->isTimerdAvailable() && hh->ParamList.size() > 0) + if(NeutrinoAPI->Timerd->isTimerdAvailable() && !hh->ParamList.empty() ) { if(hh->ParamList["action"] == "remove") { @@ -353,7 +353,7 @@ void CControlAPI::ExecCGI(CyhookHandler *hh) hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); else hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - if (hh->ParamList.size() > 0) + if ( !hh->ParamList.empty() ) { script = hh->ParamList["1"]; unsigned int len = hh->ParamList.size(); diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 0df6079b8..fc8a5c48b 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -159,7 +159,7 @@ void CyParser::cgi(CyhookHandler *hh) { bool ydebug = false; std::string htmlfilename, yresult, ycmd; - if (hh->ParamList.size() > 0) { + if ( !hh->ParamList.empty() ) { if (hh->ParamList["tmpl"] != "") // for GET and POST htmlfilename = hh->ParamList["tmpl"]; else diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index edb1ac245..8a74c0a8f 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -275,7 +275,7 @@ void CBouquetManager::saveBouquets(const CZapitClient::bouquetMode bouquetMode, delete (*it); Bouquets.erase(it); } - if(Bouquets.size() > 0) + if( !Bouquets.empty() ) Bouquets[0]->Name = providerName; } @@ -444,7 +444,7 @@ void CBouquetManager::makeRemainingChannelsBouquet(void) sort(unusedChannels.begin(), unusedChannels.end(), CmpChannelByChName()); // TODO: use locales - remainChannels = addBouquet((Bouquets.size() == 0) ? "All Channels" : "Other", false); // UTF-8 encoded + remainChannels = addBouquet( Bouquets.empty() ? "All Channels" : "Other", false); // UTF-8 encoded remainChannels->bOther = true; for (ZapitChannelList::const_iterator it = unusedChannels.begin(); it != unusedChannels.end(); ++it) { @@ -629,7 +629,7 @@ CBouquetManager::ChannelIterator::ChannelIterator(CBouquetManager* owner, const { Owner = owner; tv = TV; - if (Owner->Bouquets.size() == 0) + if (Owner->Bouquets.empty()) c = -2; else { b = 0; @@ -645,7 +645,7 @@ CBouquetManager::ChannelIterator CBouquetManager::ChannelIterator::operator ++(i c++; if ((unsigned int) c >= getBouquet()->size()) { for (b++; b < Owner->Bouquets.size(); b++) - if (getBouquet()->size() != 0) { + if ( !getBouquet()->empty() ) { c = 0; goto end; } diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index c2461b4d5..6cb0a14b3 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -69,7 +69,7 @@ bool CFEManager::Init() } } INFO("found %d frontends\n", femap.size()); - if(femap.size() == 0) + if( femap.empty() ) return false; #if 0 if(femap.size() == 1) diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 7b0bf62e1..96e8f2c20 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -225,7 +225,7 @@ bool CServiceManager::GetAllRadioChannels(ZapitChannelList &list, int flags) ((flags == 0) || (it->second.flags & flags))) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllTvChannels(ZapitChannelList &list, int flags) @@ -236,7 +236,7 @@ bool CServiceManager::GetAllTvChannels(ZapitChannelList &list, int flags) ((flags == 0) || (it->second.flags & flags))) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllHDChannels(ZapitChannelList &list) @@ -246,7 +246,7 @@ bool CServiceManager::GetAllHDChannels(ZapitChannelList &list) if (it->second.isHD()) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllUnusedChannels(ZapitChannelList &list) @@ -256,7 +256,7 @@ bool CServiceManager::GetAllUnusedChannels(ZapitChannelList &list) if (it->second.has_bouquet == false) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position) @@ -266,7 +266,7 @@ bool CServiceManager::GetAllSatelliteChannels(ZapitChannelList &list, t_satellit if(it->second.getSatellitePosition() == position) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid) @@ -276,7 +276,7 @@ bool CServiceManager::GetAllTransponderChannels(ZapitChannelList &list, transpon if(it->second.getTransponderId() == tpid) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } std::string CServiceManager::GetServiceName(t_channel_id channel_id) diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index bc4084eb8..b91871e8c 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -539,7 +539,7 @@ bool CServiceScan::ScanProviders() break; } - if(scanBouquetManager->Bouquets.size() > 0) { + if( !scanBouquetManager->Bouquets.empty() ) { scanBouquetManager->saveBouquets(bouquetMode, spI->second.c_str()); } scanBouquetManager->clearAll(); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index db2b5a17f..1940ade59 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1029,7 +1029,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) CBasicServer::receive_data(connfd, &TP, sizeof(TP)); sig_delay = 0; TP.feparams.inversion = INVERSION_AUTO; - const char *name = scanProviders.size() > 0 ? scanProviders.begin()->second.c_str() : "unknown"; + const char *name = scanProviders.empty() ? "unknown" : scanProviders.begin()->second.c_str(); switch (live_fe->getInfo()->type) { case FE_QPSK: