neutrino use check empty() instead of length() or size()

This commit is contained in:
Jacek Jendrzej
2015-01-03 17:51:08 +01:00
parent a92eb8f8e7
commit 8023a6317b
14 changed files with 26 additions and 26 deletions

View File

@@ -611,7 +611,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
}
// Show genre information
if (epgData.contentClassification.length()> 0)
if (!epgData.contentClassification.empty())
processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(epgData.contentClassification[0])); // UTF-8
// processTextToArray( epgData.userClassification.c_str() );

View File

@@ -767,7 +767,7 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color);
int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60;
if ( (seit> 0) && (seit<100) && (duration_str.length()!=0) )
if ( (seit> 0) && (seit<100) && (!duration_str.empty()) )
{
char beginnt[100];
snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute);

View File

@@ -1196,7 +1196,7 @@ void CFileBrowser::paintItem(unsigned int pos)
colwidth3 = fnt_item->getRenderWidth("222.222G");
colwidth1 = width - 35 - colwidth2 - colwidth3 - 10;
if ( actual_file->Name.length() > 0 )
if ( !actual_file->Name.empty() )
{
if (curr == selected)
CVFD::getInstance()->showMenuText(0, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()).c_str(), -1, true); // UTF-8

View File

@@ -528,7 +528,7 @@ bool CMoviePlayerGui::SelectFile()
CFile *file = NULL;
filelist = filebrowser->getSelectedFiles();
filelist_it = filelist.end();
if (filelist.size() > 0) {
if (!filelist.empty()) {
filelist_it = filelist.begin();
file = &(*filelist_it);
}
@@ -852,7 +852,7 @@ void CMoviePlayerGui::PlayFileLoop(void)
} else if (msg == (neutrino_msg_t) g_settings.mpkey_stop) {
playstate = CMoviePlayerGui::STOPPED;
ClearQueue();
} else if ((filelist.size() > 0 && msg == (neutrino_msg_t) CRCInput::RC_right)) {
} else if ((!filelist.empty() && msg == (neutrino_msg_t) CRCInput::RC_right)) {
if (filelist_it < (filelist.end() - 1)) {
++filelist_it;
playstate = CMoviePlayerGui::STOPPED;
@@ -885,7 +885,7 @@ void CMoviePlayerGui::PlayFileLoop(void)
updateLcd();
if (timeshift == TSHIFT_MODE_OFF)
callInfoViewer();
} else if (filelist.size() > 0) {
} else if (!filelist.empty()) {
EnableClockAndMute(false);
CFileBrowser playlist;
CFile *pfile = NULL;
@@ -1065,7 +1065,7 @@ void CMoviePlayerGui::PlayFileLoop(void)
if (position >= 300000 || (duration < 300000 && (position > (duration /2))))
makeScreenShot(true);
if (at_eof && filelist.size() > 0) {
if (at_eof && !filelist.empty()) {
if (filelist_it != filelist.end() && repeat_mode != REPEAT_TRACK)
++filelist_it;
@@ -1097,7 +1097,7 @@ void CMoviePlayerGui::PlayFileEnd(bool restore)
stopped = true;
printf("%s: stopped\n", __func__);
if (filelist.size() > 0 && filelist_it != filelist.end()) {
if (!filelist.empty() && filelist_it != filelist.end()) {
pretty_name.clear();
prepareFile(&(*filelist_it));
}

View File

@@ -176,7 +176,7 @@ int CThemes::Show()
int res = themes.exec(NULL, "");
if (file_name.length() > 0) {
if (!file_name.empty()) {
saveFile((char*)((std::string)THEMEDIR_VAR + file_name + FILE_PREFIX).c_str());
}

View File

@@ -528,7 +528,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active)
continue;
case SNeutrinoSettings::ITEM_AUDIO_SELECT:
if(loc == NONEXISTANT_LOCALE && !text) {
if (g_RemoteControl->current_PIDs.APIDs.size() > 0)
if (!g_RemoteControl->current_PIDs.APIDs.empty())
text = g_RemoteControl->current_PIDs.APIDs[
g_RemoteControl->current_PIDs.PIDs.selected_apid].desc;
} else