CUtil::GetHomePath(xbmcBinPath, "XBMC_BIN_HOME");
xbmcPath = getenv("XBMC_HOME");
- if (xbmcPath.IsEmpty())
+ if (xbmcPath.empty())
{
xbmcPath = xbmcBinPath;
/* Check if xbmc binaries and arch independent data files are being kept in
if (CSettings::Get().GetBool("masterlock.startuplock") &&
CProfilesManager::Get().GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE &&
- !CProfilesManager::Get().GetMasterProfile().getLockCode().IsEmpty())
+ !CProfilesManager::Get().GetMasterProfile().getLockCode().empty())
{
g_passwordManager.CheckStartUpLock();
}
!m_screenSaver->ID().empty()))
return 0;
- if (!m_screenSaver->GetSetting("level").IsEmpty())
+ if (!m_screenSaver->GetSetting("level").empty())
return 100.0f - (float)atof(m_screenSaver->GetSetting("level"));
return 100.0f;
}
if (m_screenSaver->ID() == "screensaver.xbmc.builtin.dim" || m_screenSaver->ID() == "screensaver.xbmc.builtin.black" || m_screenSaver->ID().empty())
return true;
- else if (!m_screenSaver->ID().IsEmpty())
+ else if (!m_screenSaver->ID().empty())
{ // we're in screensaver window
if (g_windowManager.GetActiveWindow() == WINDOW_SCREENSAVER
|| g_windowManager.GetActiveWindow() == WINDOW_VISUALISATION)
return;
else if (m_screenSaver->ID() == "screensaver.xbmc.builtin.black")
return;
- else if (!m_screenSaver->ID().IsEmpty())
+ else if (!m_screenSaver->ID().empty())
g_windowManager.ActivateWindow(WINDOW_SCREENSAVER);
}
bool CApplication::AlwaysProcess(const CAction& action)
{
// check if this button is mapped to a built-in function
- if (!action.GetName().IsEmpty())
+ if (!action.GetName().empty())
{
CStdString builtInFunction;
vector<CStdString> params;
if (pInfo == NULL)
return false;
- if (mediaPath.IsEmpty() && pInfo->IsAudio(1))
+ if (mediaPath.empty() && pInfo->IsAudio(1))
mediaPath = "cdda://local/";
- if (mediaPath.IsEmpty() && (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1)))
+ if (mediaPath.empty() && (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1)))
mediaPath = "iso9660://";
- if (mediaPath.IsEmpty())
+ if (mediaPath.empty())
mediaPath = path;
#ifdef TARGET_WINDOWS
- if (mediaPath.IsEmpty() || mediaPath.CompareNoCase("iso9660://") == 0)
+ if (mediaPath.empty() || mediaPath.CompareNoCase("iso9660://") == 0)
mediaPath = g_mediaManager.TranslateDevicePath("");
#endif
item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
+ if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.empty())
item.m_lStartOffset = STARTOFFSET_RESUME;
g_application.PlayFile(item, false);
item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
+ if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.empty())
item.m_lStartOffset = STARTOFFSET_RESUME;
g_application.PlayFile(item, false);
item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
+ if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.empty())
item.m_lStartOffset = STARTOFFSET_RESUME;
// get playername
strExt = ".mpg";
// If a file format was extracted we are sure this is a VCD. Autoplay if settings indicate we should.
- if (!strExt.IsEmpty() && bAllowVideo
+ if (!strExt.empty() && bAllowVideo
&& (bypassSettings || CSettings::Get().GetBool("dvds.autorun")))
{
CFileItemList items;
bool CAutorun::CanResumePlayDVD(const CStdString& path)
{
CStdString strUniqueId = g_mediaManager.GetDiskUniqueId(path);
- if (!strUniqueId.IsEmpty())
+ if (!strUniqueId.empty())
{
CVideoDatabase dbs;
dbs.Open();
// lets manage tracks titles without quotes
CStdString titleNoQuote = strLine.Mid(5);
titleNoQuote.TrimLeft();
- if (!titleNoQuote.IsEmpty())
+ if (!titleNoQuote.empty())
{
g_charsetConverter.unknownToUTF8(titleNoQuote);
m_Track[m_iTotalTracks].strTitle = titleNoQuote;
{
CStdString genreNoQuote = strLine.Mid(9);
genreNoQuote.TrimLeft();
- if (!genreNoQuote.IsEmpty())
+ if (!genreNoQuote.empty())
{
g_charsetConverter.unknownToUTF8(genreNoQuote);
m_strGenre = genreNoQuote;
// Get rid of the index number and any whitespace
CStdString numberTime = index.Mid(5);
numberTime.TrimLeft();
- while (!numberTime.IsEmpty())
+ while (!numberTime.empty())
{
if (!isdigit(numberTime[0]))
break;
{
CStdString number(info);
number.TrimLeft();
- if (number.IsEmpty() || !isdigit(number[0]))
+ if (number.empty() || !isdigit(number[0]))
return -1;
return atoi(number.c_str());
}
m_strLabel2 = tag.Plot();
m_dateTime = tag.StartAsLocalTime();
- if (!tag.Icon().IsEmpty())
+ if (!tag.Icon().empty())
SetIconImage(tag.Icon());
FillInMimeType(false);
}
}
- if (!channel.IconPath().IsEmpty())
+ if (!channel.IconPath().empty())
SetIconImage(channel.IconPath());
SetProperty("channelid", channel.ChannelID());
m_strLabel2 = timer.Summary();
m_dateTime = timer.StartAsLocalTime();
- if (!timer.ChannelIcon().IsEmpty())
+ if (!timer.ChannelIcon().empty())
SetIconImage(timer.ChannelIcon());
FillInMimeType(false);
m_strPath = strPath;
m_bIsFolder = bIsFolder;
// tuxbox urls cannot have a / at end
- if (m_bIsFolder && !m_strPath.IsEmpty() && !IsFileFolder() && !URIUtils::IsTuxBox(m_strPath))
+ if (m_bIsFolder && !m_strPath.empty() && !IsFileFolder() && !URIUtils::IsTuxBox(m_strPath))
URIUtils::AddSlashAtEnd(m_strPath);
FillInMimeType(false);
}
if (!IsRSS()) // no slash at end for rss feeds
URIUtils::AddSlashAtEnd(m_strPath);
CStdString label = share.strName;
- if (!share.strStatus.IsEmpty())
+ if (!share.strStatus.empty())
label = StringUtils::Format("%s (%s)", share.strName.c_str(), share.strStatus.c_str());
SetLabel(label);
m_iLockMode = share.m_iLockMode;
bool CFileItem::Exists(bool bUseCache /* = true */) const
{
- if (m_strPath.IsEmpty()
+ if (m_strPath.empty()
|| m_strPath.Equals("add")
|| IsInternetStream()
|| IsParentFolder()
bool CFileItem::IsVirtualDirectoryRoot() const
{
- return (m_bIsFolder && m_strPath.IsEmpty());
+ return (m_bIsFolder && m_strPath.empty());
}
bool CFileItem::IsRemovable() const
// for .. folders the default picture for parent folder
// for other folders the defaultFolder.png
- if (GetIconImage().IsEmpty())
+ if (GetIconImage().empty())
{
if (!m_bIsFolder)
{
void CFileItem::FillInMimeType(bool lookup /*= true*/)
{
- if (m_mimetype.IsEmpty())
+ if (m_mimetype.empty())
{
if( m_bIsFolder )
m_mimetype = "x-directory/normal";
m_mimetype = CMime::GetMimeType(*this);
// if it's still empty set to an unknown type
- if (m_mimetype.IsEmpty())
+ if (m_mimetype.empty())
m_mimetype = "application/octet-stream";
}
if (item.HasPictureInfoTag())
*GetPictureInfoTag() = *item.GetPictureInfoTag();
- if (replaceLabels && !item.GetLabel().IsEmpty())
+ if (replaceLabels && !item.GetLabel().empty())
SetLabel(item.GetLabel());
- if (replaceLabels && !item.GetLabel2().IsEmpty())
+ if (replaceLabels && !item.GetLabel2().empty())
SetLabel2(item.GetLabel2());
if (!item.GetArt("thumb").empty())
SetArt("thumb", item.GetArt("thumb"));
- if (!item.GetIconImage().IsEmpty())
+ if (!item.GetIconImage().empty())
SetIconImage(item.GetIconImage());
AppendProperties(item);
}
{
if (!video.m_strTitle.empty())
SetLabel(video.m_strTitle);
- if (video.m_strFileNameAndPath.IsEmpty())
+ if (video.m_strFileNameAndPath.empty())
{
m_strPath = video.m_strPath;
URIUtils::AddSlashAtEnd(m_strPath);
dvdPath = path;
}
#ifdef HAVE_LIBBLURAY
- if (dvdPath.IsEmpty())
+ if (dvdPath.empty())
{
path = URIUtils::AddFileToFolder(item->GetPath(), "index.bdmv");
if (CFile::Exists(path))
}
}
#endif
- if (!dvdPath.IsEmpty())
+ if (!dvdPath.empty())
{
// NOTE: should this be done for the CD# folders too?
item->m_bIsFolder = false;
CStdString CFileItem::GetUserMusicThumb(bool alwaysCheckRemote /* = false */, bool fallbackToFolder /* = false */) const
{
- if (m_strPath.IsEmpty()
+ if (m_strPath.empty()
|| StringUtils::StartsWithNoCase(m_strPath, "newsmartplaylist://")
|| StringUtils::StartsWithNoCase(m_strPath, "newplaylist://")
|| m_bIsShareOrDrive
if (m_bIsFolder && !IsFileFolder())
URIUtils::RemoveSlashAtEnd(strFile);
- if (!strFile.IsEmpty())
+ if (!strFile.empty())
{
if (m_bIsFolder && !IsFileFolder())
thumbFile = strFile + ".tbn"; // folder, so just add ".tbn"
else if (CUtil::IsTVRecording(m_strPath))
{
CStdString title = CPVRRecording::GetTitleFromURL(m_strPath);
- if (!title.IsEmpty())
+ if (!title.empty())
return title;
}
|| IsAddonsPath()
|| IsDVD()
|| (URIUtils::IsFTP(strFile) && !g_advancedSettings.m_bFTPThumbs)
- || m_strPath.IsEmpty())
+ || m_strPath.empty())
return "";
CStdString strDir = URIUtils::GetDirectory(strFile);
- if (strDir.IsEmpty())
+ if (strDir.empty())
return "";
CFileItemList items;
strFile = URIUtils::ReplaceExtension(strFile, "-fanart");
fanarts.insert(m_bIsFolder ? fanarts.end() : fanarts.begin(), URIUtils::GetFileName(strFile));
- if (!strFile2.IsEmpty())
+ if (!strFile2.empty())
fanarts.insert(m_bIsFolder ? fanarts.end() : fanarts.begin(), URIUtils::GetFileName(strFile2));
for (unsigned int i = 0; i < fanarts.size(); ++i)
int CFileItem::GetVideoContentType() const
{
VIDEODB_CONTENT_TYPE type = VIDEODB_CONTENT_MOVIES;
- if (HasVideoInfoTag() && !GetVideoInfoTag()->m_strShowTitle.IsEmpty()) // tvshow
+ if (HasVideoInfoTag() && !GetVideoInfoTag()->m_strShowTitle.empty()) // tvshow
type = VIDEODB_CONTENT_TVSHOWS;
if (HasVideoInfoTag() && GetVideoInfoTag()->m_iSeason > -1 && !m_bIsFolder) // episode
return VIDEODB_CONTENT_EPISODES;
}
else if (infoString[i] == '.' && !parentheses)
{
- if (!property.IsEmpty()) // add our property and parameters
+ if (!property.empty()) // add our property and parameters
info.push_back(Property(property.ToLower(), param));
property.clear();
param.clear();
}
if (parentheses)
CLog::Log(LOGERROR, "unmatched parentheses in %s", infoString.c_str());
- if (!property.IsEmpty())
+ if (!property.empty())
info.push_back(Property(property.ToLower(), param));
}
{
if (prop.name == "property" && prop.num_params() == 1)
{ // TODO: this doesn't support foo.xml
- int winID = cat.param().IsEmpty() ? 0 : CButtonTranslator::TranslateWindow(cat.param());
+ int winID = cat.param().empty() ? 0 : CButtonTranslator::TranslateWindow(cat.param());
if (winID != WINDOW_INVALID)
return AddMultiInfo(GUIInfo(WINDOW_PROPERTY, winID, ConditionalStringParameter(prop.param())));
}
{ // TODO: The parameter for these should really be on the first not the second property
if (prop.param().Find("xml") >= 0)
return AddMultiInfo(GUIInfo(window_bools[i].val, 0, ConditionalStringParameter(prop.param())));
- int winID = prop.param().IsEmpty() ? 0 : CButtonTranslator::TranslateWindow(prop.param());
+ int winID = prop.param().empty() ? 0 : CButtonTranslator::TranslateWindow(prop.param());
if (winID != WINDOW_INVALID)
return AddMultiInfo(GUIInfo(window_bools[i].val, winID, 0));
return 0;
TIME_FORMAT CGUIInfoManager::TranslateTimeFormat(const CStdString &format)
{
- if (format.IsEmpty()) return TIME_FORMAT_GUESS;
+ if (format.empty()) return TIME_FORMAT_GUESS;
else if (format.Equals("hh")) return TIME_FORMAT_HH;
else if (format.Equals("mm")) return TIME_FORMAT_MM;
else if (format.Equals("ss")) return TIME_FORMAT_SS;
strLabel = m_currentFile->GetMusicInfoTag()->GetURL();
else if (m_currentFile->HasVideoInfoTag())
strLabel = m_currentFile->GetVideoInfoTag()->m_strFileNameAndPath;
- if (strLabel.IsEmpty())
+ if (strLabel.empty())
strLabel = m_currentFile->GetPath();
}
if (info == PLAYER_PATH)
StringUtils::EmptyString :
g_localizeStrings.Get(19055); // no information available
}
- if (m_currentFile->HasPVRRecordingInfoTag() && !m_currentFile->GetPVRRecordingInfoTag()->m_strTitle.IsEmpty())
+ if (m_currentFile->HasPVRRecordingInfoTag() && !m_currentFile->GetPVRRecordingInfoTag()->m_strTitle.empty())
return m_currentFile->GetPVRRecordingInfoTag()->m_strTitle;
- if (m_currentFile->HasVideoInfoTag() && !m_currentFile->GetVideoInfoTag()->m_strTitle.IsEmpty())
+ if (m_currentFile->HasVideoInfoTag() && !m_currentFile->GetVideoInfoTag()->m_strTitle.empty())
return m_currentFile->GetVideoInfoTag()->m_strTitle;
- if (m_currentFile->HasMusicInfoTag() && !m_currentFile->GetMusicInfoTag()->GetTitle().IsEmpty())
+ if (m_currentFile->HasMusicInfoTag() && !m_currentFile->GetMusicInfoTag()->GetTitle().empty())
return m_currentFile->GetMusicInfoTag()->GetTitle();
// don't have the title, so use dvdplayer, label, or drop down to title from path
- if (!g_application.m_pPlayer->GetPlayingTitle().IsEmpty())
+ if (!g_application.m_pPlayer->GetPlayingTitle().empty())
return g_application.m_pPlayer->GetPlayingTitle();
- if (!m_currentFile->GetLabel().IsEmpty())
+ if (!m_currentFile->GetLabel().empty())
return m_currentFile->GetLabel();
return CUtil::GetTitleFromPath(m_currentFile->GetPath());
}
else
{
- if (!g_application.m_pPlayer->GetPlayingTitle().IsEmpty())
+ if (!g_application.m_pPlayer->GetPlayingTitle().empty())
return g_application.m_pPlayer->GetPlayingTitle();
}
}
condition.TrimLeft(" \t\r\n");
condition.TrimRight(" \t\r\n");
- if (condition.IsEmpty())
+ if (condition.empty())
return 0;
CSingleLock lock(m_critInfo);
case STRING_IS_EMPTY:
// note: Get*Image() falls back to Get*Label(), so this should cover all of them
if (item && item->IsFileItem() && info.GetData1() >= LISTITEM_START && info.GetData1() < LISTITEM_END)
- bReturn = GetItemImage((const CFileItem *)item, info.GetData1()).IsEmpty();
+ bReturn = GetItemImage((const CFileItem *)item, info.GetData1()).empty();
else
- bReturn = GetImage(info.GetData1(), contextWindow).IsEmpty();
+ bReturn = GetImage(info.GetData1(), contextWindow).empty();
break;
case STRING_COMPARE:
{
else if (window->GetID() == WINDOW_DIALOG_VIDEO_INFO)
content = ((CGUIDialogVideoInfo *)window)->CurrentDirectory().GetContent();
}
- if (content.IsEmpty())
+ if (content.empty())
{
window = GetWindowWithCondition(contextWindow, WINDOW_CONDITION_IS_MEDIA_WINDOW);
if (window)
else if (info == SYSTEM_PROFILETHUMB)
{
CStdString thumb = CProfilesManager::Get().GetCurrentProfile().getThumb();
- if (thumb.IsEmpty())
+ if (thumb.empty())
thumb = "unknown-user.png";
return thumb;
}
if (!g_application.m_pPlayer->IsPlayingVideo()) return "";
if (fallback)
*fallback = "DefaultVideoCover.png";
- if(m_currentMovieThumb.IsEmpty())
+ if(m_currentMovieThumb.empty())
return m_currentFile->HasArt("thumb") ? m_currentFile->GetArt("thumb") : "DefaultVideoCover.png";
else return m_currentMovieThumb;
}
if (tag.GetDuration() > 0)
return StringUtils::SecondsToTimeString(tag.GetDuration(), format);
}
- if (g_application.m_pPlayer->IsPlayingVideo() && !m_currentMovieDuration.IsEmpty())
+ if (g_application.m_pPlayer->IsPlayingVideo() && !m_currentMovieDuration.empty())
return m_currentMovieDuration; // for tuxbox
unsigned int iTotal = (unsigned int)g_application.GetTotalTime();
if (iTotal > 0)
CStdString strRatingAndVotes;
if (m_currentFile->GetVideoInfoTag()->m_fRating > 0.f)
{
- if (m_currentFile->GetVideoInfoTag()->m_strVotes.IsEmpty())
+ if (m_currentFile->GetVideoInfoTag()->m_strVotes.empty())
strRatingAndVotes = StringUtils::Format("%.1f",
m_currentFile->GetVideoInfoTag()->m_fRating);
else
*m_currentFile = item;
m_currentFile->LoadMusicTag();
- if (m_currentFile->GetMusicInfoTag()->GetTitle().IsEmpty())
+ if (m_currentFile->GetMusicInfoTag()->GetTitle().empty())
{
// No title in tag, show filename only
m_currentFile->GetMusicInfoTag()->SetTitle(CUtil::GetTitleFromPath(m_currentFile->GetPath()));
// find a thumb for this file.
if (m_currentFile->IsInternetStream())
{
- if (!g_application.m_strPlayListFile.IsEmpty())
+ if (!g_application.m_strPlayListFile.empty())
{
CLog::Log(LOGDEBUG,"Streaming media detected... using %s to find a thumb", g_application.m_strPlayListFile.c_str());
CFileItem streamingItem(g_application.m_strPlayListFile,false);
}
// else its a video
- if (!g_application.m_strPlayListFile.IsEmpty())
+ if (!g_application.m_strPlayListFile.empty())
{
CLog::Log(LOGDEBUG,"Streaming media detected... using %s to find a thumb", g_application.m_strPlayListFile.c_str());
CFileItem thumbItem(g_application.m_strPlayListFile,false);
int ret = 0;
FILE *p = NULL;
- if (cmd.IsEmpty() || !(p = popen(cmd.c_str(), "r")))
+ if (cmd.empty() || !(p = popen(cmd.c_str(), "r")))
return CTemperature();
ret = fscanf(p, "%d %c", &value, &scale);
if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_fRating > 0.f) // movie rating
{
CStdString strRatingAndVotes;
- if (item->GetVideoInfoTag()->m_strVotes.IsEmpty())
+ if (item->GetVideoInfoTag()->m_strVotes.empty())
strRatingAndVotes = StringUtils::Format("%.1f",
item->GetVideoInfoTag()->m_fRating);
else
return item->GetPVRRecordingInfoTag()->m_strPlot;
if (item->HasVideoInfoTag())
{
- if (!(!item->GetVideoInfoTag()->m_strShowTitle.IsEmpty() && item->GetVideoInfoTag()->m_iSeason == -1)) // dont apply to tvshows
+ if (!(!item->GetVideoInfoTag()->m_strShowTitle.empty() && item->GetVideoInfoTag()->m_iSeason == -1)) // dont apply to tvshows
if (item->GetVideoInfoTag()->m_playCount == 0 && !CSettings::Get().GetBool("videolibrary.showunwatchedplots"))
return g_localizeStrings.Get(20370);
case LISTITEM_ICON:
{
CStdString strThumb = item->GetArt("thumb");
- if (strThumb.IsEmpty())
+ if (strThumb.empty())
strThumb = item->GetIconImage();
if (fallback)
*fallback = item->GetIconImage();
{
if (item->HasProperty("playlistposition"))
return (int)item->GetProperty("playlisttype").asInteger() == g_playlistPlayer.GetCurrentPlaylist() && (int)item->GetProperty("playlistposition").asInteger() == g_playlistPlayer.GetCurrentSong();
- else if (item->IsFileItem() && !m_currentFile->GetPath().IsEmpty())
+ else if (item->IsFileItem() && !m_currentFile->GetPath().empty())
{
- if (!g_application.m_strPlayListFile.IsEmpty())
+ if (!g_application.m_strPlayListFile.empty())
{
//playlist file that is currently playing or the playlistitem that is currently playing.
return g_application.m_strPlayListFile.Equals(((const CFileItem *)item)->GetPath()) || m_currentFile->IsSamePath((const CFileItem *)item);
m_currentFile->GetVideoInfoTag()->m_strTitle = g_tuxbox.vVideoSubChannel.current_name;
// Set m_currentMovieDuration
- if(!g_tuxbox.sCurSrvData.current_event_duration.IsEmpty() &&
- !g_tuxbox.sCurSrvData.next_event_description.IsEmpty() &&
+ if(!g_tuxbox.sCurSrvData.current_event_duration.empty() &&
+ !g_tuxbox.sCurSrvData.next_event_description.empty() &&
!g_tuxbox.sCurSrvData.current_event_duration.Equals("-") &&
!g_tuxbox.sCurSrvData.next_event_description.Equals("-"))
{
}
//Set strVideoGenre
- if (!g_tuxbox.sCurSrvData.current_event_description.IsEmpty() &&
- !g_tuxbox.sCurSrvData.next_event_description.IsEmpty() &&
+ if (!g_tuxbox.sCurSrvData.current_event_description.empty() &&
+ !g_tuxbox.sCurSrvData.next_event_description.empty() &&
!g_tuxbox.sCurSrvData.current_event_description.Equals("-") &&
!g_tuxbox.sCurSrvData.next_event_description.Equals("-"))
{
//Set m_currentMovie.m_director
if (!g_tuxbox.sCurSrvData.current_event_details.Equals("-") &&
- !g_tuxbox.sCurSrvData.current_event_details.IsEmpty())
+ !g_tuxbox.sCurSrvData.current_event_details.empty())
{
m_currentFile->GetVideoInfoTag()->m_director = StringUtils::Split(g_tuxbox.sCurSrvData.current_event_details, g_advancedSettings.m_videoItemSeparator);
}
else
loadPath = texturePath;
- if (m_use_cache && loadPath.IsEmpty())
+ if (m_use_cache && loadPath.empty())
{
// not in our texture cache, so try and load directly and then cache the result
loadPath = CTextureCache::Get().CacheImage(texturePath, &m_texture);
if (m_texture)
return true; // we're done
}
- if (!m_use_cache || !loadPath.IsEmpty())
+ if (!m_use_cache || !loadPath.empty())
{
// direct route - load the image
unsigned int start = XbmcThreads::SystemClockMillis();
if (!prompt)
return (profile->getLockMode() == LOCK_MODE_EVERYONE);
- if (profile->getDate().IsEmpty() &&
+ if (profile->getDate().empty() &&
(CProfilesManager::Get().GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE ||
profile->getLockMode() == LOCK_MODE_EVERYONE))
{
{
CRegion region(m_defaultRegion);
region.m_strName=pRegion->Attribute("name");
- if (region.m_strName.IsEmpty())
+ if (region.m_strName.empty())
region.m_strName="N/A";
if (pRegion->Attribute("locale"))
strSep = pToken->Attribute("separators");
if (pToken->FirstChild() && pToken->FirstChild()->Value())
{
- if (strSep.IsEmpty())
+ if (strSep.empty())
vecTokens.push_back(pToken->FirstChild()->Value());
else
for (unsigned int i=0;i<strSep.size();++i)
bool playlistLoaded;
m_bIsVideo = context == PARTYMODECONTEXT_VIDEO;
- if (!strXspPath.IsEmpty()) //if a path to a smartplaylist is supplied use it
+ if (!strXspPath.empty()) //if a path to a smartplaylist is supplied use it
partyModePath = strXspPath;
else if (m_bIsVideo)
partyModePath = CProfilesManager::Get().GetUserDataItem("PartyMode-Video.xsp");
// now add this on to the normal where clause
if (m_history.size())
{
- if (m_strCurrentFilterMusic.IsEmpty())
+ if (m_strCurrentFilterMusic.empty())
historyWhereMusic = "songview.idSong not in (";
else
historyWhereMusic = m_strCurrentFilterMusic + " and songview.idSong not in (";
- if (m_strCurrentFilterVideo.IsEmpty())
+ if (m_strCurrentFilterVideo.empty())
historyWhereVideo = "idMVideo not in (";
else
historyWhereVideo = m_strCurrentFilterVideo + " and idMVideo not in (";
void CPasswordManager::SaveAuthenticatedURL(const CURL &url, bool saveToProfile)
{
// don't store/save authenticated url if it doesn't contain username
- if (url.GetUserName().IsEmpty())
+ if (url.GetUserName().empty())
return;
CSingleLock lock(m_critSection);
{
CTextureDetails details;
CStdString cachedImage(GetCachedImage(url, details));
- return (!cachedImage.IsEmpty() && cachedImage != url);
+ return (!cachedImage.empty() && cachedImage != url);
}
CStdString CTextureCache::GetCachedImage(const CStdString &image, CTextureDetails &details, bool trackUsage)
CTextureDetails details;
CStdString path(GetCachedImage(url, details, true));
needsRecaching = !details.hash.empty();
- if (!path.IsEmpty())
+ if (!path.empty())
{
if (!needsRecaching && returnDDS && !URIUtils::IsInPath(url, "special://skin/")) // TODO: should skin images be .dds'd (currently they're not necessarily writeable)
{ // check for dds version
{
CTextureDetails details;
CStdString path(GetCachedImage(url, details));
- if (!path.IsEmpty() && details.hash.empty())
+ if (!path.empty() && details.hash.empty())
return; // image is already cached and doesn't need to be checked further
// needs (re)caching
{
CTextureDetails details;
CStdString cachedImage(GetCachedImage(image, details));
- if (!cachedImage.IsEmpty())
+ if (!cachedImage.empty())
{
CStdString dest = destination + URIUtils::GetExtension(cachedImage);
if (overwrite || !CFile::Exists(dest))
{
CTextureDetails details;
CStdString cachedImage(GetCachedImage(image, details));
- if (!cachedImage.IsEmpty())
+ if (!cachedImage.empty())
{
if (CFile::Cache(cachedImage, destination))
return true;
// check whether we need cache the job anyway
bool needsRecaching = false;
CStdString path(CTextureCache::Get().CheckCachedImage(m_url, false, needsRecaching));
- if (!path.IsEmpty() && !needsRecaching)
+ if (!path.empty() && !needsRecaching)
return false;
return CacheTexture();
}
m_details.file = m_cachePath + ".jpg";
if (out_texture)
*out_texture = LoadImage(CTextureCache::GetCachedPath(m_details.file), width, height, additional_info);
- CLog::Log(LOGDEBUG, "Fast %s image '%s' to '%s': %p", m_oldHash.IsEmpty() ? "Caching" : "Recaching", image.c_str(), m_details.file.c_str(), out_texture);
+ CLog::Log(LOGDEBUG, "Fast %s image '%s' to '%s': %p", m_oldHash.empty() ? "Caching" : "Recaching", image.c_str(), m_details.file.c_str(), out_texture);
return true;
}
#endif
else
m_details.file = m_cachePath + ".jpg";
- CLog::Log(LOGDEBUG, "%s image '%s' to '%s':", m_oldHash.IsEmpty() ? "Caching" : "Recaching", image.c_str(), m_details.file.c_str());
+ CLog::Log(LOGDEBUG, "%s image '%s' to '%s':", m_oldHash.empty() ? "Caching" : "Recaching", image.c_str(), m_details.file.c_str());
if (CPicture::CacheTexture(texture, width, height, CTextureCache::GetCachedPath(m_details.file)))
{
url.SetProtocol("image");
url.SetUserName(type);
url.SetHostName(image);
- if (!options.IsEmpty())
+ if (!options.empty())
{
url.SetFileName("transform");
url.SetOptions("?" + options);
if (StringUtils::StartsWith(image, "image://"))
{
CURL url(image);
- if (url.GetUserName().IsEmpty() && url.GetOptions().IsEmpty())
+ if (url.GetUserName().empty() && url.GetOptions().empty())
return url.GetHostName();
}
return image;
// no need to do anything if we already have a thumb set
CStdString thumb = item.GetArt("thumb");
- if (thumb.IsEmpty())
+ if (thumb.empty())
{ // see whether we have a cached image for this item
CProgramThumbLoader loader;
thumb = loader.GetCachedImage(item, "thumb");
- if (thumb.IsEmpty())
+ if (thumb.empty())
{
thumb = GetLocalThumb(item);
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
loader.SetCachedImage(item, "thumb", thumb);
}
}
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
{
CTextureCache::Get().BackgroundCacheImage(thumb);
item.SetArt("thumb", thumb);
}
else
{
- if (!m_strHostName.IsEmpty() && strURL[iEnd-1]=='/')
+ if (!m_strHostName.empty() && strURL[iEnd-1]=='/')
m_strFileName = m_strHostName + "/";
else
m_strFileName = m_strHostName;
if ((m_strProtocol == "rar" ||
m_strProtocol == "zip" ||
m_strProtocol == "apk") &&
- m_strFileName.IsEmpty())
+ m_strFileName.empty())
return URIUtils::GetFileName(m_strHostName);
// otherwise, we've already got the filepath, so just grab the filename portion
bool CURL::IsLocal() const
{
- return (IsLocalHost() || m_strProtocol.IsEmpty());
+ return (IsLocalHost() || m_strProtocol.empty());
}
bool CURL::IsLocalHost() const
{
CRSSDirectory dir;
CFileItemList items;
- if(dir.GetDirectory(strFileNameAndPath, items) && !items.m_strTitle.IsEmpty())
+ if(dir.GetDirectory(strFileNameAndPath, items) && !items.m_strTitle.empty())
return items.m_strTitle;
}
}
// Windows SMB Network (SMB)
- else if (url.GetProtocol() == "smb" && strFilename.IsEmpty())
+ else if (url.GetProtocol() == "smb" && strFilename.empty())
{
- if (url.GetHostName().IsEmpty())
+ if (url.GetHostName().empty())
{
strFilename = g_localizeStrings.Get(20171);
}
}
}
// iTunes music share (DAAP)
- else if (url.GetProtocol() == "daap" && strFilename.IsEmpty())
+ else if (url.GetProtocol() == "daap" && strFilename.empty())
strFilename = g_localizeStrings.Get(20174);
// HDHomerun Devices
- else if (url.GetProtocol() == "hdhomerun" && strFilename.IsEmpty())
+ else if (url.GetProtocol() == "hdhomerun" && strFilename.empty())
strFilename = "HDHomerun Devices";
// Slingbox Devices
strFilename = g_localizeStrings.Get(20258);
// SAP Streams
- else if (url.GetProtocol() == "sap" && strFilename.IsEmpty())
+ else if (url.GetProtocol() == "sap" && strFilename.empty())
strFilename = "SAP Streams";
// Root file views
else if (StringUtils::StartsWithNoCase(path, "special://videoplaylists"))
strFilename = g_localizeStrings.Get(136);
- else if (URIUtils::ProtocolHasParentInHostname(url.GetProtocol()) && strFilename.IsEmpty())
+ else if (URIUtils::ProtocolHasParentInHostname(url.GetProtocol()) && strFilename.empty())
strFilename = URIUtils::GetFileName(url.GetHostName());
// now remove the extension if needed
strTitle = strTitleAndYear.Trim();
// append year
- if (!strYear.IsEmpty())
+ if (!strYear.empty())
strTitleAndYear = strTitle + " (" + strYear + ")";
// restore extension if needed
{
// Check if the filename is a fully qualified URL such as protocol://path/to/file
CURL plItemUrl(strFilename);
- if (!plItemUrl.GetProtocol().IsEmpty())
+ if (!plItemUrl.GetProtocol().empty())
return;
// If the filename starts "x:", "\\" or "/" it's already fully qualified so return
}
#endif
- if (strPath.IsEmpty())
+ if (strPath.empty())
{
CStdString strHomePath = ResolveExecutablePath();
#if defined(TARGET_DARWIN)
bool CUtil::ExcludeFileOrFolder(const CStdString& strFileOrFolder, const CStdStringArray& regexps)
{
- if (strFileOrFolder.IsEmpty())
+ if (strFileOrFolder.empty())
return false;
CRegExp regExExcludes(true, true); // case insensitive regex
// whitespace handling - we skip any whitespace at the left or right of an unquoted parameter
if (ch == ' ' && !inQuotes)
{
- if (parameter.IsEmpty()) // skip whitespace on left
+ if (parameter.empty()) // skip whitespace on left
continue;
if (!whiteSpacePos) // make a note of where whitespace starts on the right
whiteSpacePos = parameter.size();
parameter.Delete(quotaPos);
}
}
- if (!parameter.IsEmpty() || parameters.size())
+ if (!parameter.empty() || parameters.size())
parameters.push_back(parameter);
}
int CUtil::GetMatchingSource(const CStdString& strPath1, VECSOURCES& VECSOURCES, bool& bIsSourceName)
{
- if (strPath1.IsEmpty())
+ if (strPath1.empty())
return -1;
// copy as we may change strPath
CStdString CUtil::TranslateSpecialSource(const CStdString &strSpecial)
{
- if (!strSpecial.IsEmpty() && strSpecial[0] == '$')
+ if (!strSpecial.empty() && strSpecial[0] == '$')
{
if (StringUtils::StartsWithNoCase(strSpecial, "$home"))
return URIUtils::AddFileToFolder("special://home/", strSpecial.Mid(5));
strAlbum.MakeLower();
double fAlbumPercentage = fstrcmp(strAlbumTemp, strAlbum, 0.0f);
double fArtistPercentage = 0.0f;
- if (!strArtist1.IsEmpty())
+ if (!strArtist1.empty())
{
CStdString strArtistTemp = strArtistTemp1;
strArtistTemp.MakeLower();
void CDateTime::SetFromDateString(const CStdString &date)
{
- if (date.IsEmpty())
+ if (date.empty())
{
SetValid(false);
return;
iDayPos = 0;
CStdString strMonth = date.Mid(iDayPos,iPos-iDayPos);
- if (strMonth.IsEmpty()) // assume dbdate format
+ if (strMonth.empty()) // assume dbdate format
{
SetFromDBDate(date);
return;
CStdString CDateTime::GetAsLocalizedTime(const CStdString &format, bool withSeconds) const
{
CStdString strOut;
- const CStdString& strFormat = format.IsEmpty() ? g_langInfo.GetTimeFormat() : format;
+ const CStdString& strFormat = format.empty() ? g_langInfo.GetTimeFormat() : format;
SYSTEMTIME dateTime;
GetAsSystemTime(dateTime);
license = CAddonMgr::Get().GetExtValue(metadata->configuration, "license");
CStdString language;
language = CAddonMgr::Get().GetExtValue(metadata->configuration, "language");
- if (!language.IsEmpty())
+ if (!language.empty())
extrainfo.insert(make_pair("language",language));
broken = CAddonMgr::Get().GetExtValue(metadata->configuration, "broken");
EMPTY_IF("nofanart",fanart)
CAddon::CAddon(const AddonProps &props)
: m_props(props)
{
- if (props.libname.IsEmpty()) BuildLibName();
+ if (props.libname.empty()) BuildLibName();
else m_strLibName = props.libname;
BuildProfilePath();
m_userSettingsPath = URIUtils::AddFileToFolder(Profile(), "settings.xml");
CStdString sql = PrepareSQL("delete from broken where addonID='%s'", addonID.c_str());
m_pDS->exec(sql);
- if (!reason.IsEmpty())
+ if (!reason.empty())
{ // broken
sql = PrepareSQL("insert into broken(id, addonID, reason) values(NULL, '%s', '%s')", addonID.c_str(),reason.c_str());
m_pDS->exec(sql);
CStdString strWhereClause = PrepareSQL("addonID = '%s'", addonID.c_str());
CStdString strHasAddon = GetSingleValue("addon", "id", strWhereClause);
- return !strHasAddon.IsEmpty();
+ return !strHasAddon.empty();
}
bool CAddonDatabase::IsAddonDisabled(const CStdString &addonID)
CStdString strWhereClause = PrepareSQL("addonID = '%s'", addonID.c_str());
CStdString strEnabled = GetSingleValue("pvrenabled", "id", strWhereClause);
- return !strEnabled.IsEmpty();
+ return !strEnabled.empty();
}
CStdString CAddonDatabase::IsAddonBroken(const CStdString &addonID)
const CStdString& version)
{
CStdString where = PrepareSQL("addonID='%s' and version='%s'",addonID.c_str(),version.c_str());
- return !GetSingleValue("blacklist","addonID",where).IsEmpty();
+ return !GetSingleValue("blacklist","addonID",where).empty();
}
bool CAddonDatabase::RemoveAddonFromBlacklist(const CStdString& addonID,
m_bIsChild(false)
{
// if library attribute isn't present, look for a system-dependent one
- if (ext && m_strLibName.IsEmpty())
+ if (ext && m_strLibName.empty())
{
#if defined(TARGET_ANDROID)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_android");
{
AddonPtr repoPtr = GetRepoForAddon(m_addon);
CStdString installFrom;
- if (!repoPtr || repoPtr->Props().libname.IsEmpty())
+ if (!repoPtr || repoPtr->Props().libname.empty())
{
// Addons are installed by downloading the .zip package on the server to the local
// packages folder, then extracting from the local .zip package into the addons folder
{
// zip passed in - download + extract
CStdString path(m_addon->Path());
- if (!m_referer.IsEmpty() && URIUtils::IsInternetStream(path))
+ if (!m_referer.empty() && URIUtils::IsInternetStream(path))
{
CURL url(path);
url.SetProtocolOptions(m_referer);
bool CAddonInstallJob::CheckHash(const CStdString& zipFile)
{
- if (m_hash.IsEmpty())
+ if (m_hash.empty())
return true;
CStdString md5 = CUtil::GetFileMD5(zipFile);
if (!md5.Equals(m_hash))
AddonPtr repoPtr = CAddonInstallJob::GetRepoForAddon(m_addon);
RepositoryPtr therepo = boost::dynamic_pointer_cast<CRepository>(repoPtr);
- if (therepo && !therepo->Props().libname.IsEmpty())
+ if (therepo && !therepo->Props().libname.empty())
{
CFileItemList dummy;
CStdString s = StringUtils::Format("plugin://%s/?action=uninstall"
if (!base || !path)
return false;
CStdString all = m_cpluff->lookup_cfg_value(base, path);
- if (all.IsEmpty())
+ if (all.empty())
return false;
StringUtils::SplitString(all, " ", result);
return true;
AddonVersion::AddonVersion(const CStdString& version)
{
m_originalVersion = version;
- if (m_originalVersion.IsEmpty())
+ if (m_originalVersion.empty())
m_originalVersion = "0.0.0";
const char *epoch_end = strchr(m_originalVersion.c_str(), ':');
if (epoch_end != NULL)
if (i == (unsigned int)atoi(value))
selected = i;
CStdString localized = m_addon->GetString(atoi(valuesVec[i].c_str()));
- if (localized.IsEmpty())
+ if (localized.empty())
localized = g_localizeStrings.Get(atoi(valuesVec[i].c_str()));
valuesVec[i] = localized;
}
else if (strcmpi(type, "action") == 0)
{
CStdString action = setting->Attribute("action");
- if (!action.IsEmpty())
+ if (!action.empty())
{
// replace $CWD with the url of plugin/script
action.Replace("$CWD", m_addon->Path());
else if (strcmp(type, "date") == 0)
{
CDateTime date;
- if (!value.IsEmpty())
+ if (!value.empty())
date.SetFromDBDate(value);
SYSTEMTIME timedate;
date.GetAsSystemTime(timedate);
else if (strcmp(type, "time") == 0)
{
SYSTEMTIME timedate;
- if (!value.IsEmpty())
+ if (!value.empty())
{
// assumes HH:MM
timedate.wHour = atoi(value.Left(2));
CGUIButtonControl *button = originalButton ? originalButton->Clone() : NULL;
CStdString label = GetString(category->Attribute("label"));
- if (label.IsEmpty())
+ if (label.empty())
label = g_localizeStrings.Get(128);
// add the category button
if (!pControl) return;
((CGUISpinControlEx *)pControl)->SetText(label);
- if (!lvalues.IsEmpty())
+ if (!lvalues.empty())
StringUtils::Tokenize(lvalues, valuesVec, "|");
else if (values.Equals("$HOURS"))
{
}
else
StringUtils::Tokenize(values, valuesVec, "|");
- if (!entries.IsEmpty())
+ if (!entries.empty())
StringUtils::Tokenize(entries, entryVec, "|");
if(bSort && strcmpi(type, "labelenum") == 0)
int iAdd = i;
if (entryVec.size() > i)
iAdd = atoi(entryVec[i].c_str());
- if (!lvalues.IsEmpty())
+ if (!lvalues.empty())
{
CStdString replace = m_addon->GetString(atoi(valuesVec[i].c_str()));
- if (replace.IsEmpty())
+ if (replace.empty())
replace = g_localizeStrings.Get(atoi(valuesVec[i].c_str()));
((CGUISpinControlEx *)pControl)->AddLabel(replace, iAdd);
}
StringUtils::SplitString(addonIDslist, ",", addons);
for (CStdStringArray::const_iterator it = addons.begin(); it != addons.end() ; it ++)
{
- if (!retVal.IsEmpty())
+ if (!retVal.empty())
retVal += ", ";
AddonPtr addon;
if (CAddonMgr::Get().GetAddon(*it ,addon))
bool hideExtensions = (options.CompareNoCase("hideext") == 0);
// fetch directory
CFileItemList items;
- if (!mask.IsEmpty())
+ if (!mask.empty())
CDirectory::GetDirectory(fullPath, items, mask, XFILE::DIR_FLAG_NO_FILE_DIRS);
else
CDirectory::GetDirectory(fullPath, items, "", XFILE::DIR_FLAG_NO_FILE_DIRS);
bool CGUIDialogAddonSettings::GetCondition(const CStdString &condition, const int controlId)
{
- if (condition.IsEmpty()) return true;
+ if (condition.empty()) return true;
bool bCondition = true;
bool bCompare = true;
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
- if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
+ if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
m_vecItems->SetPath("");
}
break;
}
}
- if (strDirectory.IsEmpty() && CAddonInstaller::Get().IsDownloading())
+ if (strDirectory.empty() && CAddonInstaller::Get().IsDownloading())
{
CFileItemPtr item(new CFileItem("addons://downloading/",true));
item->SetLabel(g_localizeStrings.Get(24067));
int CGUIWindowAddonBrowser::SelectAddonID(const vector<ADDON::TYPE> &types, CStdString &addonID, bool showNone /*= false*/)
{
CStdStringArray addonIDs;
- if (!addonID.IsEmpty())
+ if (!addonID.empty())
addonIDs.push_back(addonID);
int retval = SelectAddonID(types, addonIDs, showNone, false);
if (addonIDs.size() > 0)
items.Add(item);
}
- if (!heading.IsEmpty())
+ if (!heading.empty())
heading += ", ";
heading += TranslateType(*it, true);
}
if (ext)
{
provides = CAddonMgr::Get().GetExtValue(ext->configuration, "provides");
- if (!provides.IsEmpty())
+ if (!provides.empty())
Props().extrainfo.insert(make_pair("provides", provides));
}
SetProvides(provides);
void CPluginSource::SetProvides(const CStdString &content)
{
vector<CStdString> provides;
- if (!content.IsEmpty())
+ if (!content.empty())
{
StringUtils::SplitString(content, " ", provides);
for (unsigned int i = 0; i < provides.size(); ++i)
#define SET_IF_NOT_EMPTY(x,y) \
{ \
- if (!x.IsEmpty()) \
+ if (!x.empty()) \
x = y; \
}
addon->Name(),TOAST_DISPLAY_TIME,false,TOAST_DISPLAY_TIME);
}
}
- if (!addons[i]->Props().broken.IsEmpty())
+ if (!addons[i]->Props().broken.empty())
{
- if (database.IsAddonBroken(addons[i]->ID()).IsEmpty())
+ if (database.IsAddonBroken(addons[i]->ID()).empty())
{
std::string line = g_localizeStrings.Get(24096);
if (addons[i]->Props().broken == "DEPSNOTMET")
m_language = CAddonMgr::Get().GetExtValue(ext->configuration, "@language");
m_requiressettings = CAddonMgr::Get().GetExtValue(ext->configuration,"@requiressettings").Equals("true");
CStdString persistence = CAddonMgr::Get().GetExtValue(ext->configuration, "@cachepersistence");
- if (!persistence.IsEmpty())
+ if (!persistence.empty())
m_persistence.SetFromTimeString(persistence);
}
switch (Type())
if (!LoadSettings())
return false;
- if (xml.IsEmpty())
+ if (xml.empty())
return true;
CXBMCTinyXML doc;
throw CScraperError();
CStdString strXML = InternalRun(function,scrURL,http,extras);
- if (strXML.IsEmpty())
+ if (strXML.empty())
{
if (function != "NfoUrl" && function != "ResolveIDToUrl")
CLog::Log(LOGERROR, "%s: Unable to parse web site",__FUNCTION__);
vector<CStdString> vcsIn(1);
g_charsetConverter.utf8To(SearchStringEncoding(), sTitle, vcsIn[0]);
CURL::Encode(vcsIn[0]);
- if (!sYear.IsEmpty())
+ if (!sYear.empty())
vcsIn.push_back(sYear);
// request a search URL from the title/filename/etc.
else
{ // no resolutions specified -> backward compatibility
CStdString defaultWide = CAddonMgr::Get().GetExtValue(ext->configuration, "@defaultwideresolution");
- if (defaultWide.IsEmpty())
+ if (defaultWide.empty())
defaultWide = CAddonMgr::Get().GetExtValue(ext->configuration, "@defaultresolution");
TranslateResolution(defaultWide, m_defaultRes);
}
CStdString str = CAddonMgr::Get().GetExtValue(ext->configuration, "@effectslowdown");
- if (!str.IsEmpty())
+ if (!str.empty())
m_effectsSlowDown = (float)atof(str.c_str());
else
m_effectsSlowDown = 1.f;
return ""; // invalid skin
CStdString strPathToUse = Path();
- if (!strBaseDir.IsEmpty())
+ if (!strBaseDir.empty())
strPathToUse = strBaseDir;
// if the caller doesn't care about the resolution just use a temporary
if (file.IsRemote())
m_output = SetupTempFile();
- if (m_output.IsEmpty())
+ if (m_output.empty())
{
CLog::Log(LOGERROR, "CCDDARipper: Error opening file");
return false;
CStdString strAlbumDir = GetAlbumDirName(infoTag);
- if (!strAlbumDir.IsEmpty())
+ if (!strAlbumDir.empty())
{
strDirectory = URIUtils::AddFileToFolder(strDirectory, strAlbumDir);
URIUtils::AddSlashAtEnd(strDirectory);
if (strAlbumDir.Find("%A") != -1)
{
CStdString strAlbumArtist = StringUtils::Join(infoTag.GetAlbumArtist(), g_advancedSettings.m_musicItemSeparator);
- if (strAlbumArtist.IsEmpty())
+ if (strAlbumArtist.empty())
strAlbumArtist = StringUtils::Join(infoTag.GetArtist(), g_advancedSettings.m_musicItemSeparator);
- if (strAlbumArtist.IsEmpty())
+ if (strAlbumArtist.empty())
strAlbumArtist = "Unknown Artist";
else
strAlbumArtist.Replace('/', '_');
if (strAlbumDir.Find("%B") != -1)
{
CStdString strAlbum = infoTag.GetAlbum();
- if (strAlbum.IsEmpty())
+ if (strAlbum.empty())
strAlbum = StringUtils::Format("Unknown Album %s", CDateTime::GetCurrentDateTime().GetAsLocalizedDateTime().c_str());
else
strAlbum.Replace('/', '_');
if (strAlbumDir.Find("%G") != -1)
{
CStdString strGenre = StringUtils::Join(infoTag.GetGenre(), g_advancedSettings.m_musicItemSeparator);
- if (strGenre.IsEmpty())
+ if (strGenre.empty())
strGenre = "Unknown Genre";
else
strGenre.Replace('/', '_');
if (strAlbumDir.Find("%Y") != -1)
{
CStdString strYear = infoTag.GetYearString();
- if (strYear.IsEmpty())
+ if (strYear.empty())
strYear = "Unknown Year";
else
strYear.Replace('/', '_');
// grab the label to use it as our ripped filename
CStdString track = destItem.GetLabel();
- if (track.IsEmpty())
+ if (track.empty())
track = StringUtils::Format("%s%02i", "Track-", trackNumber);
track += GetExtension(CSettings::Get().GetInt("audiocds.encoder"));
#endif
// check if we are running as real xbmc.app or just binary
- if (!CUtil::GetFrameworksPath(true).IsEmpty())
+ if (!CUtil::GetFrameworksPath(true).empty())
{
// using external python, it's build looking for xxx/lib/python2.6
// so point it to frameworks which is where python2.6 is located
if (m_bAbortRequest) return false;
- BOOL ret = CreateProcessW(WstrPath.IsEmpty() ? NULL : WstrPath.c_str(),
+ BOOL ret = CreateProcessW(WstrPath.empty() ? NULL : WstrPath.c_str(),
(LPWSTR) WstrSwitches.c_str(), NULL, NULL, FALSE, NULL,
NULL, NULL, &si, &m_processInfo);
XMLUtils::GetString(pReplacer,"pat",strPat);
XMLUtils::GetString(pReplacer,"rep",strRep);
- if (!strPat.IsEmpty() && !strRep.IsEmpty())
+ if (!strPat.empty() && !strRep.empty())
{
CLog::Log(LOGDEBUG," Registering replacer:");
CLog::Log(LOGDEBUG," Match:[%s] Pattern:[%s] Replacement:[%s]", strMatch.c_str(), strPat.c_str(), strRep.c_str());
else
{
// error message about missing tag
- if (strPat.IsEmpty())
+ if (strPat.empty())
CLog::Log(LOGERROR," Missing <Pat> tag");
else
CLog::Log(LOGERROR," Missing <Rep> tag");
free(bgnStyle);
free(endStyle);
- if (strUTF8.IsEmpty())
+ if (strUTF8.empty())
return OC_BUFFER;
if (strUTF8[strUTF8.size()-1] == '\n')
if (m_pFilterGraph)
FilterClose();
- if (filters.IsEmpty() && !scale)
+ if (filters.empty() && !scale)
return 0;
if (m_pHardware)
add a new buffer next time it writes to the log */
std::map<uintptr_t, CStdString>::iterator it;
for (it = g_logbuffer.begin(); it != g_logbuffer.end(); )
- if ((*it).second.IsEmpty())
+ if ((*it).second.empty())
g_logbuffer.erase(it++);
else
++it;
if(!m_session.Connect(url.GetHostName(), url.GetPort()))
return false;
- if(!url.GetUserName().IsEmpty())
+ if(!url.GetUserName().empty())
m_session.Auth(url.GetUserName(), url.GetPassWord());
m_session.SendEnableAsync();
}
}
const char *lang = NULL;
- if (!strClassID.IsEmpty())
+ if (!strClassID.empty())
lang = strClassID.c_str();
CDVDOverlayText* pOverlay = NULL;
}
}
- if (strUTF8.IsEmpty())
+ if (strUTF8.empty())
return;
if( strUTF8[strUTF8.size()-1] == '\n' )
pos = del_start;
m_flag[FLAG_LANGUAGE] = false;
}
- else if (fullTag == "<br>" && !strUTF8.IsEmpty())
+ else if (fullTag == "<br>" && !strUTF8.empty())
{
strUTF8.Insert(pos, "\n");
pos += 1;
if(m_flag[FLAG_LANGUAGE])
strUTF8.erase(del_start);
- if (strUTF8.IsEmpty())
+ if (strUTF8.empty())
return;
if( strUTF8[strUTF8.size()-1] == '\n' )
if (HasSceneMarker())
strInfo.AppendFormat("s%i", m_vecSceneMarkers.size());
- return strInfo.IsEmpty() ? "-" : strInfo;
+ return strInfo.empty() ? "-" : strInfo;
}
bool CEdl::InCut(const int64_t iSeek, Cut *pCut)
// for music file, don't open artwork as video
bool disabled = false;
CStdString extension = URIUtils::GetExtension(m_filename);
- if (!extension.IsEmpty() && g_advancedSettings.m_musicExtensions.Find(extension.ToLower()) != -1)
+ if (!extension.empty() && g_advancedSettings.m_musicExtensions.Find(extension.ToLower()) != -1)
{
CLog::Log(LOGWARNING, "%s - Ignoring video in audio filetype:%s", __FUNCTION__, m_filename.c_str());
disabled = true;
void CPlayerSelectionRule::Initialize(TiXmlElement* pRule)
{
m_name = pRule->Attribute("name");
- if (!m_name || m_name.IsEmpty())
+ if (!m_name || m_name.empty())
m_name = "un-named";
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::Initialize: creating rule: %s", m_name.c_str());
bool bReturn = true;
CStdString strQueryBase = "DELETE FROM %s";
- if (!strWhereClause.IsEmpty())
+ if (!strWhereClause.empty())
strQueryBase.AppendFormat(" WHERE %s", strWhereClause.c_str());
CStdString strQuery = FormatSQL(strQueryBase, strTable.c_str());
bool CDatabase::QueueInsertQuery(const CStdString &strQuery)
{
- if (strQuery.IsEmpty())
+ if (strQuery.empty())
return false;
if (!m_bMultiWrite)
if ( dbSettings.type.Equals("mysql") )
{
// check we have all information before we cancel the fallback
- if ( ! (dbSettings.host.IsEmpty() ||
- dbSettings.user.IsEmpty() || dbSettings.pass.IsEmpty()) )
+ if ( ! (dbSettings.host.empty() ||
+ dbSettings.user.empty() || dbSettings.pass.empty()) )
m_sqlite = false;
else
CLog::Log(LOGINFO, "Essential mysql database information is missing. Require at least host, user and pass defined.");
#endif
{
dbSettings.type = "sqlite3";
- if (dbSettings.host.IsEmpty())
+ if (dbSettings.host.empty())
dbSettings.host = CSpecialProtocol::TranslatePath(CProfilesManager::Get().GetDatabaseFolder());
}
// use separate, versioned database
- if (dbSettings.name.IsEmpty())
+ if (dbSettings.name.empty())
dbSettings.name = GetBaseDBName();
}
// host name is always required
m_pDB->setHostName(dbSettings.host.c_str());
- if (!dbSettings.port.IsEmpty())
+ if (!dbSettings.port.empty())
m_pDB->setPort(dbSettings.port.c_str());
- if (!dbSettings.user.IsEmpty())
+ if (!dbSettings.user.empty())
m_pDB->setLogin(dbSettings.user.c_str());
- if (!dbSettings.pass.IsEmpty())
+ if (!dbSettings.pass.empty())
m_pDB->setPasswd(dbSettings.pass.c_str());
// database name is always required
StringUtils::SplitString(param, ",", split);
for (CStdStringArray::iterator itIn = split.begin(); itIn != split.end(); ++itIn)
{
- if (!parameter.IsEmpty())
+ if (!parameter.empty())
parameter += ",";
parameter += db.PrepareSQL("'%s'", (*itIn).Trim().c_str());
}
rule += "(";
CStdString currentRule = (*it)->GetWhereClause(db, strType);
// if we don't get a rule, we add '1' or '0' so the query is still valid and doesn't fail
- if (currentRule.IsEmpty())
+ if (currentRule.empty())
currentRule = m_type == CombinationAnd ? "'1'" : "'0'";
rule += currentRule;
rule += ")";
{
if (m_pDlg)
{
- if (m_strHeader.IsEmpty())
+ if (m_strHeader.empty())
m_pDlg->SetHeading(438);
else
m_pDlg->SetHeading(m_strHeader);
buttons.Add(CONTEXT_BUTTON_SET_THUMB, 20019);
}
- if (!GetDefaultShareNameByType(type).IsEmpty())
+ if (!GetDefaultShareNameByType(type).empty())
buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // Clear Default
buttons.Add(CONTEXT_BUTTON_ADD_SOURCE, 1026); // Add Source
if (CGUIDialogYesNo::ShowAndGetInput(751, 0, 750, 0))
{ // check default before we delete, as deletion will kill the share object
CStdString defaultSource(GetDefaultShareNameByType(type));
- if (!defaultSource.IsEmpty())
+ if (!defaultSource.empty())
{
if (share->strName.Equals(defaultSource))
ClearDefault(type);
CFileItemList items;
// add the current thumb, if available
- if (!share->m_strThumbnailImage.IsEmpty())
+ if (!share->m_strThumbnailImage.empty())
{
CFileItemPtr current(new CFileItem("thumb://Current", false));
current->SetArt("thumb", share->m_strThumbnailImage);
CMediaSourceSettings::Get().UpdateSource(type,share->strName,"thumbnail",strThumb);
CMediaSourceSettings::Get().Save();
}
- else if (!strThumb.IsEmpty())
+ else if (!strThumb.empty())
{ // this is some sort of an auto-share, so store in the texture database
CTextureDatabase db;
if (db.Open())
GoParentFolder();
return true;
}
- if ((action.GetID() == ACTION_CONTEXT_MENU || action.GetID() == ACTION_MOUSE_RIGHT_CLICK) && m_Directory->GetPath().IsEmpty())
+ if ((action.GetID() == ACTION_CONTEXT_MENU || action.GetID() == ACTION_MOUSE_RIGHT_CLICK) && m_Directory->GetPath().empty())
{
int iItem = m_viewControl.GetSelectedItem();
- if ((!m_addSourceType.IsEmpty() && iItem != m_vecItems->Size()-1))
+ if ((!m_addSourceType.empty() && iItem != m_vecItems->Size()-1))
return OnPopupMenu(iItem);
if (m_addNetworkShareEnabled && g_mediaManager.HasLocation(m_selectedPath))
{
{
strSelectedItem = pItem->GetPath();
URIUtils::RemoveSlashAtEnd(strSelectedItem);
- m_history.SetSelectedItem(strSelectedItem, m_Directory->GetPath().IsEmpty()?"empty":m_Directory->GetPath());
+ m_history.SetSelectedItem(strSelectedItem, m_Directory->GetPath().empty()?"empty":m_Directory->GetPath());
}
}
// if we're getting the root source listing
// make sure the path history is clean
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
m_history.ClearPathHistory();
// some evil stuff don't work with the '/' mask, e.g. shoutcast directory - make sure no files are in there
OnSort();
- if (m_Directory->GetPath().IsEmpty() && m_addNetworkShareEnabled &&
+ if (m_Directory->GetPath().empty() && m_addNetworkShareEnabled &&
(CProfilesManager::Get().GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE ||
CProfilesManager::Get().IsMasterProfile() || g_passwordManager.bMasterUser))
{ // we are in the virtual directory - add the "Add Network Location" item
pItem->m_bIsFolder = true;
m_vecItems->Add(pItem);
}
- if (m_Directory->GetPath().IsEmpty() && !m_addSourceType.IsEmpty())
+ if (m_Directory->GetPath().empty() && !m_addSourceType.empty())
{
CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(21359)));
pItem->SetPath("source://");
OnAddMediaSource();
return;
}
- if (!m_addSourceType.IsEmpty())
+ if (!m_addSourceType.empty())
{
OnEditMediaSource(pItem.get());
return;
g_windowManager.AddUniqueInstance(browser);
VECSOURCES shares;
- if (!strType.IsEmpty())
+ if (!strType.empty())
{
if (additionalShare)
shares = *additionalShare;
void CGUIDialogFileBrowser::SetSources(const VECSOURCES &shares)
{
m_shares = shares;
- if (!m_shares.size() && m_addSourceType.IsEmpty())
+ if (!m_shares.size() && m_addSourceType.empty())
g_mediaManager.GetLocalDrives(m_shares);
m_rootDir.SetSources(m_shares);
}
bool CGUIDialogFileBrowser::OnPopupMenu(int iItem)
{
CContextButtons choices;
- choices.Add(1, m_addSourceType.IsEmpty() ? 20133 : 21364);
- choices.Add(2, m_addSourceType.IsEmpty() ? 20134 : 21365);
+ choices.Add(1, m_addSourceType.empty() ? 20133 : 21364);
+ choices.Add(2, m_addSourceType.empty() ? 20134 : 21365);
int btnid = CGUIDialogContextMenu::ShowAndGetChoice(choices);
if (btnid == 1)
return false;
}
- if (strUserInput.IsEmpty())
+ if (strUserInput.empty())
// user canceled out
return false;
return false;
}
- if (strUserInput.IsEmpty())
+ if (strUserInput.empty())
// user canceled out
return false;
return 0;
}
- if (strPassTemp.IsEmpty())
+ if (strPassTemp.empty())
// user canceled out
return -1;
{
CStdString strTypeImage = toast.imagefile;
- if (strTypeImage.IsEmpty())
+ if (strTypeImage.empty())
{
CGUIImage *typeImage = NULL;
}
else if (action.GetID() == ACTION_CURSOR_RIGHT)
{
- if (m_strEditing.IsEmpty() && (unsigned int) GetCursorPos() == m_strEdit.size() && (m_strEdit.size() == 0 || m_strEdit[m_strEdit.size() - 1] != ' '))
+ if (m_strEditing.empty() && (unsigned int) GetCursorPos() == m_strEdit.size() && (m_strEdit.size() == 0 || m_strEdit[m_strEdit.size() - 1] != ' '))
{ // add a space
Character(L' ');
}
}
else if (action.GetID() >= KEY_VKEY && action.GetID() < KEY_ASCII)
{ // input from the keyboard (vkey, not ascii)
- if (!m_strEditing.IsEmpty())
+ if (!m_strEditing.empty())
return handled;
uint8_t b = action.GetID() & 0xFF;
if (b == XBMCVK_HOME)
{
CStdStringW newStr;
g_charsetConverter.utf8ToW(aTextString, newStr);
- if (!newStr.IsEmpty())
+ if (!newStr.empty())
{
m_strEditing.clear();
m_iEditingOffset = 0;
else
edit.append(m_strEdit.size(), L'*');
}
- else if (!m_strEditing.IsEmpty())
+ else if (!m_strEditing.empty())
{
edit.Insert(m_iCursorPos, m_strEditing);
pEdit->SetHighlight(m_iCursorPos, m_iCursorPos + m_strEditing.size());
if (m_pCharCallback)
{
// do not send editing text comes from system input method
- if (!m_hiddenInput && !m_strEditing.IsEmpty())
+ if (!m_hiddenInput && !m_strEditing.empty())
g_charsetConverter.wToUTF8(m_strEdit, utf8Edit);
m_pCharCallback(this, utf8Edit);
}
void CGUIDialogKeyboardGeneric::MoveCursor(int iAmount)
{
- if (!m_strEditing.IsEmpty())
+ if (!m_strEditing.empty())
return;
SetCursorPos(GetCursorPos() + iAmount);
}
{
if (item < m_paths->Size()) // if the skin does funky things, m_paths may have been cleared
m_paths->Get(item)->SetPath(path);
- if (!m_bNameChanged || m_name.IsEmpty())
+ if (!m_bNameChanged || m_name.empty())
{
CURL url(path);
m_name = url.GetWithoutUserDetails();
CGUIKeyboardFactory::ShowAndGetInput(path, g_localizeStrings.Get(1021), false);
m_paths->Get(item)->SetPath(path);
- if (!m_bNameChanged || m_name.IsEmpty())
+ if (!m_bNameChanged || m_name.empty())
{
CURL url(m_paths->Get(item)->GetPath());
m_name = url.GetWithoutUserDetails();
if (!m_paths->Size()) // sanity
return;
- CONTROL_ENABLE_ON_CONDITION(CONTROL_OK, !m_paths->Get(0)->GetPath().IsEmpty() && !m_name.IsEmpty());
- CONTROL_ENABLE_ON_CONDITION(CONTROL_PATH_ADD, !m_paths->Get(0)->GetPath().IsEmpty());
+ CONTROL_ENABLE_ON_CONDITION(CONTROL_OK, !m_paths->Get(0)->GetPath().empty() && !m_name.empty());
+ CONTROL_ENABLE_ON_CONDITION(CONTROL_PATH_ADD, !m_paths->Get(0)->GetPath().empty());
CONTROL_ENABLE_ON_CONDITION(CONTROL_PATH_REMOVE, m_paths->Size() > 1);
// name
SET_CONTROL_LABEL2(CONTROL_NAME, m_name);
CStdString path;
CURL url(item->GetPath());
path = url.GetWithoutUserDetails();
- if (path.IsEmpty()) path = "<"+g_localizeStrings.Get(231)+">"; // <None>
+ if (path.empty()) path = "<"+g_localizeStrings.Get(231)+">"; // <None>
item->SetLabel(path);
}
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_PATH, 0, 0, m_paths);
vector<CStdString> paths;
for (int i = 0; i < m_paths->Size(); i++)
{
- if (!m_paths->Get(i)->GetPath().IsEmpty())
+ if (!m_paths->Get(i)->GetPath().empty())
{ // strip off the user and password for smb paths (anything that the password manager can auth)
// and add the user/pass to the password manager - note, we haven't confirmed that it works
// at this point, but if it doesn't, the user will get prompted anyway in SMBDirectory.
}
if (m_mode == INPUT_NUMBER || m_mode == INPUT_PASSWORD)
{ // just go back one character
- if (!m_number.IsEmpty())
+ if (!m_number.empty())
m_number.Delete(m_number.GetLength() - 1);
}
else if (m_mode == INPUT_IP_ADDRESS)
return false;
}
- if (strUserInput.IsEmpty())
+ if (strUserInput.empty())
// user canceled out
return false;
CStdString strPassTemp = strPassword;
if (ShowAndVerifyInput(strPassTemp, strTempHeading, true))
return 0; // user entered correct password
- if (strPassTemp.IsEmpty()) return -1; // user canceled out
+ if (strPassTemp.empty()) return -1; // user canceled out
return 1; // user must have entered an incorrect password
}
}
// Use the label for Line 1 if not defined
- if (strLine1.IsEmpty())
+ if (strLine1.empty())
strLine1 = item.GetLabel();
// Setup dialog parameters
void CGUIDialogSmartPlaylistEditor::OnOK()
{
// save our playlist
- if (m_path.IsEmpty())
+ if (m_path.empty())
{
CStdString filename(CUtil::MakeLegalFileName(m_playlist.m_playlistName));
CStdString path;
bGrabSuccess = (g_PVRClients->GetEPGForChannel(*channel, this, start, end) == PVR_ERROR_NO_ERROR);
}
}
- else if (m_strScraperName.IsEmpty()) /* no grabber defined */
+ else if (m_strScraperName.empty()) /* no grabber defined */
CLog::Log(LOGWARNING, "EPG - %s - no EPG scraper defined for table '%s'", __FUNCTION__, m_strName.c_str());
else
{
CStdString strWhereClause = FormatSQL("idEpg = %u", iEpgId);
CStdString strValue = GetSingleValue("lastepgscan", "sLastScan", strWhereClause);
- if (!strValue.IsEmpty())
+ if (!strValue.empty())
{
lastScan->SetFromDBDateTime(strValue.c_str());
bReturn = true;
{
bool bReturn(true);
- if (!m_strSearchTerm.IsEmpty())
+ if (!m_strSearchTerm.empty())
{
CTextSearch search(m_strSearchTerm, m_bIsCaseSensitive, SEARCH_DEFAULT_OR);
bReturn = search.Search(tag.Title()) ||
CURL url(strPath);
CAfpConnection::afpConnnectError afpError = gAfpConnection.Connect(url);
- if (afpError != CAfpConnection::AfpOk || (!url.GetShareName().IsEmpty() && !gAfpConnection.GetVolume()))
+ if (afpError != CAfpConnection::AfpOk || (!url.GetShareName().empty() && !gAfpConnection.GetVolume()))
{
if (afpError == CAfpConnection::AfpAuth)
{
struct afp_file_info *curDirPtr = NULL;
// if no share name in url - try to fetch the volumes on the server and treat them like folders
- if (url.GetShareName().IsEmpty())
+ if (url.GetShareName().empty())
{
bListVolumes = true;
struct afp_server *serv = gAfpConnection.GetServer();
strncpy(m_pAfpUrl->uamname, "No User Authent", sizeof(m_pAfpUrl->uamname));
CLog::Log(LOGDEBUG, "AFP: Using anonymous authentication.");
}
- else if ((nonConstUrl.GetPassWord().IsEmpty() || nonConstUrl.GetUserName().IsEmpty()) && serverChanged)
+ else if ((nonConstUrl.GetPassWord().empty() || nonConstUrl.GetUserName().empty()) && serverChanged)
{
// this is our current url object whe are connected to (at least we try)
return AfpAuth;
}
// we got a password in the url
- if (!nonConstUrl.GetPassWord().IsEmpty())
+ if (!nonConstUrl.GetPassWord().empty())
{
// copy password because afp_parse_url just puts garbage into the password field :(
strncpy(m_pAfpUrl->password, nonConstUrl.GetPassWord().c_str(), 127);
strncpy(tmpurl.uamname, "No User Authent", sizeof(tmpurl.uamname));
CLog::Log(LOGDEBUG, "AFP: Using anonymous authentication.");
}
- else if ((nonConstUrl.GetPassWord().IsEmpty() || nonConstUrl.GetUserName().IsEmpty()))
+ else if ((nonConstUrl.GetPassWord().empty() || nonConstUrl.GetUserName().empty()))
{
// this is our current url object whe are connected to (at least we try)
return -1;
}
// we got a password in the url
- if (!nonConstUrl.GetPassWord().IsEmpty())
+ if (!nonConstUrl.GetPassWord().empty())
{
// copy password because afp_parse_url just puts garbage into the password field :(
strncpy(tmpurl.password, nonConstUrl.GetPassWord().c_str(), 127);
for (int i = 0; i < numFiles; i++)
{
CStdString name = zip_get_name(zip_archive, i, zip_flags);
- if (!name.IsEmpty() && name.Left(path.size()).Equals(path))
+ if (!name.empty() && name.Left(path.size()).Equals(path))
{
buffer->st_gid = 0;
buffer->st_mode = _S_IFDIR;
else if (path.GetHostName().Equals("search"))
{
CStdString search(path.GetFileName());
- if (search.IsEmpty() && !GetKeyboardInput(16017, search))
+ if (search.empty() && !GetKeyboardInput(16017, search))
return false;
items.SetProperty("reponame",g_localizeStrings.Get(283));
items.SetLabel(addon->Name());
}
- if (path.GetFileName().IsEmpty())
+ if (path.GetFileName().empty())
{
if (!path.GetHostName().Equals("repos"))
{
item->SetPath(URIUtils::AddFileToFolder(strPath,TranslateType((TYPE)i,false)));
item->m_bIsFolder = true;
CStdString thumb = GetIcon((TYPE)i);
- if (!thumb.IsEmpty() && g_TextureManager.HasTexture(thumb))
+ if (!thumb.empty() && g_TextureManager.HasTexture(thumb))
item->SetArt("thumb", thumb);
items.Add(item);
break;
g_curlInterface.easy_setopt(h, CURLOPT_COOKIEJAR, strCookieFile.c_str());
// Set custom cookie if requested
- if (!m_cookie.IsEmpty())
+ if (!m_cookie.empty())
g_curlInterface.easy_setopt(h, CURLOPT_COOKIE, m_cookie.c_str());
g_curlInterface.easy_setopt(h, CURLOPT_COOKIELIST, "FLUSH");
}
// setup Referer header if needed
- if (!m_referer.IsEmpty())
+ if (!m_referer.empty())
g_curlInterface.easy_setopt(h, CURLOPT_REFERER, m_referer.c_str());
else
{
|| strProtocol.Equals("ftps") )
{
// we was using url optons for urls, keep the old code work and warning
- if (!url2.GetOptions().IsEmpty())
+ if (!url2.GetOptions().empty())
{
CLog::Log(LOGWARNING, "%s: ftp url option is deprecated, please switch to use protocol option (change '?' to '|'), url: [%s]", __FUNCTION__, url2.GetRedacted().c_str());
url2.SetProtocolOptions(url2.GetOptions().Mid(1));
if (url2.HasProtocolOption("auth"))
{
m_ftpauth = url2.GetProtocolOption("auth");
- if(m_ftpauth.IsEmpty())
+ if(m_ftpauth.empty())
m_ftpauth = "any";
}
m_ftpport = "";
if (url2.HasProtocolOption("active"))
{
m_ftpport = url2.GetProtocolOption("active");
- if(m_ftpport.IsEmpty())
+ if(m_ftpport.empty())
m_ftpport = "-";
}
m_ftppasvip = url2.HasProtocolOption("pasvip") && url2.GetProtocolOption("pasvip") != "0";
if (CSettings::Get().GetBool("network.usehttpproxy")
&& !CSettings::Get().GetString("network.httpproxyserver").empty()
&& CSettings::Get().GetInt("network.httpproxyport") > 0
- && m_proxy.IsEmpty())
+ && m_proxy.empty())
{
m_proxy = CSettings::Get().GetString("network.httpproxyserver");
m_proxy.AppendFormat(":%d", CSettings::Get().GetInt("network.httpproxyport"));
- if (CSettings::Get().GetString("network.httpproxyusername").length() > 0 && m_proxyuserpass.IsEmpty())
+ if (CSettings::Get().GetString("network.httpproxyusername").length() > 0 && m_proxyuserpass.empty())
{
m_proxyuserpass = CSettings::Get().GetString("network.httpproxyusername");
m_proxyuserpass += ":" + CSettings::Get().GetString("network.httpproxypassword");
if(name.Equals("auth"))
{
m_httpauth = value;
- if(m_httpauth.IsEmpty())
+ if(m_httpauth.empty())
m_httpauth = "any";
}
else if (name.Equals("Referer"))
bool CCurlFile::GetMimeType(const CURL &url, CStdString &content, CStdString useragent)
{
CCurlFile file;
- if (!useragent.IsEmpty())
+ if (!useragent.empty())
file.SetUserAgent(useragent);
struct __stat64 buffer;
CStdString itemPath(URIUtils::AddFileToFolder(url2.GetWithoutFilename(), url3.GetFileName()));
- if (item.GetLabel().IsEmpty())
+ if (item.GetLabel().empty())
{
CStdString name(itemPath);
URIUtils::RemoveSlashAtEnd(name);
URIUtils::AddSlashAtEnd(itemPath);
// Add back protocol options
- if (!url2.GetProtocolOptions().IsEmpty())
+ if (!url2.GetProtocolOptions().empty())
itemPath += "|" + url2.GetProtocolOptions();
item.SetPath(itemPath);
CURL url(strPath);
CStdString path = url.GetFileName();
- if( !path.IsEmpty() && !StringUtils::EndsWith(path, "/") )
+ if( !path.empty() && !StringUtils::EndsWith(path, "/") )
{
path += "/";
url.SetFileName(path);
g_charsetConverter.unknownToUTF8(name);
// convert got empty result, ignore it
- if (name.IsEmpty())
+ if (name.empty())
continue;
if (serverNotUseUTF8 || name != parse.getName())
else
{ // create our new favourite item
CFileItemPtr favourite(new CFileItem(item->GetLabel()));
- if (item->GetLabel().IsEmpty())
+ if (item->GetLabel().empty())
favourite->SetLabel(CUtil::GetTitleFromPath(item->GetPath(), item->m_bIsFolder));
favourite->SetArt("thumb", item->GetArt("thumb"));
favourite->SetPath(executePath);
StringUtils::Tokenize(url.GetFileName(),tokens,pathsep.c_str());
CStdString strCurrPath;
// Handle special
- if (!url.GetProtocol().IsEmpty()) {
+ if (!url.GetProtocol().empty()) {
pathsep = "/";
strCurrPath += url.GetProtocol() + "://";
} // If the directory has a / at the beginning, don't forget it
try
{
- if (strFileName.IsEmpty())
+ if (strFileName.empty())
return false;
if (bUseCache)
else if (strProtocol == "special") return new CSpecialProtocolFile();
else if (strProtocol == "multipath") return new CMultiPathFile();
else if (strProtocol == "image") return new CImageFile();
- else if (strProtocol == "file" || strProtocol.IsEmpty()) return new CHDFile();
+ else if (strProtocol == "file" || strProtocol.empty()) return new CHDFile();
else if (strProtocol == "filereader") return new CFileReaderFile();
#if defined(HAS_FILESYSTEM_CDDA) && defined(HAS_DVD_DRIVE)
else if (strProtocol == "cdda") return new CFileCDDA();
CURL url(strPath);
- if(url.GetHostName().IsEmpty())
+ if(url.GetHostName().empty())
{
// no hostname, list all available devices
int target_ip = 0;
return false;
}
- if(!url.GetUserName().IsEmpty())
+ if(!url.GetUserName().empty())
m_session.Auth(url.GetUserName(), url.GetPassWord());
if(!m_session.SendEnableAsync())
return false;
- if(url.GetFileName().IsEmpty())
+ if(url.GetFileName().empty())
{
CFileItemPtr item;
bool IDirectory::GetKeyboardInput(const CVariant &heading, CStdString &input)
{
- if (!CStdString(m_requirements["input"].asString()).IsEmpty())
+ if (!m_requirements["input"].asString().empty())
{
input = m_requirements["input"].asString();
return true;
CStdString file = url.Get();
bool needsRecaching = false;
CStdString cachedFile = CTextureCache::Get().CheckCachedImage(file, false, needsRecaching);
- if (cachedFile.IsEmpty())
+ if (cachedFile.empty())
{ // not in the cache, so cache it
cachedFile = CTextureCache::Get().CacheImage(file);
}
- if (!cachedFile.IsEmpty())
+ if (!cachedFile.empty())
{ // in the cache, return what we have
if (m_file.Open(cachedFile))
return true;
{
bool needsRecaching = false;
CStdString cachedFile = CTextureCache::Get().CheckCachedImage(url.Get(), false, needsRecaching);
- if (!cachedFile.IsEmpty())
+ if (!cachedFile.empty())
return CFile::Exists(cachedFile);
// need to check if the original can be cached on demand and that the file exists
{
bool needsRecaching = false;
CStdString cachedFile = CTextureCache::Get().CheckCachedImage(url.Get(), false, needsRecaching);
- if (!cachedFile.IsEmpty())
+ if (!cachedFile.empty())
return CFile::Stat(cachedFile, buffer);
/*
CSmartPlaylist playlist;
CStdString type, label;
XMLUtils::GetString(node, "content", type);
- if (type.IsEmpty())
+ if (type.empty())
{
CLog::Log(LOGERROR, "<content> tag must not be empty for type=\"filter\" node '%s'", libNode.c_str());
return false;
{
CStdString path;
XMLUtils::GetPath(node, "path", path);
- if (!path.IsEmpty())
+ if (!path.empty())
{
URIUtils::AddSlashAtEnd(path);
return CDirectory::GetDirectory(path, items, m_strFileMask, m_flags);
CFileItemPtr item(new CFileItem(URIUtils::AddFileToFolder(strPath, folder), true));
item->SetLabel(label);
- if (!icon.IsEmpty() && g_TextureManager.HasTexture(icon))
+ if (!icon.empty() && g_TextureManager.HasTexture(icon))
item->SetIconImage(icon);
item->m_iprogramCount = order;
items.Add(item);
if (item->m_bIsFolder && !item->HasIcon() && !item->HasArt("thumb"))
{
CStdString strImage = GetIcon(item->GetPath());
- if (!strImage.IsEmpty() && g_TextureManager.HasTexture(strImage))
+ if (!strImage.empty() && g_TextureManager.HasTexture(strImage))
item->SetIconImage(strImage);
}
}
// get artist
if (params.GetArtistId() >= 0)
{
- if (!strLabel.IsEmpty())
+ if (!strLabel.empty())
strLabel += " / ";
strLabel += musicdatabase.GetArtistById(params.GetArtistId());
}
// get album
if (params.GetAlbumId() >= 0)
{
- if (!strLabel.IsEmpty())
+ if (!strLabel.empty())
strLabel += " / ";
strLabel += musicdatabase.GetAlbumById(params.GetAlbumId());
}
- if (strLabel.IsEmpty())
+ if (strLabel.empty())
{
switch (pNode->GetChildType())
{
CStdStringArray Path;
StringUtils::SplitString(strDirectory, "/", Path);
- if (!strDirectory.IsEmpty())
+ if (!strDirectory.empty())
Path.insert(Path.begin(), "");
CDirectoryNode* pNode=NULL;
{
CStdStringArray array;
- if (!m_strName.IsEmpty())
+ if (!m_strName.empty())
array.insert(array.begin(), m_strName);
CDirectoryNode* pParent=m_pParent;
while (pParent!=NULL)
{
const CStdString& strNodeName=pParent->GetName();
- if (!strNodeName.IsEmpty())
+ if (!strNodeName.empty())
array.insert(array.begin(), strNodeName);
pParent=pParent->GetParent();
bool CMusicDatabaseFile::Exists(const CURL& url)
{
- return !TranslateUrl(url).IsEmpty();
+ return !TranslateUrl(url).empty();
}
int CMusicDatabaseFile::Stat(const CURL& url, struct __stat64* buffer)
CURL url(strPath);
CStdString search(url.GetHostName());
- if (search.IsEmpty())
+ if (search.empty())
return false;
// and retrieve the search details
url.SetFileName("guide/" + number);
CFileItemPtr item(new CFileItem(url.Get(), true));
item->m_strTitle = number;
- if (!name.IsEmpty())
+ if (!name.empty())
item->m_strTitle += " - " + name; // e.g. 3 - TV3
CStdString icon = GetValue(m_dll->channel_icon(channel));
- if (!icon.IsEmpty())
+ if (!icon.empty())
{
url.SetFileName("files/channels/" + URIUtils::GetFileName(icon)); // e.g. files/channels/tv3.jpg
item->SetArt("thumb", url.Get());
item->m_strTitle = StringUtils::Format("%s - %s",
localstart.GetAsLocalizedTime("HH:mm", false).c_str(),
title.c_str()); // e.g. 20:30 - Mythbusters
- if (!subtitle.IsEmpty())
+ if (!subtitle.empty())
item->m_strTitle += " - \"" + subtitle + "\""; // e.g. 20:30 - Mythbusters - "The Pirate Special"
item->m_dateTime = localstart;
*/
CVideoInfoTag* tag = item->GetVideoInfoTag();
tag->m_strTitle = title;
- if (!subtitle.IsEmpty())
+ if (!subtitle.empty())
tag->m_strTitle += " - \"" + subtitle + "\""; // e.g. Mythbusters - "The Pirate Special"
tag->m_strShowTitle = title;
tag->m_strOriginalTitle = title;
CStdString title = GetValue(m_dll->proginfo_title(program)); // e.g. Mythbusters
CStdString subtitle = GetValue(m_dll->proginfo_subtitle(program)); // e.g. The Pirate Special
item.m_strTitle = title;
- if (!subtitle.IsEmpty())
+ if (!subtitle.empty())
item.m_strTitle += " - \"" + subtitle + "\""; // e.g. Mythbusters - "The Pirate Special"
item.m_dateTime = GetValue(m_dll->proginfo_rec_start(program));
item.m_dwSize = m_dll->proginfo_length(program); // size in bytes
* subtitle to the start of the plot if not already as it used to? Seems strange, should be
* handled by skin?
*
- if (tag->m_strPlot.Left(tag->m_strPlotOutline.length()) != tag->m_strPlotOutline && !tag->m_strPlotOutline.IsEmpty())
+ if (tag->m_strPlot.Left(tag->m_strPlotOutline.length()) != tag->m_strPlotOutline && !tag->m_strPlotOutline.empty())
tag->m_strPlot = tag->m_strPlotOutline + '\n' + tag->m_strPlot;
*/
tag->m_genre = StringUtils::Split(GetValue(m_dll->proginfo_category(program)), g_advancedSettings.m_videoItemSeparator); // e.g. Sports
* within the OSD.
*/
CStdString name = GetValue(m_dll->proginfo_chansign(program));
- if (!name.IsEmpty())
+ if (!name.empty())
tag->m_strTitle += " - " + name;
/*
* Update the path and channel icon for LiveTV in case the channel has changed through
* NextChannel(), PreviousChannel() or SetChannel().
*/
- if (!number.IsEmpty())
+ if (!number.empty())
{
url.SetFileName("channels/" + number + ".ts"); // e.g. channels/3.ts
item.SetPath(url.Get());
}
CStdString chanicon = GetValue(m_dll->proginfo_chanicon(program));
- if (!chanicon.IsEmpty())
+ if (!chanicon.empty())
{
url.SetFileName("files/channels/" + URIUtils::GetFileName(chanicon)); // e.g. files/channels/tv3.jpg
item.SetArt("thumb", url.Get());
*season = 0;
*episode = 0;
- if (programid.IsEmpty() // Can't do anything if the program ID is empty
- || seriesid.IsEmpty()) // Can't figure out the end parsing if the series ID is empty {
+ if (programid.empty() // Can't do anything if the program ID is empty
+ || seriesid.empty()) // Can't figure out the end parsing if the series ID is empty {
return;
CStdString category = programid.Left(2); // Valid for both XMLTV and SchedulesDirect sources
if (channel && channel->HasPVRChannelInfoTag())
{
CStdString stream = channel->GetPVRChannelInfoTag()->StreamURL();
- if(!stream.IsEmpty())
+ if(!stream.empty())
{
if (stream.compare(6, 7, "stream/") == 0)
{
XFILE::Pipe *PipesManager::CreatePipe(const CStdString &name, int nMaxPipeSize)
{
CStdString pName = name;
- if (pName.IsEmpty())
+ if (pName.empty())
pName = GetUniquePipeName();
CSingleLock lock(m_lock);
bool CPluginDirectory::RunScriptWithParams(const CStdString& strPath)
{
CURL url(strPath);
- if (url.GetHostName().IsEmpty()) // called with no script - should never happen
+ if (url.GetHostName().empty()) // called with no script - should never happen
return false;
AddonPtr addon;
}
else if (name == "title")
{
- if(text.IsEmpty())
+ if(text.empty())
return;
if(text.length() > item->m_strTitle.length())
}
else if(name == "description")
{
- if(text.IsEmpty())
+ if(text.empty())
return;
CStdString description = text;
}
else if(name == "category")
{
- if(text.IsEmpty())
+ if(text.empty())
return;
CStdString scheme = item_child->Attribute("scheme");
item->m_bIsFolder = false;
}
- if(!item->m_strTitle.IsEmpty())
+ if(!item->m_strTitle.empty())
item->SetLabel(item->m_strTitle);
if(item->HasVideoInfoTag())
if(item->HasProperty("duration") && !vtag->GetDuration())
vtag->m_duration = StringUtils::TimeStringToSeconds(item->GetProperty("duration").asString());
- if(item->HasProperty("description") && vtag->m_strPlot.IsEmpty())
+ if(item->HasProperty("description") && vtag->m_strPlot.empty())
vtag->m_strPlot = item->GetProperty("description").asString();
- if(vtag->m_strPlotOutline.IsEmpty() && !vtag->m_strPlot.IsEmpty())
+ if(vtag->m_strPlotOutline.empty() && !vtag->m_strPlot.empty())
{
int pos = vtag->m_strPlot.Find('\n');
if(pos >= 0)
if (!item->HasArt("thumb") && items.HasArt("thumb"))
item->SetArt("thumb", items.GetArt("thumb"));
- if (!item->GetPath().IsEmpty())
+ if (!item->GetPath().empty())
items.Add(item);
}
CStdString strCachedPath = URIUtils::AddFileToFolder(strDir + "rarfolder%04d",
URIUtils::GetFileName(strPathInRar));
strCachedPath = CUtil::GetNextPathname(strCachedPath, 9999);
- if (strCachedPath.IsEmpty())
+ if (strCachedPath.empty())
{
CLog::Log(LOGWARNING, "Could not cache file %s", (strRarPath + strPathInRar).c_str());
return false;
ArchiveList_struct* pIterator;
CStdString strCompare = strPathInRar;
- if (!URIUtils::HasSlashAtEnd(strCompare) && !strCompare.IsEmpty())
+ if (!URIUtils::HasSlashAtEnd(strCompare) && !strCompare.empty())
strCompare += '/';
for( pIterator = pFileList; pIterator ; pIterator ? pIterator = pIterator->next : NULL)
{
CStdString strCmd = "mount -t cifs " + smbPath + " " + strMountPoint +
" -o rw,nobrl,directio";
- if (!strUser.IsEmpty())
+ if (!strUser.empty())
strCmd += ",user=" + strUser + ",password=" + strPass;
else
strCmd += ",guest";
if (result)
{
m_tag.SetTitle(m_file.GetHttpHeader().GetValue("icy-name"));
- if (m_tag.GetTitle().IsEmpty())
+ if (m_tag.GetTitle().empty())
m_tag.SetTitle(m_file.GetHttpHeader().GetValue("ice-name")); // icecast
m_tag.SetGenre(m_file.GetHttpHeader().GetValue("icy-genre"));
if (m_tag.GetGenre().empty())
items.SetProperty(PROPERTY_PATH_DB, videoUrl.ToString());
}
}
- else if (playlist.IsMusicType() || playlist.GetType().IsEmpty())
+ else if (playlist.IsMusicType() || playlist.GetType().empty())
{
CMusicDatabase db;
if (db.Open())
{
CSmartPlaylist plist(playlist);
- if (playlist.GetType().Equals("mixed") || playlist.GetType().IsEmpty())
+ if (playlist.GetType().Equals("mixed") || playlist.GetType().empty())
plist.SetType("songs");
MediaType mediaType = DatabaseUtils::MediaTypeFromString(plist.GetType());
CStdString strIcon;
// We have the real DVD-ROM, set icon on disktype
- if (share.m_iDriveType == CMediaSource::SOURCE_TYPE_DVD && share.m_strThumbnailImage.IsEmpty())
+ if (share.m_iDriveType == CMediaSource::SOURCE_TYPE_DVD && share.m_strThumbnailImage.empty())
{
CUtil::GetDVDDriveIcon( pItem->GetPath(), strIcon );
// CDetectDVDMedia::SetNewDVDShareUrl() caches disc thumb as special://temp/dvdicon.tbn
RootDir.Equals("frameworks"))
{
CStdString basePath = GetPath(RootDir);
- if (!basePath.IsEmpty())
+ if (!basePath.empty())
translatedPath = URIUtils::AddFileToFolder(basePath, FileName);
else
translatedPath.clear();
CLog::Log(LOGNOTICE, "special://home/ is mapped to: %s", GetPath("home").c_str());
CLog::Log(LOGNOTICE, "special://temp/ is mapped to: %s", GetPath("temp").c_str());
//CLog::Log(LOGNOTICE, "special://userhome/ is mapped to: %s", GetPath("userhome").c_str());
- if (!CUtil::GetFrameworksPath().IsEmpty())
+ if (!CUtil::GetFrameworksPath().empty())
CLog::Log(LOGNOTICE, "special://frameworks/ is mapped to: %s", GetPath("frameworks").c_str());
}
url.SetFileName(strBQRequest);
}
}
- if(strFilter.IsEmpty())
+ if(strFilter.empty())
{
url.SetOptions("");
url.SetFileName(strBQRequest);
else
result = g_tuxbox.ParseBouquets(root, items, url, strFilter, strXMLChildString);
}
- else if( strXMLRootString.Equals(root->Value()) && !strFilter.IsEmpty() )
+ else if( strXMLRootString.Equals(root->Value()) && !strFilter.empty() )
{
data.clear();
if (enigma2)
{
//PopUp Context and Request SubMode with root and child string
strBQRequest = g_tuxbox.GetSubMode(g_advancedSettings.m_iTuxBoxDefaultRootMenu, strXMLRootString, strXMLChildString);
- if(strBQRequest.IsEmpty())
+ if(strBQRequest.empty())
{
strBQRequest = "xml/services?mode=0&submode=4"; //Bouquets
strXMLRootString = StringUtils::Format("bouquets");
}
}
}
- if(strBQRequest.IsEmpty() || strXMLRootString.IsEmpty() || strXMLChildString.IsEmpty())
+ if(strBQRequest.empty() || strXMLRootString.empty() || strXMLChildString.empty())
return false;
else
return true;
bool audio = true;
bool image = true;
m_strFileMask.TrimLeft("/");
- if (!m_strFileMask.IsEmpty()) {
+ if (!m_strFileMask.empty()) {
video = m_strFileMask.Find(".wmv") >= 0;
audio = m_strFileMask.Find(".wma") >= 0;
image = m_strFileMask.Find(".jpg") >= 0;
if(!m_session->Open(url.GetHostName(), url.GetPort()))
return false;
- if(url.GetFileName().IsEmpty())
+ if(url.GetFileName().empty())
{
CFileItemPtr item;
if (item->m_bIsFolder && !item->HasIcon() && !item->HasArt("thumb"))
{
CStdString strImage = GetIcon(item->GetPath());
- if (!strImage.IsEmpty() && g_TextureManager.HasTexture(strImage))
+ if (!strImage.empty() && g_TextureManager.HasTexture(strImage))
item->SetIconImage(strImage);
}
}
CStdString path = CLegacyPathTranslation::TranslateVideoDbPath(strDirectory);
auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path));
- if (!pNode.get() || path.IsEmpty())
+ if (!pNode.get() || path.empty())
return false;
// first see if there's any filter criteria
if (params.GetYear() != -1)
{
CStdString strTemp = StringUtils::Format("%i",params.GetYear());
- if (!strLabel.IsEmpty())
+ if (!strLabel.empty())
strLabel += " / ";
strLabel += strTemp;
}
- if (strLabel.IsEmpty())
+ if (strLabel.empty())
{
switch (pNode->GetChildType())
{
CStdStringArray Path;
StringUtils::SplitString(strDirectory, "/", Path);
- if (!strDirectory.IsEmpty())
+ if (!strDirectory.empty())
Path.insert(Path.begin(), "");
CDirectoryNode* pNode=NULL;
{
CStdStringArray array;
- if (!m_strName.IsEmpty())
+ if (!m_strName.empty())
array.insert(array.begin(), m_strName);
CDirectoryNode* pParent=m_pParent;
while (pParent!=NULL)
{
const CStdString& strNodeName=pParent->GetName();
- if (!strNodeName.IsEmpty())
+ if (!strNodeName.empty())
array.insert(array.begin(), strNodeName);
pParent=pParent->GetParent();
int flags = m_flags;
if (!bUseFileDirectories)
flags |= DIR_FLAG_NO_FILE_DIRS;
- if (!strPath.IsEmpty() && strPath != "files://")
+ if (!strPath.empty() && strPath != "files://")
return CDirectory::GetDirectory(strPath, items, m_strFileMask, flags, m_allowThreads);
// if strPath is blank, clear the list (to avoid parent items showing up)
- if (strPath.IsEmpty())
+ if (strPath.empty())
items.Clear();
// return the root listing
return false;
vector<std::string> baseTokens;
- if (!strPathInZip.IsEmpty())
+ if (!strPathInZip.empty())
StringUtils::Tokenize(strPathInZip,baseTokens,"/");
for (vector<SZipEntry>::iterator ze=entries.begin();ze!=entries.end();++ze)
{
D3DXMACRO m;
m.Name = it->first.c_str();
- if (it->second.IsEmpty())
+ if (it->second.empty())
m.Definition = NULL;
else
m.Definition = it->second.c_str();
vector<CStdString> actions;
for (ciActions it = m_actions.begin() ; it != m_actions.end() ; ++it)
{
- if (it->condition.IsEmpty() || g_infoManager.EvaluateBool(it->condition))
+ if (it->condition.empty() || g_infoManager.EvaluateBool(it->condition))
{
if (!StringUtils::IsInteger(it->action))
actions.push_back(it->action);
{
if (StringUtils::IsInteger(it->action))
{
- if (it->condition.IsEmpty() || g_infoManager.EvaluateBool(it->condition))
+ if (it->condition.empty() || g_infoManager.EvaluateBool(it->condition))
return atoi(it->action.c_str());
}
}
CStdString strId = StringUtils::Format("%i", id);
for (iActions it = m_actions.begin() ; it != m_actions.end() ; ++it)
{
- if (StringUtils::IsInteger(it->action) && it->condition.IsEmpty())
+ if (StringUtils::IsInteger(it->action) && it->condition.empty())
{
it->action = strId;
return;
{
for (ciActions it = m_actions.begin() ; it != m_actions.end() ; ++it)
{
- if (it->condition.IsEmpty() || g_infoManager.EvaluateBool(it->condition))
+ if (it->condition.empty() || g_infoManager.EvaluateBool(it->condition))
return true;
}
return false;
if (pFileNode && pFileNode->FirstChild())
strFile += pFileNode->FirstChild()->Value();
- if (id > 0 && !strFile.IsEmpty())
+ if (id > 0 && !strFile.empty())
{
CStdString filename = URIUtils::AddFileToFolder(m_strMediaDir, strFile);
IAESound *sound = LoadSound(filename);
void CGUIBorderedImage::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
CGUIImage::Process(currentTime, dirtyregions);
- if (!m_borderImage.GetFileName().IsEmpty() && m_texture.ReadyToRender())
+ if (!m_borderImage.GetFileName().empty() && m_texture.ReadyToRender())
{
CRect rect = CRect(m_texture.GetXPosition(), m_texture.GetYPosition(), m_texture.GetXPosition() + m_texture.GetWidth(), m_texture.GetYPosition() + m_texture.GetHeight());
rect.Intersect(m_texture.GetRenderRect());
void CGUIBorderedImage::Render()
{
- if (!m_borderImage.GetFileName().IsEmpty() && m_texture.ReadyToRender())
+ if (!m_borderImage.GetFileName().empty() && m_texture.ReadyToRender())
m_borderImage.Render();
CGUIImage::Render();
}
CStdString label2(m_info2.GetLabel(m_parentID));
changed |= m_label2.SetMaxRect(m_posX, m_posY, m_width, m_height);
changed |= m_label2.SetText(label2);
- if (!label2.IsEmpty())
+ if (!label2.empty())
{
changed |= m_label2.SetAlign(XBFONT_RIGHT | (m_label.GetLabelInfo().align & XBFONT_CENTER_Y) | XBFONT_TRUNCATED);
changed |= m_label2.SetScrolling(HasFocus());
return false;
CStdString label = element->FirstChild()->Value();
- if (label.IsEmpty() || label == "-")
+ if (label.empty() || label == "-")
return false;
CStdString fallback = element->Attribute("fallback");
texture.useLarge = true;
// use a bordered texture if we have <bordersize> or <bordertexture> specified.
- if (borderTexture.filename.IsEmpty() && borderStr.IsEmpty())
+ if (borderTexture.filename.empty() && borderStr.empty())
control = new CGUIImage(
parentID, id, posX, posY, width, height, texture);
else
xmlControl->SetAttribute("percent", str.c_str());
}
- if (!m_strDescription.IsEmpty())
+ if (!m_strDescription.empty())
{
TiXmlElement *elem = new TiXmlElement("description");
xmlControl->LinkEndChild(elem);
bool CGUIControlProfiler::SaveResults(void)
{
- if (m_strOutputFile.IsEmpty())
+ if (m_strOutputFile.empty())
return false;
CXBMCTinyXML doc;
}
changed |= m_label2.SetMaxRect(m_clipRect.x1 + m_textOffset, m_posY, m_clipRect.Width() - m_textOffset, m_height);
- if (text.IsEmpty())
+ if (text.empty())
changed |= m_label2.SetText(m_hintInfo.GetLabel(GetParentID()));
else
changed |= m_label2.SetTextW(text);
unsigned int numTries = 0;
CStdString label(m_infoLabels[m_currentLabel].GetLabel(m_parentID));
- while (label.IsEmpty() && ++numTries < m_infoLabels.size())
+ while (label.empty() && ++numTries < m_infoLabels.size())
{
if (++m_currentLabel >= m_infoLabels.size())
m_currentLabel = 0;
return pFont;
}
// fall back to "font13" if we have none
- if (fallback && !strFontName.IsEmpty() && !strFontName.Equals("-") && !strFontName.Equals("font13"))
+ if (fallback && !strFontName.empty() && !strFontName.Equals("-") && !strFontName.Equals("font13"))
return GetFont("font13");
return NULL;
}
const char* unicodeAttr = ((TiXmlElement*) pChild)->Attribute("unicode");
- if (foundTTF.IsEmpty() && idAttr != NULL && unicodeAttr != NULL && stricmp(unicodeAttr, "true") == 0)
+ if (foundTTF.empty() && idAttr != NULL && unicodeAttr != NULL && stricmp(unicodeAttr, "true") == 0)
foundTTF = idAttr;
// Check if this is the fontset that we want
if (pChild == NULL)
{
CLog::Log(LOGWARNING, "file doesnt have <fontset> with name '%s', defaulting to first fontset", strFontSet.c_str());
- if (!foundTTF.IsEmpty())
+ if (!foundTTF.empty())
LoadFonts(foundTTF);
}
}
CLog::Log(LOGERROR, "file doesnt have <fontset> in <fonts>, but rather %s", strValue.c_str());
}
- return !strFontSet.IsEmpty();
+ return !strFontSet.empty();
}
bool GUIFontManager::IsFontSetUnicode(const CStdString& strFontSet)
// check whether our image failed to allocate, and if so drop back to the fallback image
if (m_texture.FailedToAlloc() && !m_texture.GetFileName().Equals(m_info.GetFallback()))
{
- if (!m_currentFallback.IsEmpty() && !m_texture.GetFileName().Equals(m_currentFallback))
+ if (!m_currentFallback.empty() && !m_texture.GetFileName().Equals(m_currentFallback))
m_texture.SetFileName(m_currentFallback);
else
m_texture.SetFileName(m_info.GetFallback());
++i;
}
- if (m_texture.ReadyToRender() || m_texture.GetFileName().IsEmpty())
+ if (m_texture.ReadyToRender() || m_texture.GetFileName().empty())
{ // fade out the last one as well
if (!ProcessFading(m_fadingTextures[m_fadingTextures.size() - 1], frameTime, currentTime))
m_fadingTextures.erase(m_fadingTextures.end() - 1);
}
}
- if (m_texture.ReadyToRender() || m_texture.GetFileName().IsEmpty())
+ if (m_texture.ReadyToRender() || m_texture.GetFileName().empty())
{ // fade the new one in
m_currentFadeTime += frameTime;
if (m_currentFadeTime > m_crossFadeTime || frameTime == 0) // for if we allocate straight away on creation
void CGUIImage::AllocResources()
{
- if (m_texture.GetFileName().IsEmpty())
+ if (m_texture.GetFileName().empty())
return;
CGUIControl::AllocResources();
void CGUIImage::SetCrossFade(unsigned int time)
{
m_crossFadeTime = time;
- if (!m_crossFadeTime && m_texture.IsLazyLoaded() && !m_info.GetFallback().IsEmpty())
+ if (!m_crossFadeTime && m_texture.IsLazyLoaded() && !m_info.GetFallback().empty())
m_crossFadeTime = 1;
}
if (m_currentTexture.Equals(strFileName))
return; // nothing to do - we already have this image
- if (m_texture.ReadyToRender() || m_texture.GetFileName().IsEmpty())
+ if (m_texture.ReadyToRender() || m_texture.GetFileName().empty())
{ // save the current image
m_fadingTextures.push_back(new CFadingTexture(m_texture, m_currentFadeTime));
MarkDirtyRegion();
// Expand the infolabel, and then convert it to a color
CStdString infoLabel(g_infoManager.GetLabel(m_info));
- color_t color = !infoLabel.IsEmpty() ? g_colorManager.GetColor(infoLabel.c_str()) : 0;
+ color_t color = !infoLabel.empty() ? g_colorManager.GetColor(infoLabel.c_str()) : 0;
if (m_color != color)
{
m_color = color;
CStdString infoLabel;
if (preferImage)
infoLabel = g_infoManager.GetImage(portion.m_info, contextWindow, fallback);
- if (infoLabel.IsEmpty())
+ if (infoLabel.empty())
infoLabel = g_infoManager.GetLabel(portion.m_info, contextWindow, fallback);
- if (!infoLabel.IsEmpty())
+ if (!infoLabel.empty())
label += portion.GetLabel(infoLabel);
}
else
label += portion.m_prefix;
}
}
- if (label.IsEmpty()) // empty label, use the fallback
+ if (label.empty()) // empty label, use the fallback
return m_fallback;
return label;
}
infoLabel = g_infoManager.GetItemImage((const CFileItem *)item, portion.m_info, fallback);
else
infoLabel = g_infoManager.GetItemLabel((const CFileItem *)item, portion.m_info, fallback);
- if (!infoLabel.IsEmpty())
+ if (!infoLabel.empty())
label += portion.GetLabel(infoLabel);
}
else
label += portion.m_prefix;
}
}
- if (label.IsEmpty())
+ if (label.empty())
return m_fallback;
return label;
}
}
while (format != NONE);
- if (!work.IsEmpty())
+ if (!work.empty())
m_info.push_back(CInfoPortion(0, work, ""));
}
if (confirmed)
{
- if (!allowEmptyResult && aTextString.IsEmpty())
+ if (!allowEmptyResult && aTextString.empty())
confirmed = false;
}
if (!ShowAndGetInput(strUserInput, strHeadingTemp, false, true, autoCloseMs)) //bool hiddenInput = false/true ? TODO: GUI Setting to enable disable this feature y/n?
return -1; // user canceled out
- if (!strPassword.IsEmpty())
+ if (!strPassword.empty())
{
if (strPassword == strUserInput)
return 0;
}
else
{
- if (!strUserInput.IsEmpty())
+ if (!strUserInput.empty())
{
XBMC::XBMC_MD5 md5state;
md5state.append(strUserInput);
CStdString CGUILabelControl::ShortenPath(const CStdString &path)
{
- if (m_width == 0 || path.IsEmpty())
+ if (m_width == 0 || path.empty())
return path;
char cDelim = '\0';
if (m_strLabel == strLabel)
return;
m_strLabel = strLabel;
- if (m_sortLabel.IsEmpty())
+ if (m_sortLabel.empty())
SetSortLabel(strLabel);
SetInvalid();
}
texturePath = m_texturePath.GetItemLabel(item, true);
else
texturePath = m_texturePath.GetLabel(m_parentID);
- if (texturePath != m_currentPath && !texturePath.IsEmpty())
+ if (texturePath != m_currentPath && !texturePath.empty())
{
// a new path - set our current path and tell ourselves to load our directory
m_currentPath = texturePath;
m_files.clear();
// don't load any images if our path is empty
- if (m_currentPath.IsEmpty()) return;
+ if (m_currentPath.empty()) return;
/* Check the fast cases:
1. Picture extension
// Load in images from the directory specified
// m_path is relative (as are all skin paths)
CStdString realPath = g_TextureManager.GetTexturePath(m_path, true);
- if (realPath.IsEmpty())
+ if (realPath.empty())
return true;
URIUtils::AddSlashAtEnd(realPath);
selected++;
}
}
- if (!clickAction.IsEmpty())
+ if (!clickAction.empty())
{ // have a click action -> perform it
CGUIMessage message(GUI_MSG_EXECUTE, m_controlID, m_parentID);
message.SetStringParam(clickAction);
void CGUIMultiSelectTextControl::AddString(const CStdString &text, bool selectable, const CStdString &clickAction)
{
- if (!text.IsEmpty())
+ if (!text.empty())
m_items.push_back(CSelectableString(m_label.font, text, selectable, clickAction));
}
{
m_guiBackground.Render();
- if (m_guiLeft.GetFileName().IsEmpty() && m_guiRight.GetFileName().IsEmpty())
+ if (m_guiLeft.GetFileName().empty() && m_guiRight.GetFileName().empty())
{
if (m_bReveal && !m_guiMidClipRect.IsEmpty())
{
float posX = m_guiBackground.GetXPosition();
float posY = m_guiBackground.GetYPosition();
- if (m_guiLeft.GetFileName().IsEmpty() && m_guiRight.GetFileName().IsEmpty())
+ if (m_guiLeft.GetFileName().empty() && m_guiRight.GetFileName().empty())
{ // rendering without left and right image - fill the mid image completely
float width = m_fPercent * m_width * 0.01f;
float offset = fabs(fScaleY * 0.5f * (m_guiMid.GetTextureHeight() - m_guiBackground.GetTextureHeight()));
CStdString CGUISliderControl::GetDescription() const
{
- if (!m_textValue.IsEmpty())
+ if (!m_textValue.empty())
return m_textValue;
CStdString description;
if (m_iType == SPIN_CONTROL_TYPE_FLOAT)
{
CStdString name = property->Attribute("name");
CGUIInfoLabel prop;
- if (!name.IsEmpty() && CGUIControlFactory::GetInfoLabelFromElement(property, prop, parentID))
+ if (!name.empty() && CGUIControlFactory::GetInfoLabelFromElement(property, prop, parentID))
{
SetProperty(name, prop.GetLabel(parentID, true).c_str());
if (!prop.IsConstant())
character_t style = *it & 0xffff0000;
if (style != sectionStyle)
{
- if (!sectionText.IsEmpty())
+ if (!sectionText.empty())
{ // style has changed, bidi flip text
CStdStringW sectionFlipped = BidiFlip(sectionText, forceLTRReadingOrder);
for (unsigned int j = 0; j < sectionFlipped.size(); j++)
}
// handle the last section
- if (!sectionText.IsEmpty())
+ if (!sectionText.empty())
{
CStdStringW sectionFlipped = BidiFlip(sectionText, forceLTRReadingOrder);
for (unsigned int j = 0; j < sectionFlipped.size(); j++)
bool CGUITextureBase::AllocResources()
{
- if (m_info.filename.IsEmpty())
+ if (m_info.filename.empty())
return false;
if (m_texture.size())
m_frameHeight = (float)m_texture.m_height;
// load the diffuse texture (if necessary)
- if (!m_info.diffuse.IsEmpty())
+ if (!m_info.diffuse.empty())
{
m_diffuse = g_TextureManager.Load(m_info.diffuse);
}
void CGUIWindowManager::ChangeActiveWindow(int newWindow, const CStdString& strPath)
{
vector<CStdString> params;
- if (!strPath.IsEmpty())
+ if (!strPath.empty())
params.push_back(strPath);
ActivateWindow(newWindow, params, true);
}
void CGUIWindowManager::ActivateWindow(int iWindowID, const CStdString& strPath)
{
vector<CStdString> params;
- if (!strPath.IsEmpty())
+ if (!strPath.empty())
params.push_back(strPath);
ActivateWindow(iWindowID, params, false);
}
CStdString CLocalizeStrings::ToUTF8(const CStdString& strEncoding, const CStdString& str)
{
- if (strEncoding.IsEmpty())
+ if (strEncoding.empty())
return str;
CStdString ret;
if (bSourceLanguage && !PODoc.GetMsgid().empty())
{
- if (bStrInMem && (m_strings[id + offset].strOriginal.IsEmpty() ||
+ if (bStrInMem && (m_strings[id + offset].strOriginal.empty() ||
PODoc.GetMsgid() == m_strings[id + offset].strOriginal))
continue;
else if (bStrInMem)
StringUtils::ToUpper(searchString);
CStdString tag( g_advancedSettings.m_stereoscopicflags_sbs );
- if (stereoMode.empty() && !tag.IsEmpty())
+ if (stereoMode.empty() && !tag.empty())
{
StringUtils::ToUpper(tag);
StringUtils::SplitString(tag, "|", tags);
}
tag = g_advancedSettings.m_stereoscopicflags_tab;
- if (stereoMode.empty() && !tag.IsEmpty())
+ if (stereoMode.empty() && !tag.empty())
{
StringUtils::ToUpper(tag);
StringUtils::SplitString(tag, "|", tags);
CGUIDialogSelect* pDlgSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDlgSelect->Reset();
- if (heading.IsEmpty())
+ if (heading.empty())
pDlgSelect->SetHeading(g_localizeStrings.Get(36528).c_str());
else
pDlgSelect->SetHeading(heading.c_str());
RENDER_STEREO_MODE mode = RENDER_STEREO_MODE_OFF;
CStdString playerMode = g_infoManager.GetLabel(VIDEOPLAYER_STEREOSCOPIC_MODE);
- if (!playerMode.IsEmpty())
+ if (!playerMode.empty())
{
int convertedMode = ConvertVideoToGuiStereoMode(playerMode);
if (convertedMode > -1)
// if we are the theme bundle, we only load if the user has chosen
// a valid theme (or the skin has a default one)
CStdString theme = CSettings::Get().GetString("lookandfeel.skintheme");
- if (!theme.IsEmpty() && theme.CompareNoCase("SKINDEFAULT"))
+ if (!theme.empty() && theme.CompareNoCase("SKINDEFAULT"))
{
CStdString themeXBT(URIUtils::ReplaceExtension(theme, ".xbt"));
strPath = URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(), "media");
// if we are the theme bundle, we only load if the user has chosen
// a valid theme (or the skin has a default one)
CStdString theme = CSettings::Get().GetString("lookandfeel.skintheme");
- if (!theme.IsEmpty() && theme.CompareNoCase("SKINDEFAULT"))
+ if (!theme.empty() && theme.CompareNoCase("SKINDEFAULT"))
{
CStdString themeXPR(URIUtils::ReplaceExtension(theme, ".xpr"));
strPath = URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(), "media");
if (path)
*path = fullPath;
- return !fullPath.IsEmpty();
+ return !fullPath.empty();
}
const CTextureArray& CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleOnly /*= false */)
void CGUITextureManager::AddTexturePath(const CStdString &texturePath)
{
CSingleLock lock(m_section);
- if (!texturePath.IsEmpty())
+ if (!texturePath.empty())
m_texturePaths.push_back(texturePath);
}
int CButtonTranslator::TranslateWindow(const CStdString &window)
{
CStdString strWindow(window);
- if (strWindow.IsEmpty())
+ if (strWindow.empty())
return WINDOW_INVALID;
strWindow.ToLower();
// eliminate .xml
void CIrssMessage::SetDataAsString(const CStdString& data)
{
- if (!data || data.IsEmpty())
+ if (!data || data.empty())
{
FreeData();
}
item->SetProperty(LOOKUP_PROPERTY, false);
CStdString title = item->GetVideoInfoTag()->m_strTitle;
- if (title.IsEmpty())
+ if (title.empty())
title = item->GetLabel();
object["item"]["title"] = title;
item->SetProperty(LOOKUP_PROPERTY, false);
CStdString title = item->GetMusicInfoTag()->GetTitle();
- if (title.IsEmpty())
+ if (title.empty())
title = item->GetLabel();
object["item"]["title"] = title;
if (params.size() >= 2)
sync = params[1].Equals("sync");
- if (!strSaveToPath.IsEmpty())
+ if (!strSaveToPath.empty())
{
if (CDirectory::Exists(strSaveToPath))
{
CStdString file = CUtil::GetNextFilename(URIUtils::AddFileToFolder(strSaveToPath, "screenshot%03d.png"), 999);
- if (!file.IsEmpty())
+ if (!file.empty())
{
CScreenShot::TakeScreenshot(file, sync);
}
if (params.size() > 2)
path=params[2];
- if (singleFile || !path.IsEmpty() ||
+ if (singleFile || !path.empty() ||
CGUIDialogFileBrowser::ShowAndGetDirectory(shares,
g_localizeStrings.Get(661), path, true))
{
{
CApplicationMessenger::Get().StartAndroidActivity(params);
}
- else if (execute.Equals("SetStereoMode") && !parameter.IsEmpty())
+ else if (execute.Equals("SetStereoMode") && !parameter.empty())
{
CAction action = CStereoscopicsManager::Get().ConvertActionCommandToAction(execute, parameter);
if (action.GetID() != ACTION_NONE)
if (GetOperator(expression[i]))
{
// cleanup any operand, translate and put into our expression list
- if (!operand.IsEmpty())
+ if (!operand.empty())
{
unsigned int info = g_infoManager.Register(operand, m_context);
if (info)
{
if (allowFile)
{
- if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->GetPath().IsEmpty())
+ if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->GetPath().empty())
object["file"] = item->GetVideoInfoTag()->GetPath().c_str();
- if (item->HasMusicInfoTag() && !item->GetMusicInfoTag()->GetURL().IsEmpty())
+ if (item->HasMusicInfoTag() && !item->GetMusicInfoTag()->GetURL().empty())
object["file"] = item->GetMusicInfoTag()->GetURL().c_str();
if (!object.isMember("file"))
for (int i=0; i < (int)pPlayList->size(); ++i)
{
CFileItemPtr playListItem =(*pPlayList)[i];
- if (playListItem->GetLabel().IsEmpty())
+ if (playListItem->GetLabel().empty())
playListItem->SetLabel(URIUtils::GetFileName(playListItem->GetPath()));
this->pPlayList->Add(playListItem);
{
if (CHECK_FOR_ENTRY(m_vecMonitorCallbackList,(*it)))
{
- if (ID.IsEmpty())
+ if (ID.empty())
(*it)->OnAbortRequested();
else if ((*it)->GetId() == ID)
(*it)->OnAbortRequested();
was used to compile the various Python object files (i.e. .pyo,
.pyc, etc.). */
// check if we are running as real xbmc.app or just binary
- if (!CUtil::GetFrameworksPath(true).IsEmpty())
+ if (!CUtil::GetFrameworksPath(true).empty())
{
// using external python, it's build looking for xxx/lib/python2.6
// so point it to frameworks which is where python2.6 is located
bool CAlbum::operator<(const CAlbum &a) const
{
- if (strMusicBrainzAlbumID.IsEmpty() && a.strMusicBrainzAlbumID.IsEmpty())
+ if (strMusicBrainzAlbumID.empty() && a.strMusicBrainzAlbumID.empty())
{
if (strAlbum < a.strAlbum) return true;
if (strAlbum > a.strAlbum) return false;
long idArtist;
bool operator<(const CArtist& a) const
{
- if (strMusicBrainzArtistID.IsEmpty() && a.strMusicBrainzArtistID.IsEmpty())
+ if (strMusicBrainzArtistID.empty() && a.strMusicBrainzArtistID.empty())
{
if (strArtist < a.strArtist) return true;
if (strArtist > a.strArtist) return false;
CGUIViewStateMusicSearch::CGUIViewStateMusicSearch(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
CStdString strTrackLeft=CSettings::Get().GetString("musicfiles.librarytrackformat");
- if (strTrackLeft.IsEmpty())
+ if (strTrackLeft.empty())
strTrackLeft = CSettings::Get().GetString("musicfiles.trackformat");
CStdString strTrackRight=CSettings::Get().GetString("musicfiles.librarytrackformatright");
- if (strTrackRight.IsEmpty())
+ if (strTrackRight.empty())
strTrackRight = CSettings::Get().GetString("musicfiles.trackformatright");
CStdString strAlbumLeft = g_advancedSettings.m_strMusicLibraryAlbumFormat;
- if (strAlbumLeft.IsEmpty())
+ if (strAlbumLeft.empty())
strAlbumLeft = "%B"; // album
CStdString strAlbumRight = g_advancedSettings.m_strMusicLibraryAlbumFormatRight;
- if (strAlbumRight.IsEmpty())
+ if (strAlbumRight.empty())
strAlbumRight = "%A"; // artist
SortAttribute sortAttribute = SortAttributeNone;
NODE_TYPE NodeType=dir.GetDirectoryChildType(items.GetPath());
CStdString strTrackLeft=CSettings::Get().GetString("musicfiles.librarytrackformat");
- if (strTrackLeft.IsEmpty())
+ if (strTrackLeft.empty())
strTrackLeft = CSettings::Get().GetString("musicfiles.trackformat");
CStdString strTrackRight=CSettings::Get().GetString("musicfiles.librarytrackformatright");
- if (strTrackRight.IsEmpty())
+ if (strTrackRight.empty())
strTrackRight = CSettings::Get().GetString("musicfiles.trackformatright");
CStdString strAlbumLeft = g_advancedSettings.m_strMusicLibraryAlbumFormat;
- if (strAlbumLeft.IsEmpty())
+ if (strAlbumLeft.empty())
strAlbumLeft = "%B"; // album
CStdString strAlbumRight = g_advancedSettings.m_strMusicLibraryAlbumFormatRight;
- if (strAlbumRight.IsEmpty())
+ if (strAlbumRight.empty())
strAlbumRight = "%A"; // artist
CLog::Log(LOGDEBUG,"Album format left = [%s]", strAlbumLeft.c_str());
else if (items.GetContent() == "albums")
{
CStdString strAlbumLeft = g_advancedSettings.m_strMusicLibraryAlbumFormat;
- if (strAlbumLeft.IsEmpty())
+ if (strAlbumLeft.empty())
strAlbumLeft = "%B"; // album
CStdString strAlbumRight = g_advancedSettings.m_strMusicLibraryAlbumFormatRight;
- if (strAlbumRight.IsEmpty())
+ if (strAlbumRight.empty())
strAlbumRight = "%A"; // artist
// album
CGUIViewStateWindowMusicPlaylist::CGUIViewStateWindowMusicPlaylist(const CFileItemList& items) : CGUIViewStateWindowMusic(items)
{
CStdString strTrackLeft=CSettings::Get().GetString("musicfiles.nowplayingtrackformat");
- if (strTrackLeft.IsEmpty())
+ if (strTrackLeft.empty())
strTrackLeft = CSettings::Get().GetString("musicfiles.trackformat");
CStdString strTrackRight=CSettings::Get().GetString("musicfiles.nowplayingtrackformatright");
- if (strTrackRight.IsEmpty())
+ if (strTrackRight.empty())
strTrackRight = CSettings::Get().GetString("musicfiles.trackformatright");
AddSortMethod(SortByNone, 551, LABEL_MASKS(strTrackLeft, strTrackRight, "%L", "")); // Userdefined, Userdefined | FolderName, empty
try
{
// We need at least the title
- if (strTitle.IsEmpty())
+ if (strTitle.empty())
return -1;
if (NULL == m_pDB.get()) return -1;
iTrack, iDuration, iYear,
crc, strFileName.c_str());
- if (strMusicBrainzTrackID.IsEmpty())
+ if (strMusicBrainzTrackID.empty())
strSQL += PrepareSQL(",NULL");
else
strSQL += PrepareSQL(",'%s'", strMusicBrainzTrackID.c_str());
strTitle.c_str(),
iTrack, iDuration, iYear,
crc, strFileName.c_str());
- if (strMusicBrainzTrackID.IsEmpty())
+ if (strMusicBrainzTrackID.empty())
strSQL += PrepareSQL(", strMusicBrainzTrackID = NULL");
else
strSQL += PrepareSQL(", strMusicBrainzTrackID = '%s'", strMusicBrainzTrackID.c_str());
{
m_pDS->close();
// doesnt exists, add it
- if (strMusicBrainzAlbumID.IsEmpty())
+ if (strMusicBrainzAlbumID.empty())
strSQL=PrepareSQL("insert into album (idAlbum, strAlbum, strMusicBrainzAlbumID, strArtists, strGenres, iYear, bCompilation) values( NULL, '%s', NULL, '%s', '%s', %i, %i)",
strAlbum.c_str(),
strArtist.c_str(),
CStdString strGenre = strGenre1;
strGenre.Trim();
- if (strGenre.IsEmpty())
+ if (strGenre.empty())
strGenre=g_localizeStrings.Get(13205); // Unknown
if (NULL == m_pDB.get()) return -1;
CAlbum album;
album.idAlbum = record->at(album_idAlbum).get_asInt();
album.strAlbum = record->at(album_strAlbum).get_asString();
- if (album.strAlbum.IsEmpty())
+ if (album.strAlbum.empty())
album.strAlbum = g_localizeStrings.Get(1050);
album.strMusicBrainzAlbumID = record->at(album_strMusicBrainzAlbumID).get_asString();
album.artist = StringUtils::Split(record->at(album_strArtists).get_asString(), g_advancedSettings.m_musicItemSeparator);
}
m_pDS->close();
- if ( ! strSongsToDelete.IsEmpty() )
+ if ( ! strSongsToDelete.empty() )
{
strSongsToDelete = "(" + strSongsToDelete.TrimRight(",") + ")";
// ok, now delete these songs + all references to them from the linked tables
}
m_pDS->close();
- if ( ! deleteSQL.IsEmpty() )
+ if ( ! deleteSQL.empty() )
{
deleteSQL = "DELETE FROM path WHERE idPath IN (" + deleteSQL.TrimRight(',') + ")";
// do the deletion, and drop our temp table
if (strTitle == "") break;
CStdString strArtist = cddb.getInexactArtist(i);
- if (!strArtist.IsEmpty())
+ if (!strArtist.empty())
strTitle += " - " + strArtist;
pDlgSelect->Add(strTitle);
cddb.getDiskArtist(strDiskArtist);
CStdString str;
- if (strDiskArtist.IsEmpty())
+ if (strDiskArtist.empty())
str = strDiskTitle;
else
str = strDiskTitle + " - " + strDiskArtist;
while (!m_pDS2->eof())
{
CStdString path = m_pDS2->fv("strPath").get_asString();
- if (basePath.IsEmpty())
+ if (basePath.empty())
basePath = path;
else
URIUtils::GetCommonPath(basePath,path);
if (NULL == m_pDS.get()) return false;
CStdString strSQL;
- if (strArtist.IsEmpty())
+ if (strArtist.empty())
strSQL=PrepareSQL("SELECT idAlbum FROM album WHERE album.strAlbum LIKE '%s'", strAlbum.c_str());
else
strSQL=PrepareSQL("SELECT album.idAlbum FROM album WHERE album.strAlbum LIKE '%s' AND album.strArtists LIKE '%s'", strAlbum.c_str(),strArtist.c_str());
if (NULL == m_pDB.get()) return false;
if (NULL == m_pDS.get()) return false;
- if (hash.IsEmpty())
+ if (hash.empty())
{ // this is an empty folder - we need only add it to the path table
// if the path actually exists
if (!CDirectory::Exists(path))
{
try
{
- if (filePath.IsEmpty()) return false;
+ if (filePath.empty()) return false;
if (NULL == m_pDB.get()) return false;
if (NULL == m_pDS.get()) return false;
void CMusicInfoLoader::OnLoaderStart()
{
// Load previously cached items from HD
- if (!m_strCacheFileName.IsEmpty())
+ if (!m_strCacheFileName.empty())
LoadCache(m_strCacheFileName, *m_mapFileItems);
else
{
m_mapFileItems->Clear();
// Save loaded items to HD
- if (!m_strCacheFileName.IsEmpty())
+ if (!m_strCacheFileName.empty())
SaveCache(m_strCacheFileName, *m_pVecItems);
else if (!m_bStop && (m_databaseHits > 1 || m_tagReads > 0))
m_pVecItems->Save();
if (item.HasArt("thumb"))
return true;
CStdString thumb = GetCachedImage(item, "thumb");
- if (thumb.IsEmpty())
+ if (thumb.empty())
{
thumb = item.GetUserMusicThumb(false, folderThumbs);
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
SetCachedImage(item, "thumb", thumb);
}
item.SetArt("thumb", thumb);
- return !thumb.IsEmpty();
+ return !thumb.empty();
}
bool CMusicThumbLoader::FillLibraryArt(CFileItem &item)
iDuration = tag.GetDuration();
bCompilation = tag.GetCompilation();
embeddedArt = tag.GetCoverArtInfo();
- strFileName = tag.GetURL().IsEmpty() ? item.GetPath() : tag.GetURL();
+ strFileName = tag.GetURL().empty() ? item.GetPath() : tag.GetURL();
strThumb = item.GetUserMusicThumb(true);
iStartOffset = item.m_lStartOffset;
iEndOffset = item.m_lEndOffset;
void CGUIDialogMusicInfo::SetLabel(int iControl, const CStdString& strLabel)
{
- if (strLabel.IsEmpty())
+ if (strLabel.empty())
{
SET_CONTROL_LABEL(iControl, (iControl == CONTROL_TEXTAREA) ? (m_bArtistInfo?547:414) : 416);
}
database.GetArtistPath(m_artist.idArtist,strArtistPath);
CFileItem item(strArtistPath,true);
CStdString strLocal = item.GetLocalFanart();
- if (!strLocal.IsEmpty())
+ if (!strLocal.empty())
{
CFileItemPtr itemLocal(new CFileItem("fanart://Local",false));
itemLocal->SetArt("thumb", strLocal);
else
itemDir = item.GetPath();
- if (!itemDir.IsEmpty() && CDirectory::Exists(itemDir))
+ if (!itemDir.empty() && CDirectory::Exists(itemDir))
{
CMediaSource itemSource;
itemSource.strName = g_localizeStrings.Get(36041);
m_pathsToScan.clear();
m_flags = flags;
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
{ // scan all paths in the database. We do this by scanning all paths in the db, and crossing them off the list as
// we go.
m_musicDatabase.Open();
m_pathsToScan.clear();
CFileItemList items;
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
{
m_musicDatabase.Open();
m_musicDatabase.GetAlbumsNav("musicdb://albums/", items);
m_pathsToScan.clear();
CFileItemList items;
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
{
m_musicDatabase.Open();
m_musicDatabase.GetArtistsNav("musicdb://artists/", items, false, -1);
CStdString dbHash;
if ((m_flags & SCAN_RESCAN) || !m_musicDatabase.GetPathHash(strDirectory, dbHash) || dbHash != hash)
{ // path has changed - rescan
- if (dbHash.IsEmpty())
+ if (dbHash.empty())
CLog::Log(LOGDEBUG, "%s Scanning dir '%s' as not in the database", __FUNCTION__, strDirectory.c_str());
else
CLog::Log(LOGDEBUG, "%s Rescanning dir '%s' due to change", __FUNCTION__, strDirectory.c_str());
// set the label to artist
CFileItem item(scraper.GetArtist(i).GetArtist());
CStdString strTemp=scraper.GetArtist(i).GetArtist().strArtist;
- if (!scraper.GetArtist(i).GetArtist().strBorn.IsEmpty())
+ if (!scraper.GetArtist(i).GetArtist().strBorn.empty())
strTemp += " ("+scraper.GetArtist(i).GetArtist().strBorn+")";
if (!scraper.GetArtist(i).GetArtist().genre.empty())
{
// check thumb
CStdString strFolder;
CStdString thumb;
- if (!artist.strPath.IsEmpty())
+ if (!artist.strPath.empty())
{
strFolder = artist.strPath;
- for (int i = 0; i < 3 && thumb.IsEmpty(); ++i)
+ for (int i = 0; i < 3 && thumb.empty(); ++i)
{
CFileItem item(strFolder, true);
thumb = item.GetUserMusicThumb(true);
strFolder = URIUtils::GetParentPath(strFolder);
}
}
- if (thumb.IsEmpty())
+ if (thumb.empty())
thumb = CScraperUrl::GetThumbURL(artist.thumbURL.GetFirstThumb());
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
{
CTextureCache::Get().BackgroundCacheImage(thumb);
artwork.insert(make_pair("thumb", thumb));
// check fanart
CStdString fanart;
- if (!artist.strPath.IsEmpty())
+ if (!artist.strPath.empty())
{
strFolder = artist.strPath;
- for (int i = 0; i < 3 && fanart.IsEmpty(); ++i)
+ for (int i = 0; i < 3 && fanart.empty(); ++i)
{
CFileItem item(strFolder, true);
fanart = item.GetLocalFanart();
strFolder = URIUtils::GetParentPath(strFolder);
}
}
- if (fanart.IsEmpty())
+ if (fanart.empty())
fanart = artist.fanart.GetImageURL();
- if (!fanart.IsEmpty())
+ if (!fanart.empty())
{
CTextureCache::Get().BackgroundCacheImage(fanart);
artwork.insert(make_pair("fanart", fanart));
m_karaokeLayout->GetTextExtent(textWidth, textHeight);
m_karaokeLayout->RenderOutline(x, y, 0, m_colorLyricsOutline, XBFONT_CENTER_X, maxWidth);
- if ( !m_currentPreamble.IsEmpty() )
+ if ( !m_currentPreamble.empty() )
{
float pretextWidth, pretextHeight;
m_preambleLayout->GetTextExtent(pretextWidth, pretextHeight);
}
// Prepare a new first lyric entry with song name and artist.
- if ( m_songName.IsEmpty() )
+ if ( m_songName.empty() )
{
m_songName = URIUtils::GetFileName( getSongFile() );
URIUtils::RemoveExtension( m_songName );
ltitle.timing = 0;
ltitle.text = m_songName;
- if ( !m_artist.IsEmpty() )
+ if ( !m_artist.empty() )
ltitle.text += "[CR][CR]" + m_artist;
newlyrics.push_back( ltitle );
bool CKaraokeLyricsText::HasVideo()
{
- return m_videoFile.IsEmpty() ? false : true;
+ return m_videoFile.empty() ? false : true;
}
void CKaraokeLyricsText::GetVideoParameters(CStdString & path, int64_t & offset)
// Keywords
if ( tempbuf[0] == '@' && tempbuf[1] == 'T' && strlen( tempbuf + 2 ) > 0 )
{
- if ( m_songName.IsEmpty() )
+ if ( m_songName.empty() )
m_songName = convertText( tempbuf + 2 );
else
{
- if ( !m_artist.IsEmpty() )
+ if ( !m_artist.empty() )
m_artist += "[CR]";
m_artist += convertText( tempbuf + 2 );
// Init visialisation variables
CStdString defBkgType = g_advancedSettings.m_karaokeDefaultBackgroundType;
- if ( defBkgType.IsEmpty() || defBkgType == "none" )
+ if ( defBkgType.empty() || defBkgType == "none" )
{
CLog::Log( LOGDEBUG, "Karaoke default background is set to none" );
m_defaultMode = BACKGROUND_NONE;
CLog::Log( LOGDEBUG, "Karaoke default background is visualisation" );
m_defaultMode = BACKGROUND_VISUALISATION;
}
- else if ( defBkgType == "image" && !g_advancedSettings.m_karaokeDefaultBackgroundFilePath.IsEmpty() )
+ else if ( defBkgType == "image" && !g_advancedSettings.m_karaokeDefaultBackgroundFilePath.empty() )
{
CLog::Log( LOGDEBUG, "Karaoke default background is image %s", g_advancedSettings.m_karaokeDefaultBackgroundFilePath.c_str() );
m_defaultMode = BACKGROUND_IMAGE;
m_path = g_advancedSettings.m_karaokeDefaultBackgroundFilePath;
}
- else if ( defBkgType == "video" && !g_advancedSettings.m_karaokeDefaultBackgroundFilePath.IsEmpty() )
+ else if ( defBkgType == "video" && !g_advancedSettings.m_karaokeDefaultBackgroundFilePath.empty() )
{
CLog::Log( LOGDEBUG, "Karaoke default background is video %s", g_advancedSettings.m_karaokeDefaultBackgroundFilePath.c_str() );
m_defaultMode = BACKGROUND_VIDEO;
// Artist: Use track artist or disc artist
CStdString strArtist = cddb.getTrackArtist(iTrack);
- if (strArtist.IsEmpty())
+ if (strArtist.empty())
cddb.getDiskArtist(strArtist);
tag.SetArtist(strArtist);
// Artist: Use track artist or disc artist
CStdString strArtist = ti.cdtext[CDTEXT_PERFORMER];
- if (strArtist.IsEmpty())
+ if (strArtist.empty())
strArtist = discCDText[CDTEXT_PERFORMER];
tag.SetArtist(strArtist);
// Genre: use track or disc genre
CStdString strGenre = ti.cdtext[CDTEXT_GENRE];
- if (strGenre.IsEmpty())
+ if (strGenre.empty())
strGenre = discCDText[CDTEXT_GENRE];
tag.SetGenre( strGenre );
strExtension.ToLower();
strExtension.TrimLeft('.');
- if (strExtension.IsEmpty())
+ if (strExtension.empty())
return NULL;
if (strExtension == "aac" ||
URIUtils::RemoveSlashAtEnd(path );
- if ( !path.IsEmpty() )
+ if ( !path.empty() )
{
CStdString artist = URIUtils::GetFileName( path );
- if ( !artist.IsEmpty() )
+ if ( !artist.empty() )
tag.SetArtist( artist );
}
strExtension.ToLower();
strExtension.TrimLeft('.');
- if (strExtension.IsEmpty())
+ if (strExtension.empty())
{
strExtension = fallbackFileExtension;
- if (strExtension.IsEmpty())
+ if (strExtension.empty())
return false;
strExtension.ToLower();
}
if (flacFile)
SetFlacArt(flacFile, art, tag);
- if (!tag.GetTitle().IsEmpty() || !tag.GetArtist().empty() || !tag.GetAlbum().IsEmpty())
+ if (!tag.GetTitle().empty() || !tag.GetArtist().empty() || !tag.GetAlbum().empty())
tag.SetLoaded();
tag.SetURL(strFileName);
CFileItemPtr pItem = items[i];
pItem->LoadMusicTag();
if (pItem->HasMusicInfoTag() && pItem->GetMusicInfoTag()->Loaded() &&
- !pItem->GetMusicInfoTag()->GetAlbum().IsEmpty())
+ !pItem->GetMusicInfoTag()->GetAlbum().empty())
{
if (m_dlgProgress && bShowInfo)
m_dlgProgress->Close();
// Save this thumb as the directory thumb if it's the only album in the folder (files view nicety)
// We do this by grabbing all the songs in the folder, and checking to see whether they come
// from the same album.
- if (saveDirThumb && CFile::Exists(albumThumb) && !albumPath.IsEmpty() && !URIUtils::IsCDDA(albumPath))
+ if (saveDirThumb && CFile::Exists(albumThumb) && !albumPath.empty() && !URIUtils::IsCDDA(albumPath))
{
CFileItemList items;
GetDirectory(albumPath, items);
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
- if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
+ if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
message.SetStringParam(CSettings::Get().GetString("mymusic.defaultlibview"));
DisplayEmptyDatabaseMessage(false); // reset message state
if (m_bDisplayEmptyDatabaseMessage)
return true;
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
AddSearchFolder();
bool bResult = CGUIWindowMusicBase::GetDirectory(strDirectory, items);
return true;
}
- if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strTitle.IsEmpty())
+ if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strTitle.empty())
{
CGUIWindowVideoNav* pWindow = (CGUIWindowVideoNav*)g_windowManager.GetWindow(WINDOW_VIDEO_NAV);
if (pWindow)
{
CStdString search(GetProperty("search").asString());
CURL::Encode(search);
- if (!search.IsEmpty())
+ if (!search.empty())
{
CStdString path = "musicsearch://" + search + "/";
m_history.ClearSearchHistory();
{ // set label 1+2 from tags
if (m_guiState.get()) m_hideExtensions = m_guiState->HideExtensions();
CStdString strTrackLeft=CSettings::Get().GetString("musicfiles.nowplayingtrackformat");
- if (strTrackLeft.IsEmpty())
+ if (strTrackLeft.empty())
strTrackLeft = CSettings::Get().GetString("musicfiles.trackformat");
CStdString strTrackRight=CSettings::Get().GetString("musicfiles.nowplayingtrackformatright");
- if (strTrackRight.IsEmpty())
+ if (strTrackRight.empty())
strTrackRight = CSettings::Get().GetString("musicfiles.trackformatright");
CLabelFormatter formatter(strTrackLeft, strTrackRight);
formatter.FormatLabels(pItem);
if (!CGUIWindowMusicBase::Update(strDirectory, updateFilterPath))
return false;
- if (m_vecItems->GetContent().IsEmpty())
+ if (m_vecItems->GetContent().empty())
m_vecItems->SetContent("songs");
m_musicInfoLoader.Load(*m_vecItems);
bool CGUIWindowMusicPlaylistEditor::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
items.Clear();
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
{ // root listing - list files:// and musicdb://
CFileItemPtr files(new CFileItem("files://", true));
files->SetLabel(g_localizeStrings.Get(744));
// the window translator does it by using a virtual window id (5)
// is this the first time the window is opened?
- if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
+ if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
message.SetStringParam(CMediaSourceSettings::Get().GetDefaultSource("music"));
return CGUIWindowMusicBase::OnMessage(message);
items.FilterCueItems();
CStdString label;
- if (items.GetLabel().IsEmpty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::Get().GetSources("music"), &label))
+ if (items.GetLabel().empty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::Get().GetSources("music"), &label))
items.SetLabel(label);
return true;
if (!CGUIMediaWindow::Update(strDirectory, updateFilterPath))
return false;
- if (m_vecItems->GetContent().IsEmpty())
+ if (m_vecItems->GetContent().empty())
m_vecItems->SetContent("files");
m_thumbLoader.Load(*m_vecItems);
int status = AIRPLAY_STATUS_OK;
bool needAuth = false;
- if (m_sessionId.IsEmpty())
+ if (m_sessionId.empty())
m_sessionId = "00000000-0000-0000-0000-000000000000";
if (ServerInstance->m_usePassword && !m_bAuthenticated)
pclose(fp);
}
- if (!strIpAddress.IsEmpty())
+ if (!strIpAddress.empty())
{
g_DNSCache.Add(strHostName, strIpAddress);
return true;
// TODO: FIX BETTER DAAP SUPPORT
// server browse should be disabled if we are in DAAP, FTP, HTTP, HTTPS, RSS, HTSP, VTP, TUXBOX, DAV or DAVS
- CONTROL_ENABLE_ON_CONDITION(CONTROL_SERVER_BROWSE, !m_server.IsEmpty() || !(m_protocol == NET_PROTOCOL_FTP ||
+ CONTROL_ENABLE_ON_CONDITION(CONTROL_SERVER_BROWSE, !m_server.empty() || !(m_protocol == NET_PROTOCOL_FTP ||
m_protocol == NET_PROTOCOL_HTTP ||
m_protocol == NET_PROTOCOL_HTTPS ||
m_protocol == NET_PROTOCOL_DAV ||
else if (m_protocol == NET_PROTOCOL_AFP)
url.SetProtocol("afp");
- if (!m_username.IsEmpty())
+ if (!m_username.empty())
{
url.SetUserName(m_username);
- if (!m_password.IsEmpty())
+ if (!m_password.empty())
url.SetPassword(m_password);
}
- if(!m_server.IsEmpty())
+ if(!m_server.empty())
url.SetHostName(m_server);
if (((m_protocol == NET_PROTOCOL_FTP) ||
(m_protocol == NET_PROTOCOL_HTTP) ||
(m_protocol == NET_PROTOCOL_DAV) ||
(m_protocol == NET_PROTOCOL_DAVS) ||
(m_protocol == NET_PROTOCOL_RSS) ||
- (m_protocol == NET_PROTOCOL_DAAP && !m_server.IsEmpty()) ||
+ (m_protocol == NET_PROTOCOL_DAAP && !m_server.empty()) ||
(m_protocol == NET_PROTOCOL_HTSP) ||
(m_protocol == NET_PROTOCOL_VTP) ||
(m_protocol == NET_PROTOCOL_MYTH) ||
(m_protocol == NET_PROTOCOL_TUXBOX) ||
(m_protocol == NET_PROTOCOL_SFTP) ||
(m_protocol == NET_PROTOCOL_NFS))
- && !m_port.IsEmpty() && atoi(m_port.c_str()) > 0)
+ && !m_port.empty() && atoi(m_port.c_str()) > 0)
{
url.SetPort(atoi(m_port));
}
- if (!m_path.IsEmpty())
+ if (!m_path.empty())
url.SetFileName(m_path);
return url.Get();
}
{
CStdString hostName = url.GetHostName();
- if (!hostName.IsEmpty())
+ if (!hostName.empty())
WakeUpHost (hostName, url.Get());
}
if (host.Equals((*it).c_str()))
return; // allready there ..
- if (!host.IsEmpty())
+ if (!host.empty())
hosts.push_back(host);
}
{
CStdString strExtd(strValue);
- if (m_strYear.IsEmpty())
+ if (m_strYear.empty())
{
// Extract Year from extended info
// as a fallback
g_charsetConverter.unknownToUTF8(strExtd.Mid(iPos + 6, 4), m_strYear);
}
- if (m_strGenre.IsEmpty())
+ if (m_strGenre.empty())
{
// Extract ID3 Genre
// as a fallback
case SIOCGIWAP:
{
// This event marks a new access point, so push back the old information
- if (!macAddress.IsEmpty())
+ if (!macAddress.empty())
result.push_back(NetworkAccessPoint(essId, macAddress, signalLevel, encryption, channel));
unsigned char* mac = (unsigned char*)iwe->u.ap_addr.sa_data;
// macAddress is big-endian, write in byte chunks
pos += iwe->len;
}
- if (!macAddress.IsEmpty())
+ if (!macAddress.empty())
result.push_back(NetworkAccessPoint(essId, macAddress, signalLevel, encryption, channel));
free(res_buf);
if (NPT_SUCCEEDED(PLT_UPnPMessageHelper::GetIPAddresses(list)) && list.GetItemCount()) {
m_IP = (*(list.GetFirstItem())).ToString();
}
- else if(m_IP.IsEmpty())
+ else if(m_IP.empty())
m_IP = "localhost";
// start upnp monitoring
const PLT_HttpRequestContext* context /* = NULL */)
{
CStdString path = item.GetPath();
- if (item.HasVideoInfoTag() && !item.GetVideoInfoTag()->GetPath().IsEmpty()) {
+ if (item.HasVideoInfoTag() && !item.GetVideoInfoTag()->GetPath().empty()) {
path = item.GetVideoInfoTag()->GetPath();
- } else if (item.HasMusicInfoTag() && !item.GetMusicInfoTag()->GetURL().IsEmpty()) {
+ } else if (item.HasMusicInfoTag() && !item.GetMusicInfoTag()->GetURL().empty()) {
path = item.GetMusicInfoTag()->GetURL();
}
PLT_MediaItemResource* resource, /* = NULL */
EClientQuirks quirks)
{
- if (!tag.GetURL().IsEmpty() && file_path)
+ if (!tag.GetURL().empty() && file_path)
*file_path = tag.GetURL();
std::vector<std::string> genres = tag.GetGenre();
// some usefull buffers
CStdStringArray strings;
- if (!tag.m_strFileNameAndPath.IsEmpty() && file_path)
+ if (!tag.m_strFileNameAndPath.empty() && file_path)
*file_path = tag.m_strFileNameAndPath;
if (tag.m_iDbId != -1 ) {
// set a title for the object
if (object->m_Title.IsEmpty()) {
- if (!item.GetLabel().IsEmpty()) {
+ if (!item.GetLabel().empty()) {
CStdString title = item.GetLabel();
if (item.IsPlayList() || !item.m_bIsFolder) URIUtils::RemoveExtension(title);
object->m_Title = title;
}
- if (item->GetLabel().IsEmpty()) {
+ if (item->GetLabel().empty()) {
/* if no label try to grab it from node type */
CStdString label;
if (CMusicDatabaseDirectory::GetLabel((const char*)path, label)) {
}
// try to grab title from tag
- if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strTitle.IsEmpty()) {
+ if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strTitle.empty()) {
item->SetLabel(item->GetVideoInfoTag()->m_strTitle);
item->SetLabelPreformated(true);
}
// try to grab it from the folder
- if (item->GetLabel().IsEmpty()) {
+ if (item->GetLabel().empty()) {
CStdString label;
if (CVideoDatabaseDirectory::GetLabel((const char*)path, label)) {
item->SetLabel(label);
CUPnPServer::SortItems(CFileItemList& items, const char* sort_criteria)
{
CStdString criteria(sort_criteria);
- if (criteria.IsEmpty()) {
+ if (criteria.empty()) {
return false;
}
{
CSetting *setting = NULL;
CStdString strKey(currentNode->Attribute("key"));
- if (strKey.IsEmpty())
+ if (strKey.empty())
continue;
CStdString strSettingsType(currentNode->Attribute("type"));
else if (strSettingsType.Equals("enum"))
{
CStdString strEnums(currentNode->Attribute("lvalues"));
- if (!strEnums.IsEmpty())
+ if (!strEnums.empty())
{
vector< pair<int,int> > enums;
vector<std::string> valuesVec;
udev_list_entry_foreach(dev_list_entry, devices)
{
strPath = udev_list_entry_get_name(dev_list_entry);
- if (strPath.IsEmpty())
+ if (strPath.empty())
bContinue = false;
if (bContinue)
if (bContinue)
{
strClass = udev_device_get_sysattr_value(dev, "bDeviceClass");
- if (strClass.IsEmpty())
+ if (strClass.empty())
bContinue = false;
}
}
}
else if ((*it).second->GetType() == SettingTypeInteger)
- bChanged = SetSetting(strKey, (int) (strValue.IsEmpty() ? 0 : atoi(strValue.c_str())));
+ bChanged = SetSetting(strKey, (int) (strValue.empty() ? 0 : atoi(strValue.c_str())));
else if ((*it).second->GetType() == SettingTypeNumber)
- bChanged = SetSetting(strKey, (float) (strValue.IsEmpty() ? 0 : atof(strValue.c_str())));
+ bChanged = SetSetting(strKey, (float) (strValue.empty() ? 0 : atof(strValue.c_str())));
else if ((*it).second->GetType() == SettingTypeBool)
bChanged = SetSetting(strKey, strValue.Equals("1"));
}
if (feature == FEATURE_CEC && !m_bStarted && GetSettingBool("enabled"))
{
// hide settings that have an override set
- if (!GetSettingString("wake_devices_advanced").IsEmpty())
+ if (!GetSettingString("wake_devices_advanced").empty())
SetSettingVisible("wake_devices", false);
- if (!GetSettingString("standby_devices_advanced").IsEmpty())
+ if (!GetSettingString("standby_devices_advanced").empty())
SetSettingVisible("standby_devices", false);
SetConfigurationFromSettings();
else if (!strcmp(strLanguage, "tur"))
strGuiLanguage = "Turkish";
- if (!strGuiLanguage.IsEmpty())
+ if (!strGuiLanguage.empty())
{
CApplicationMessenger::Get().SetGUILanguage(strGuiLanguage);
CLog::Log(LOGDEBUG, "%s - language set to '%s'", __FUNCTION__, strGuiLanguage.c_str());
// read the devices to wake when starting
CStdString strWakeDevices = CStdString(GetSettingString("wake_devices_advanced")).Trim();
m_configuration.wakeDevices.Clear();
- if (!strWakeDevices.IsEmpty())
+ if (!strWakeDevices.empty())
ReadLogicalAddresses(strWakeDevices, m_configuration.wakeDevices);
else
ReadLogicalAddresses(GetSettingInt("wake_devices"), m_configuration.wakeDevices);
// read the devices to power off when stopping
CStdString strStandbyDevices = CStdString(GetSettingString("standby_devices_advanced")).Trim();
m_configuration.powerOffDevices.Clear();
- if (!strStandbyDevices.IsEmpty())
+ if (!strStandbyDevices.empty())
ReadLogicalAddresses(strStandbyDevices, m_configuration.powerOffDevices);
else
ReadLogicalAddresses(GetSettingInt("standby_devices"), m_configuration.powerOffDevices);
for (size_t iPtr = 0; iPtr < strString.size(); iPtr++)
{
CStdString strDevice = CStdString(strString.substr(iPtr, 1)).Trim();
- if (!strDevice.IsEmpty())
+ if (!strDevice.empty())
{
int iDevice(0);
if (sscanf(strDevice.c_str(), "%x", &iDevice) == 1 && iDevice >= 0 && iDevice <= 0xF)
bool bChanged(false);
// only update the advanced setting if it was set by the user
- if (!GetSettingString(strAdvancedSettingName).IsEmpty())
+ if (!GetSettingString(strAdvancedSettingName).empty())
{
CStdString strPowerOffDevices;
for (unsigned int iPtr = CECDEVICE_TV; iPtr <= CECDEVICE_BROADCAST; iPtr++)
CPeripheralDisk::CPeripheralDisk(const PeripheralScanResult& scanResult) :
CPeripheral(scanResult)
{
- m_strDeviceName = scanResult.m_strDeviceName.IsEmpty() ? g_localizeStrings.Get(35003) : scanResult.m_strDeviceName;
+ m_strDeviceName = scanResult.m_strDeviceName.empty() ? g_localizeStrings.Get(35003) : scanResult.m_strDeviceName;
m_features.push_back(FEATURE_DISK);
}
CPeripheral(scanResult),
m_bInitialised(false)
{
- m_strDeviceName = scanResult.m_strDeviceName.IsEmpty() ? g_localizeStrings.Get(35001) : scanResult.m_strDeviceName;
+ m_strDeviceName = scanResult.m_strDeviceName.empty() ? g_localizeStrings.Get(35001) : scanResult.m_strDeviceName;
m_features.push_back(FEATURE_HID);
}
CPeripheralHID::~CPeripheralHID(void)
{
- if (!m_strKeymap.IsEmpty() && !GetSettingBool("do_not_use_custom_keymap"))
+ if (!m_strKeymap.empty() && !GetSettingBool("do_not_use_custom_keymap"))
{
CLog::Log(LOGDEBUG, "%s - switching active keymapping to: default", __FUNCTION__);
CButtonTranslator::GetInstance().RemoveDevice(m_strKeymap);
if (HasSetting("keymap"))
m_strKeymap = GetSettingString("keymap");
- if (m_strKeymap.IsEmpty())
+ if (m_strKeymap.empty())
{
m_strKeymap = StringUtils::Format("v%sp%s", VendorIdAsString(), ProductIdAsString());
SetSetting("keymap", m_strKeymap);
if (!IsSettingVisible("keymap"))
SetSettingVisible("do_not_use_custom_keymap", false);
- if (!m_strKeymap.IsEmpty())
+ if (!m_strKeymap.empty())
{
bool bKeymapEnabled(!GetSettingBool("do_not_use_custom_keymap"));
if (bKeymapEnabled)
CPeripheralNIC::CPeripheralNIC(const PeripheralScanResult& scanResult) :
CPeripheral(scanResult)
{
- m_strDeviceName = scanResult.m_strDeviceName.IsEmpty() ? g_localizeStrings.Get(35002) : scanResult.m_strDeviceName;
+ m_strDeviceName = scanResult.m_strDeviceName.empty() ? g_localizeStrings.Get(35002) : scanResult.m_strDeviceName;
m_features.push_back(FEATURE_NIC);
}
strCommand = GetSettingString("flip_remote");
}
- if (!strCommand.IsEmpty())
+ if (!strCommand.empty())
{
CLog::Log(LOGDEBUG, "%s - executing command '%s'", __FUNCTION__, strCommand.c_str());
if (g_application.ExecuteXBMCAction(strCommand))
continue;
CStdString picInfo = g_infoManager.GetLabel(info);
- if (!picInfo.IsEmpty())
+ if (!picInfo.empty())
{
CFileItemPtr item(new CFileItem(g_localizeStrings.Get(SLIDE_STRING_BASE + info)));
item->SetLabel2(picInfo);
case GUI_MSG_WINDOW_INIT:
{
// is this the first time accessing this window?
- if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
+ if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
message.SetStringParam(CMediaSourceSettings::Get().GetDefaultSource("pictures"));
m_dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
return false;
CStdString label;
- if (items.GetLabel().IsEmpty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::Get().GetSources("pictures"), &label))
+ if (items.GetLabel().empty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::Get().GetSources("pictures"), &label))
items.SetLabel(label);
return true;
{ // load first image
CFileItemPtr item = m_slides->Get(m_iCurrentSlide);
CStdString picturePath = GetPicturePath(item.get());
- if (!picturePath.IsEmpty())
+ if (!picturePath.empty())
{
if (item->IsVideo())
CLog::Log(LOGDEBUG, "Loading the thumb %s for current video %d: %s", picturePath.c_str(), m_iCurrentSlide, item->GetPath().c_str());
m_iLastFailedNextSlide = -1;
CFileItemPtr item = m_slides->Get(m_iNextSlide);
CStdString picturePath = GetPicturePath(item.get());
- if (!picturePath.IsEmpty() && (!item->IsVideo() || !m_bSlideShow || m_bPause))
+ if (!picturePath.empty() && (!item->IsVideo() || !m_bSlideShow || m_bPause))
{
if (item->IsVideo())
CLog::Log(LOGDEBUG, "Loading the thumb %s for next video %d: %s", picturePath.c_str(), m_iNextSlide, item->GetPath().c_str());
if ((!bNotRandom && CSettings::Get().GetBool("slideshow.shuffle")) || bRandom)
Shuffle();
- if (!beginSlidePath.IsEmpty())
+ if (!beginSlidePath.empty())
Select(beginSlidePath);
if (startSlideShow)
// fetch directory and sort accordingly
CFileItemList items;
- if (!CDirectory::GetDirectory(strPath, items, m_strExtensions.IsEmpty()?g_advancedSettings.m_pictureExtensions:m_strExtensions,DIR_FLAG_NO_FILE_DIRS,true))
+ if (!CDirectory::GetDirectory(strPath, items, m_strExtensions.empty()?g_advancedSettings.m_pictureExtensions:m_strExtensions,DIR_FLAG_NO_FILE_DIRS,true))
return;
items.Sort(method, order, sortAttributes);
if (isVideo)
{
picturePath = item->GetArt("thumb");
- if (picturePath.IsEmpty() && !item->HasProperty("nothumb"))
+ if (picturePath.empty() && !item->HasProperty("nothumb"))
{
CPictureThumbLoader thumbLoader;
thumbLoader.LoadItem(item);
picturePath = item->GetArt("thumb");
- if (picturePath.IsEmpty())
+ if (picturePath.empty())
item->SetProperty("nothumb", true);
}
}
m_isLoaded = false;
DllLibExif exifDll;
- if (path.IsEmpty() || !exifDll.Load())
+ if (path.empty() || !exifDll.Load())
return false;
if (exifDll.process_jpeg(path.c_str(), &m_exifInfo, &m_iptcInfo))
CStdString temp;
ar >> temp;
length = min((size_t)temp.GetLength(), length - 1);
- if (!temp.IsEmpty())
+ if (!temp.empty())
memcpy(string, temp.c_str(), length);
string[length] = 0;
}
{ // folder, zip, cbz, rar, cbr, playlist may have a previously cached image
thumb = GetCachedImage(*pItem, "thumb");
}
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
{
CTextureCache::Get().BackgroundCacheImage(thumb);
pItem->SetArt("thumb", thumb);
break;
// if there is something else before playlist marker, this isn't a pls file
- if(!strLine.IsEmpty())
+ if(!strLine.empty())
return false;
}
value = pRef->Attribute("href");
if (value != "")
{
- if(title.IsEmpty())
+ if(title.empty())
title = value;
CLog::Log(LOGINFO, "Adding element %s, %s", title.c_str(), value.c_str());
CStdString lockpass = GetString( pSet, "lockpassword" );
// If url is empty, it doesn't make any sense
- if ( !url.IsEmpty() )
+ if ( !url.empty() )
{
// If the name is empty, use url
- if ( name.IsEmpty() )
+ if ( name.empty() )
name = url;
// Append language to the name, and also set as metadata
- if ( !lang.IsEmpty() )
+ if ( !lang.empty() )
name += " [" + lang + "]";
CStdString info = name;
newItem->SetPath(url);
// Set language as metadata
- if ( !lang.IsEmpty() )
+ if ( !lang.empty() )
newItem->SetProperty("language", lang.c_str() );
// Set category as metadata
- if ( !category.IsEmpty() )
+ if ( !category.empty() )
newItem->SetProperty("category", category.c_str() );
// Set channel as extra info and as metadata
- if ( !channel.IsEmpty() )
+ if ( !channel.empty() )
{
newItem->SetProperty("remotechannel", channel.c_str() );
newItem->SetExtraInfo( "Channel: " + channel );
}
- if ( !lockpass.IsEmpty() )
+ if ( !lockpass.empty() )
{
newItem->m_strLockCode = lockpass;
newItem->m_iHasLock = 2;
query = field + " IS NULL OR " + field + parameter;
}
}
- if (query.IsEmpty())
+ if (query.empty())
query = CDatabaseQueryRule::FormatWhereClause(negate, oper, param, db, strType);
return query;
}
if ((*it)->m_field == FieldPlaylist)
{
CStdString playlistFile = CSmartPlaylistDirectory::GetPlaylistByName((*it)->m_parameter.at(0), strType);
- if (!playlistFile.IsEmpty() && referencedPlaylists.find(playlistFile) == referencedPlaylists.end())
+ if (!playlistFile.empty() && referencedPlaylists.find(playlistFile) == referencedPlaylists.end())
{
referencedPlaylists.insert(playlistFile);
CSmartPlaylist playlist;
{
CStdString playlistQuery;
// only playlists of same type will be part of the query
- if (playlist.GetType().Equals(strType) || (playlist.GetType().Equals("mixed") && (strType == "songs" || strType == "musicvideos")) || playlist.GetType().IsEmpty())
+ if (playlist.GetType().Equals(strType) || (playlist.GetType().Equals("mixed") && (strType == "songs" || strType == "musicvideos")) || playlist.GetType().empty())
{
playlist.SetType(strType);
playlistQuery = playlist.GetWhereClause(db, referencedPlaylists);
else
currentRule = (*it)->GetWhereClause(db, strType);
// if we don't get a rule, we add '1' or '0' so the query is still valid and doesn't fail
- if (currentRule.IsEmpty())
+ if (currentRule.empty())
currentRule = m_type == CombinationAnd ? "'1'" : "'0'";
rule += currentRule;
rule += ")";
void CProfile::CLock::Validate()
{
- if (mode != LOCK_MODE_EVERYONE && (code == "-" || code.IsEmpty()))
+ if (mode != LOCK_MODE_EVERYONE && (code == "-" || code.empty()))
mode = LOCK_MODE_EVERYONE;
- if (code.IsEmpty() || mode == LOCK_MODE_EVERYONE)
+ if (code.empty() || mode == LOCK_MODE_EVERYONE)
code = "-";
}
{
CStdString strDate = g_infoManager.GetDate(true);
CStdString strTime = g_infoManager.GetTime();
- if (strDate.IsEmpty() || strTime.IsEmpty())
+ if (strDate.empty() || strTime.empty())
setDate("-");
else
setDate(strDate+" - "+strTime);
if (m_bGetUser)
{
AddButton(1,20142);
- if (!m_strUser.IsEmpty())
+ if (!m_strUser.empty())
m_settings[0].name = StringUtils::Format("%s (%s)",g_localizeStrings.Get(20142).c_str(),m_strUser.c_str());
AddButton(2,12326);
- if (!m_locks.code.IsEmpty())
+ if (!m_locks.code.empty())
m_settings[1].name = StringUtils::Format("%s (%s)",g_localizeStrings.Get(12326).c_str(),g_localizeStrings.Get(20141).c_str());
if (m_saveUserDetails)
AddBool(3, 13423, m_saveUserDetails);
SET_CONTROL_LABEL(1001,m_strDirectory);
CGUIImage *pImage = (CGUIImage*)GetControl(2);
if (pImage)
- pImage->SetFileName(!m_strThumb.IsEmpty() ? m_strThumb : m_strDefaultImage);
+ pImage->SetFileName(!m_strThumb.empty() ? m_strThumb : m_strDefaultImage);
}
void CGUIDialogProfileSettings::CreateSettings()
VECSOURCES shares;
g_mediaManager.GetLocalDrives(shares);
CFileItemList items;
- if (!m_strThumb.IsEmpty())
+ if (!m_strThumb.empty())
{
CFileItemPtr item(new CFileItem("thumb://Current", false));
item->SetArt("thumb", m_strThumb);
{
pImage->SetFileName("");
pImage->SetInvalid();
- pImage->SetFileName(!m_strThumb.IsEmpty() ? m_strThumb : m_strDefaultImage);
+ pImage->SetFileName(!m_strThumb.empty() ? m_strThumb : m_strDefaultImage);
}
}
}
share.strPath = "special://masterprofile/profiles/";
shares.push_back(share);
CStdString strDirectory;
- if (dir.IsEmpty())
+ if (dir.empty())
strDirectory = share.strPath;
else
strDirectory = URIUtils::AddFileToFolder("special://masterprofile/", dir);
dialog->m_strDirectory.clear();
dialog->m_strThumb.clear();
// prompt for a name
- if (!CGUIKeyboardFactory::ShowAndGetInput(dialog->m_strName,g_localizeStrings.Get(20093),false) || dialog->m_strName.IsEmpty())
+ if (!CGUIKeyboardFactory::ShowAndGetInput(dialog->m_strName,g_localizeStrings.Get(20093),false) || dialog->m_strName.empty())
return false;
// create a default path
CStdString defaultDir = URIUtils::AddFileToFolder("profiles",CUtil::MakeLegalFileName(dialog->m_strName));
{
if (iProfile >= CProfilesManager::Get().GetNumberOfProfiles())
{
- if (dialog->m_strName.IsEmpty() || dialog->m_strDirectory.IsEmpty())
+ if (dialog->m_strName.empty() || dialog->m_strDirectory.empty())
return false;
/*CStdString strLabel;
strLabel.Format(g_localizeStrings.Get(20047),dialog->m_strName);
CFileItemPtr item(new CFileItem(profile->getName()));
item->SetProperty("Addon.Summary", locked); // lock setting
CStdString thumb = profile->getThumb();
- if (thumb.IsEmpty())
+ if (thumb.empty())
thumb = "unknown-user.png";
item->SetIconImage(thumb);
items.Add(item);
m_dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
// is this the first time accessing this window?
- if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
+ if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
message.SetStringParam(CMediaSourceSettings::Get().GetDefaultSource("programs"));
return CGUIMediaWindow::OnMessage(message);
for (unsigned int iChannelPtr = 0; iChannelPtr + iDeletedChannels < channelsToDelete.size() && iChannelPtr < 50; iChannelPtr++)
strChannelsToDelete.AppendFormat(", %d", channelsToDelete.at(iDeletedChannels + iChannelPtr));
- if (!strChannelsToDelete.IsEmpty())
+ if (!strChannelsToDelete.empty())
{
strChannelsToDelete = strChannelsToDelete.Right(strChannelsToDelete.length() - 2);
strWhereClause = FormatSQL("idGroup = %u AND idChannel IN (%s)", group.GroupID(), strChannelsToDelete.c_str());
member.channel->ChannelID(), group.GroupID(), member.iChannelNumber);
CStdString strValue = GetSingleValue("map_channelgroups_channels", "idChannel", strWhereClause);
- if (strValue.IsEmpty())
+ if (strValue.empty())
{
strQuery = FormatSQL("REPLACE INTO map_channelgroups_channels ("
"idGroup, idChannel, iChannelNumber) "
bool CPVRDatabase::Delete(const CPVRClient &client)
{
/* invalid client uid */
- if (client.ID().IsEmpty())
+ if (client.ID().empty())
{
CLog::Log(LOGERROR, "PVR - %s - invalid client uid", __FUNCTION__);
return false;
CStdString strWhereClause = FormatSQL("sUid = '%s'", strClientUid.c_str());
CStdString strValue = GetSingleValue("clients", "idClient", strWhereClause);
- if (strValue.IsEmpty())
+ if (strValue.empty())
return -1;
return atol(strValue.c_str());
bool CPVRDatabase::Persist(CPVRChannelGroup &group)
{
bool bReturn(false);
- if (group.GroupName().IsEmpty())
+ if (group.GroupName().empty())
{
CLog::Log(LOGERROR, "%s - empty group name", __FUNCTION__);
return bReturn;
int iReturn(-1);
/* invalid client uid or name */
- if (client->Name().IsEmpty() || client->ID().IsEmpty())
+ if (client->Name().empty() || client->ID().empty())
{
CLog::Log(LOGERROR, "PVR - %s - invalid client uid or name", __FUNCTION__);
return iReturn;
void CPVRGUIInfo::CharInfoBackendName(CStdString &strValue) const
{
- if (m_strBackendName.IsEmpty())
+ if (m_strBackendName.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strBackendName.c_str());
void CPVRGUIInfo::CharInfoBackendVersion(CStdString &strValue) const
{
- if (m_strBackendVersion.IsEmpty())
+ if (m_strBackendVersion.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strBackendVersion.c_str());
void CPVRGUIInfo::CharInfoBackendHost(CStdString &strValue) const
{
- if (m_strBackendHost.IsEmpty())
+ if (m_strBackendHost.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strBackendHost.c_str());
void CPVRGUIInfo::CharInfoBackendDiskspace(CStdString &strValue) const
{
- if (m_strBackendDiskspace.IsEmpty())
+ if (m_strBackendDiskspace.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strBackendDiskspace.c_str());
void CPVRGUIInfo::CharInfoBackendChannels(CStdString &strValue) const
{
- if (m_strBackendChannels.IsEmpty())
+ if (m_strBackendChannels.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strBackendChannels.c_str());
void CPVRGUIInfo::CharInfoBackendTimers(CStdString &strValue) const
{
- if (m_strBackendTimers.IsEmpty())
+ if (m_strBackendTimers.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strBackendTimers.c_str());
void CPVRGUIInfo::CharInfoBackendRecordings(CStdString &strValue) const
{
- if (m_strBackendRecordings.IsEmpty())
+ if (m_strBackendRecordings.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strBackendRecordings.c_str());
void CPVRGUIInfo::CharInfoPlayingClientName(CStdString &strValue) const
{
- if (m_strPlayingClientName.IsEmpty())
+ if (m_strPlayingClientName.empty())
strValue = StringUtils::Format("%s", g_localizeStrings.Get(13205).c_str());
else
strValue = StringUtils::Format("%s", m_strPlayingClientName.c_str());
return false;
const CStdString strWakeupCommand = CSettings::Get().GetString("pvrpowermanagement.setwakeupcmd");
- if (!strWakeupCommand.IsEmpty() && m_timers)
+ if (!strWakeupCommand.empty() && m_timers)
{
time_t iWakeupTime;
const CDateTime nextEvent = m_timers->GetNextEventTime();
{
CLog::Log(LOGDEBUG, "add-on '%s' can not play channel '%s'", GetFriendlyName().c_str(), channel.ChannelName().c_str());
}
- else if (!channel.StreamURL().IsEmpty())
+ else if (!channel.StreamURL().empty())
{
CLog::Log(LOGDEBUG, "opening live stream on url '%s'", channel.StreamURL().c_str());
bReturn = true;
// different backend
currentChannel->ClientID() != channel.ClientID() ||
// stream URL should always be opened as a new file
- !channel.StreamURL().IsEmpty() || !currentChannel->StreamURL().IsEmpty())
+ !channel.StreamURL().empty() || !currentChannel->StreamURL().empty())
{
- if (channel.StreamURL().IsEmpty())
+ if (channel.StreamURL().empty())
{
CloseStream();
bSwitchSuccessful = OpenStream(channel, true);
m_bEPGCreated = false;
m_bChanged = false;
- if (m_strChannelName.IsEmpty())
+ if (m_strChannelName.empty())
m_strChannelName = StringUtils::Format("%s %d", g_localizeStrings.Get(19029).c_str(), m_iUniqueId);
UpdateEncryptionName();
SetClientChannelName(channel.ClientChannelName());
CSingleLock lock(m_critSection);
- if (m_strChannelName.IsEmpty())
+ if (m_strChannelName.empty())
SetChannelName(channel.ClientChannelName());
- if (m_strIconPath.IsEmpty()||(!m_strIconPath.Equals(channel.IconPath()) && !IsUserSetIcon()))
+ if (m_strIconPath.empty()||(!m_strIconPath.Equals(channel.IconPath()) && !IsUserSetIcon()))
SetIconPath(channel.IconPath());
return m_bChanged;
/* did the user change the icon? */
if (bIsUserSetIcon)
- m_bIsUserSetIcon = !m_strIconPath.IsEmpty();
+ m_bIsUserSetIcon = !m_strIconPath.empty();
return true;
}
{
CStdString strName(strChannelName);
- if (strName.IsEmpty())
+ if (strName.empty())
strName = StringUtils::Format(g_localizeStrings.Get(19085).c_str(), ClientChannelNumber());
CSingleLock lock(m_critSection);
bool CPVRChannel::IsEmpty() const
{
CSingleLock lock(m_critSection);
- return (m_strFileNameAndPath.IsEmpty() ||
- m_strStreamURL.IsEmpty());
+ return (m_strFileNameAndPath.empty() ||
+ m_strStreamURL.empty());
}
/********** Client related channel methods **********/
if (m_strEPGScraper != strScraper)
{
- bool bCleanEPG = !m_strEPGScraper.IsEmpty() || strScraper.IsEmpty();
+ bool bCleanEPG = !m_strEPGScraper.empty() || strScraper.empty();
/* update the scraper name */
m_strEPGScraper = StringUtils::Format("%s", strScraper.c_str());
PVRChannelGroupMember groupMember = m_members.at(ptr);
/* skip if an icon is already set */
- if (!groupMember.channel->IconPath().IsEmpty())
+ if (!groupMember.channel->IconPath().empty())
continue;
CStdString strBasePath = CSettings::Get().GetString("pvrmenu.iconpath");
bool CPVRChannelGroups::Update(const CPVRChannelGroup &group, bool bSaveInDb)
{
- if (group.GroupName().IsEmpty() && group.GroupID() <= 0)
+ if (group.GroupName().empty() && group.GroupID() <= 0)
return true;
CPVRChannelGroupPtr updateGroup;
CStdString strURL = "";
if (CGUIKeyboardFactory::ShowAndGetInput(strURL, g_localizeStrings.Get(19214), false))
{
- if (!strURL.IsEmpty())
+ if (!strURL.empty())
{
CPVRChannel *newchannel = new CPVRChannel(m_bIsRadio);
newchannel->SetChannelName(g_localizeStrings.Get(19204));
CPVRTimerInfoTag* tag = m_timerItem->GetPVRTimerInfoTag();
// Set the timer's title to the channel name if it's 'New Timer' or empty
- if (tag->m_strTitle == g_localizeStrings.Get(19056) || tag->m_strTitle.IsEmpty())
+ if (tag->m_strTitle == g_localizeStrings.Get(19056) || tag->m_strTitle.empty())
{
CPVRChannelPtr channel = g_PVRChannelGroups->GetByUniqueID(tag->m_iClientChannelUid, tag->m_iClientId);
if (channel)
void CPVRRecording::UpdatePath(void)
{
- if (!m_strStreamURL.IsEmpty())
+ if (!m_strStreamURL.empty())
{
m_strFileNameAndPath = m_strStreamURL;
}
CStdString strChannel;
strTitle.Replace('/',' ');
- if (!m_strDirectory.IsEmpty())
+ if (!m_strDirectory.empty())
strDirectory = StringUtils::Format("%s/", m_strDirectory.c_str());
- if (!m_strChannelName.IsEmpty())
+ if (!m_strChannelName.empty())
strChannel = StringUtils::Format(" (%s)", m_strChannelName.c_str());
m_strFileNameAndPath = StringUtils::Format("pvr://recordings/%s%s, TV%s, %s.pvr", strDirectory.c_str(), strTitle.c_str(), strChannel.c_str(), strDatetime.c_str());
}
CStdString strUseBase = TrimSlashes(strBase);
/* strip the base or return an empty value if it doesn't fit or match */
- if (!strUseBase.IsEmpty())
+ if (!strUseBase.empty())
{
/* adding "/" to make sure that base matches the complete folder name and not only parts of it */
if (strUsePath.GetLength() <= strUseBase.GetLength() || strUsePath.Left(strUseBase.GetLength() + 1) != strUseBase + "/")
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
pFileItem->SetPath(current->m_strFileNameAndPath);
- if (!current->m_strIconPath.IsEmpty())
+ if (!current->m_strIconPath.empty())
pFileItem->SetIconImage(current->m_strIconPath);
- if (!current->m_strThumbnailPath.IsEmpty())
+ if (!current->m_strThumbnailPath.empty())
pFileItem->SetArt("thumb", current->m_strThumbnailPath);
- if (!current->m_strFanartPath.IsEmpty())
+ if (!current->m_strFanartPath.empty())
pFileItem->SetArt("fanart", current->m_strFanartPath);
pFileItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, pFileItem->GetPVRRecordingInfoTag()->m_playCount > 0);
{
CPVRRecording *current = m_recordings.at(iRecordingPtr);
const CStdString strCurrent = GetDirectoryFromPath(current->m_strDirectory, strUseBase);
- if (strCurrent.IsEmpty())
+ if (strCurrent.empty())
continue;
CStdString strFilePath;
m_iGenreSubType = tag.m_iGenreSubType;
m_strSummary = tag.m_strSummary;
- if (m_strSummary.IsEmpty())
+ if (m_strSummary.empty())
UpdateSummary();
return true;
CStdString strMessage;
GetNotificationText(strMessage);
- if (!strMessage.IsEmpty())
+ if (!strMessage.empty())
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(19166), strMessage);
}
}
CFileItemList items;
CPVRChannel *channel = item->GetPVRChannelInfoTag();
- if (!channel->IconPath().IsEmpty())
+ if (!channel->IconPath().empty())
{
/* add the current thumb, if available */
CFileItemPtr current(new CFileItem("thumb://Current", false));
/* check if the recording tag is valid */
CPVRRecording *recTag = (CPVRRecording *) item->GetPVRRecordingInfoTag();
- if (!recTag || recTag->m_strRecordingId.IsEmpty())
+ if (!recTag || recTag->m_strRecordingId.empty())
return bReturn;
/* show a confirmation dialog */
if (channel && (g_PVRManager.IsPlayingTV() || g_PVRManager.IsPlayingRadio()) &&
(channel->IsRadio() == g_PVRManager.IsPlayingRadio()))
{
- if (channel->StreamURL().IsEmpty())
+ if (channel->StreamURL().empty())
bSwitchSuccessful = g_application.m_pPlayer->SwitchChannel(*channel);
}
buttons.Add(CONTEXT_BUTTON_FIND, 19003); /* Find similar program */
buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 12021); /* Play this recording */
CStdString resumeString = GetResumeString(*pItem);
- if (!resumeString.IsEmpty())
+ if (!resumeString.empty())
{
buttons.Add(CONTEXT_BUTTON_RESUME_ITEM, resumeString);
}
{
int choice = CONTEXT_BUTTON_PLAY_ITEM;
CStdString resumeString = GetResumeString(*pItem);
- if (!resumeString.IsEmpty())
+ if (!resumeString.empty())
{
CContextButtons choices;
choices.Add(CONTEXT_BUTTON_RESUME_ITEM, resumeString);
ParseSettingsFile(CProfilesManager::Get().GetUserDataItem("advancedsettings.xml"));
// Add the list of disc stub extensions (if any) to the list of video extensions
- if (!m_discStubExtensions.IsEmpty())
+ if (!m_discStubExtensions.empty())
m_videoExtensions += "|" + m_discStubExtensions;
return true;
if (pTo)
strTo = pTo->FirstChild()->Value();
- if (!strFrom.IsEmpty() && !strTo.IsEmpty())
+ if (!strFrom.empty() && !strTo.empty())
{
CLog::Log(LOGDEBUG," Registering substition pair:");
CLog::Log(LOGDEBUG," From: [%s]", strFrom.c_str());
else
{
// error message about missing tag
- if (strFrom.IsEmpty())
+ if (strFrom.empty())
CLog::Log(LOGERROR," Missing <from> tag");
else
CLog::Log(LOGERROR," Missing <to> tag");
else
return false;
#else
- if(URIUtils::IsDVD(devicePath) || devicePath.IsEmpty())
+ if(URIUtils::IsDVD(devicePath) || devicePath.empty())
return MEDIA_DETECT::CDetectDVDMedia::IsDiscInDrive(); // TODO: switch all ports to use auto sources
else
return true; // Assume other paths to be mounted already
bool CMediaManager::HasOpticalDrive()
{
#ifdef HAS_DVD_DRIVE
- if (!m_strFirstAvailDrive.IsEmpty())
+ if (!m_strFirstAvailDrive.empty())
return true;
#endif
return false;
if (pInfo == NULL)
return "";
- if (mediaPath.IsEmpty() && pInfo->IsAudio(1))
+ if (mediaPath.empty() && pInfo->IsAudio(1))
mediaPath = "cdda://local/";
- if (mediaPath.IsEmpty() && (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1)))
+ if (mediaPath.empty() && (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1)))
mediaPath = "iso9660://";
- if (mediaPath.IsEmpty())
+ if (mediaPath.empty())
mediaPath = devicePath;
#ifdef TARGET_WINDOWS
- if (mediaPath.IsEmpty() || mediaPath.CompareNoCase("iso9660://") == 0)
+ if (mediaPath.empty() || mediaPath.CompareNoCase("iso9660://") == 0)
{
mediaPath = g_mediaManager.TranslateDevicePath("");
URIUtils::AddSlashAtEnd(mediaPath);
bool CWin32StorageProvider::Eject(CStdString mountpath)
{
- if (!mountpath.IsEmpty())
+ if (!mountpath.empty())
{
return CWIN32Util::EjectDrive(mountpath[0]);
}
{
CStdString xbmcPath;
CUtil::GetHomePath(xbmcPath);
- if (xbmcPath.IsEmpty())
+ if (xbmcPath.empty())
return false;
/* Set xbmc path and xbmcbin path */
static_cast<int>(remaining)/60,
static_cast<int>(remaining)%60);
}
- if (iter->second.m_strCommand.IsEmpty() || iter->second.m_fSecs > iter->second.watch.GetElapsedSeconds())
+ if (iter->second.m_strCommand.empty() || iter->second.m_fSecs > iter->second.watch.GetElapsedSeconds())
{
if(!bSilent)
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, strAlarmClock, strMessage);
temperature.SetState(CTemperature::invalid);
- if (cmd.IsEmpty() && m_fProcTemperature == NULL)
+ if (cmd.empty() && m_fProcTemperature == NULL)
return false;
- if (!cmd.IsEmpty())
+ if (!cmd.empty())
{
p = popen (cmd.c_str(), "r");
if (p)
CStdString CEdenVideoArtUpdater::GetCachedVideoThumb(const CFileItem &item)
{
- if (item.m_bIsFolder && !item.GetVideoInfoTag()->m_strPath.IsEmpty())
+ if (item.m_bIsFolder && !item.GetVideoInfoTag()->m_strPath.empty())
return GetThumb(item.GetVideoInfoTag()->m_strPath, CProfilesManager::Get().GetVideoThumbFolder(), true);
- else if (!item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
+ else if (!item.GetVideoInfoTag()->m_strFileNameAndPath.empty())
{
CStdString path = item.GetVideoInfoTag()->m_strFileNameAndPath;
if (URIUtils::IsStack(path))
// Essentially we read the colors in using the proper format, and store them in our own fixed temporary format (3 DWORDS), and then
// write them back in in the specified format.
- if (colorsIn.IsEmpty())
+ if (colorsIn.empty())
return false;
// check for the TVDB RGB triplets "|68,69,59|69,70,58|78,78,68|"
}
CStdString strnewDestFile;
- if(!strDestFile.IsEmpty()) // only do this if we have a destination
+ if(!strDestFile.empty()) // only do this if we have a destination
strnewDestFile = URIUtils::AddFileToFolder(strDestFile, strFileName);
if (pItem->m_bIsFolder)
for (unsigned int i = 0; i < m_dynamicContent[label].size(); i++)
{
dynamicRight = GetMaskContent(m_dynamicContent[label][i], item);
- if ((i == 0 || !dynamicLeft.IsEmpty()) && !dynamicRight.IsEmpty())
+ if ((i == 0 || !dynamicLeft.empty()) && !dynamicRight.empty())
strLabel += m_staticContent[label][i];
strLabel += dynamicRight;
dynamicLeft = dynamicRight;
}
- if (!dynamicLeft.IsEmpty())
+ if (!dynamicLeft.empty())
strLabel += m_staticContent[label][m_dynamicContent[label].size()];
return strLabel;
void CLabelFormatter::FormatLabel(CFileItem *item) const
{
CStdString maskedLabel = GetContent(0, item);
- if (!maskedLabel.IsEmpty())
+ if (!maskedLabel.empty())
item->SetLabel(maskedLabel);
else if (!item->m_bIsFolder && m_hideFileExtensions)
item->RemoveExtension();
value = movie->m_strTitle;
break;
case 'Z':
- if (movie && !movie->m_strShowTitle.IsEmpty())
+ if (movie && !movie->m_strShowTitle.empty())
value = movie->m_strShowTitle;
break;
case 'B':
value = pic->GetDateTimeTaken().GetAsLocalizedDate();
break;
}
- if (!value.IsEmpty())
+ if (!value.empty())
return mask.m_prefix + value + mask.m_postfix;
return "";
}
string CMime::GetMimeType(const CFileItem &item)
{
CStdString path = item.GetPath();
- if (item.HasVideoInfoTag() && !item.GetVideoInfoTag()->GetPath().IsEmpty())
+ if (item.HasVideoInfoTag() && !item.GetVideoInfoTag()->GetPath().empty())
path = item.GetVideoInfoTag()->GetPath();
- else if (item.HasMusicInfoTag() && !item.GetMusicInfoTag()->GetURL().IsEmpty())
+ else if (item.HasMusicInfoTag() && !item.GetMusicInfoTag()->GetURL().empty())
path = item.GetMusicInfoTag()->GetURL();
return GetMimeType(URIUtils::GetExtension(path));
}
http.Cancel();
}
- if (!strXML.IsEmpty() && m_pObserver)
+ if (!strXML.empty() && m_pObserver)
{
// erase any <content:encoded> tags (also unsupported by tinyxml)
int iStart = strXML.Find("<content:encoded>");
bool CScraperUrl::ParseString(CStdString strUrl)
{
- if (strUrl.IsEmpty())
+ if (strUrl.empty())
return false;
CXBMCTinyXML doc;
if (scrURL.m_isgz)
http.SetContentEncoding("gzip");
- if (!scrURL.m_cache.IsEmpty())
+ if (!scrURL.m_cache.empty())
{
strCachePath = URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath,
"scrapers/" + cacheContext + "/" + scrURL.m_cache);
strHTML = converted;
}
- if (!scrURL.m_cache.IsEmpty())
+ if (!scrURL.m_cache.empty())
{
CStdString strCachePath = URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath,
"scrapers/" + cacheContext + "/" + scrURL.m_cache);
// <TAG><url>...</url>...</TAG> (parsed by ParseElement) or <url>...</url> (ditto)
bool CScraperUrl::ParseEpisodeGuide(CStdString strUrls)
{
- if (strUrls.IsEmpty())
+ if (strUrls.empty())
return false;
// ok, now parse the xml file
CStdString CScraperUrl::GetThumbURL(const CScraperUrl::SUrlEntry &entry)
{
- if (entry.m_spoof.IsEmpty())
+ if (entry.m_spoof.empty())
return entry.m_url;
CStdString spoof = entry.m_spoof;
CURL::Encode(spoof);
}
}
- if (strDir.IsEmpty())
+ if (strDir.empty())
{
strDir = "special://temp/";
if (!savingScreenshots)
}
URIUtils::RemoveSlashAtEnd(strDir);
- if (!strDir.IsEmpty())
+ if (!strDir.empty())
{
CStdString file = CUtil::GetNextFilename(URIUtils::AddFileToFolder(strDir, "screenshot%03d.png"), 999);
- if (!file.IsEmpty())
+ if (!file.empty())
{
TakeScreenshot(file, false);
if (savingScreenshots)
}
}
- if (!newDir.IsEmpty())
+ if (!newDir.empty())
{
for (unsigned int i = 0; i < screenShots.size(); i++)
{
m_image->FreeResources();
// render message
- if (!message.IsEmpty())
+ if (!message.empty())
{
if (!m_layoutWasLoading)
{
bool CSplash::Start()
{
- if (m_ImageName.IsEmpty() || !CFile::Exists(m_ImageName))
+ if (m_ImageName.empty() || !CFile::Exists(m_ImageName))
{
CLog::Log(LOGDEBUG, "Splash image %s not found", m_ImageName.c_str());
return false;
return GetLength();
}
- bool IsEmpty() const
- {
- return this->empty();
- }
-
MYTYPE Left(int nCount) const
{
// Range check the count.
else if (format & TIME_FORMAT_H)
strHMS.AppendFormat("%i", hh);
if (format & TIME_FORMAT_MM)
- strHMS.AppendFormat(strHMS.IsEmpty() ? "%02.2i" : ":%02.2i", mm);
+ strHMS.AppendFormat(strHMS.empty() ? "%02.2i" : ":%02.2i", mm);
if (format & TIME_FORMAT_SS)
- strHMS.AppendFormat(strHMS.IsEmpty() ? "%02.2i" : ":%02.2i", ss);
+ strHMS.AppendFormat(strHMS.empty() ? "%02.2i" : ":%02.2i", ss);
return strHMS;
}
ULARGE_INTEGER ULTotal= { { 0 } };
ULARGE_INTEGER ULTotalFree= { { 0 } };
- if( !drive.IsEmpty() && !drive.Equals("*") )
+ if( !drive.empty() && !drive.Equals("*") )
{
#ifdef TARGET_WINDOWS
UINT uidriveType = GetDriveType(( drive + ":\\" ));
fclose(os_release);
- if (!result.IsEmpty())
+ if (!result.empty())
return result;
}
if (fread(buffer, sizeof(char), sizeof(buffer), pipe) > 0 && !ferror(pipe))
result = buffer;
pclose(pipe);
- if (!result.IsEmpty())
+ if (!result.empty())
return result.Trim();
}
FILE* file = NULL;
- for (int i = 0; result.IsEmpty() && release_file[i]; i++)
+ for (int i = 0; result.empty() && release_file[i]; i++)
{
file = fopen(release_file[i], "r");
if (file)
if (fgets(buffer, sizeof(buffer), file))
{
result = buffer;
- if (!result.IsEmpty())
+ if (!result.empty())
return result.Trim();
}
fclose(file);
bool CTextSearch::Search(const CStdString &strHaystack) const
{
- if (strHaystack.IsEmpty() || !IsValid())
+ if (strHaystack.empty() || !IsValid())
return false;
CStdString strSearch(strHaystack);
if(g_tuxbox.GetHttpXML(url,"currentservicedata"))
{
CLog::Log(LOGDEBUG, "%s - receive current service data was successful", __FUNCTION__);
- if(!strCurrentServiceName.IsEmpty()&&
+ if(!strCurrentServiceName.empty()&&
!strCurrentServiceName.Equals("NULL") &&
- !g_tuxbox.sCurSrvData.service_name.IsEmpty() &&
+ !g_tuxbox.sCurSrvData.service_name.empty() &&
!g_tuxbox.sCurSrvData.service_name.Equals("-") &&
!g_tuxbox.vVideoSubChannel.mode)
{
CLog::Log(LOGWARNING, "%s - No %s found", __FUNCTION__, strChild.c_str());
return false;
}
- if (strFilter.IsEmpty())
+ if (strFilter.empty())
{
pNode = pRootElement->FirstChild(strChild.c_str());
if (!pNode)
CLog::Log(LOGWARNING, "%s - No %s found", __FUNCTION__, strChild.c_str());
return false;
}
- if (strFilter.IsEmpty())
+ if (strFilter.empty())
{
pNode = pRootElement->FirstChildElement("e2bouquet");
if (!pNode)
CLog::Log(LOGWARNING, "%s - No %ss found", __FUNCTION__,strChild.c_str());
return false;
}
- if(!strFilter.IsEmpty())
+ if(!strFilter.empty())
{
pNode = pRootElement->FirstChild(strChild.c_str());
if (!pNode)
CLog::Log(LOGWARNING, "%s - No %ss found", __FUNCTION__,strChild.c_str());
return false;
}
- if(!strFilter.IsEmpty())
+ if(!strFilter.empty())
{
pNode = pRootElement->FirstChild(strChild.c_str());
if (!pNode)
{
CURL url(strPath);
CStdString strOptions = url.GetOptions();
- if (strOptions.IsEmpty())
+ if (strOptions.empty())
return false;
if (url.HasOption("path"))
bool CTuxBoxUtil::GetHttpXML(CURL url,CStdString strRequestType)
{
// Check and Set URL Request Option
- if(!strRequestType.IsEmpty())
+ if(!strRequestType.empty())
{
if(strRequestType.Equals("streaminfo"))
{
CLog::Log(LOGDEBUG, "%s PictureIcon Detection is Disabled! Using default icon", __FUNCTION__);
return "";
}
- if (strServiceName.IsEmpty())
+ if (strServiceName.empty())
{
CLog::Log(LOGDEBUG, "%s Service Name is Empty! Can not detect a PictureIcon. Using default icon!", __FUNCTION__);
return "";
// we start with the root path
CStdString dir = url.GetWithoutFilename();
- if (!dir.IsEmpty())
+ if (!dir.empty())
dirs.insert(dirs.begin(), dir);
// we don't need empty token on the end
- if (dirs.size() > 1 && dirs.back().IsEmpty())
+ if (dirs.size() > 1 && dirs.back().empty())
dirs.erase(dirs.end() - 1);
return dirs;
CURL url(strPath);
CStdString strFile = url.GetFileName();
- if ( URIUtils::ProtocolHasParentInHostname(url.GetProtocol()) && strFile.IsEmpty())
+ if ( URIUtils::ProtocolHasParentInHostname(url.GetProtocol()) && strFile.empty())
{
strFile = url.GetHostName();
return GetParentPath(strFile, strParent);
}
else if (url.GetProtocol() == "plugin")
{
- if (!url.GetOptions().IsEmpty())
+ if (!url.GetOptions().empty())
{
url.SetOptions("");
strParent = url.Get();
return true;
}
- if (!url.GetFileName().IsEmpty())
+ if (!url.GetFileName().empty())
{
url.SetFileName("");
strParent = url.Get();
return true;
}
- if (!url.GetHostName().IsEmpty())
+ if (!url.GetHostName().empty())
{
url.SetHostName("");
strParent = url.Get();
if (ProtocolHasParentInHostname(url.GetProtocol()))
return IsHD(url.GetHostName());
- return url.GetProtocol().IsEmpty() || url.GetProtocol() == "file";
+ return url.GetProtocol().empty() || url.GetProtocol() == "file";
}
bool URIUtils::IsDVD(const CStdString& strFile)
{
CStdString strProtocol = url.GetProtocol();
- if (strProtocol.IsEmpty())
+ if (strProtocol.empty())
return false;
// there's nothing to stop internet streams from being stacked
{
CURL url(strFile);
CStdString file = url.GetFileName();
- return file.IsEmpty() || HasSlashAtEnd(file, false);
+ return file.empty() || HasSlashAtEnd(file, false);
}
char kar = strFile.c_str()[strFile.size() - 1];
strFolder = url.Get();
return;
}
- if(url.GetHostName().IsEmpty())
+ if(url.GetHostName().empty())
return;
}
}
CStdString strResult = strFolder;
- if (!strResult.IsEmpty())
+ if (!strResult.empty())
AddSlashAtEnd(strResult);
// Remove any slash at the start of the file
strUrlPath = strType+"://";
- if( !strPwd.IsEmpty() )
+ if( !strPwd.empty() )
{
strBuffer = strPwd;
CURL::Encode(strBuffer);
{
// This routine is case-insensitive.
CStdString strLocStr = "";
- if (!token.IsEmpty())
+ if (!token.empty())
{
ilocalizedTokens i;
i = m_localizedTokens.find(token);
(LOCALIZED_TOKEN_FIRSTID4 <= id && id <= LOCALIZED_TOKEN_LASTID4))
{
CStdString utf8Label(pChild->FirstChild()->Value());
- if (!utf8Label.IsEmpty())
+ if (!utf8Label.empty())
m_localizedTokens.insert(make_pair(utf8Label, id));
}
}
{
// call GetInfo() to make sure that we actually start up
GetInfo(0);
- return !m_info.lastUpdateTime.IsEmpty();
+ return !m_info.lastUpdateTime.empty();
}
const day_forecast &CWeather::GetForecast(int day) const
bResult = true;
strTemp = node->FirstChild()->Value();
const char* clear=node->Attribute("clear");
- if (strStringValue.IsEmpty() || (clear && strcasecmp(clear,"true")==0))
+ if (strStringValue.empty() || (clear && strcasecmp(clear,"true")==0))
strStringValue = strTemp;
else
strStringValue += strSeparator+strTemp;
{
CStdStringArray list;
StringUtils::SplitString(strValue,strSeparator,list);
- for (unsigned int i=0;i<list.size() && !list[i].IsEmpty();++i)
+ for (unsigned int i=0;i<list.size() && !list[i].empty();++i)
SetString(pRootNode,strTag,list[i]);
}
CStdString XBMC::XBMC_MD5::GetMD5(const CStdString &text)
{
- if (text.IsEmpty())
+ if (text.empty())
return "";
XBMC_MD5 state;
CStdString digest;
if (NULL == m_pDB.get()) return false;
if (NULL == m_pDS.get()) return false;
- if (hash.IsEmpty())
+ if (hash.empty())
{ // this is an empty folder - we need only add it to the path table
// if the path actually exists
if (!CDirectory::Exists(path))
idActor = m_pDS->fv("idActor").get_asInt();
m_pDS->close();
// update the thumb url's
- if (!thumbURLs.IsEmpty())
+ if (!thumbURLs.empty())
{
strSQL=PrepareSQL("update actors set strThumb='%s' where idActor=%i",thumbURLs.c_str(),idActor);
m_pDS->exec(strSQL.c_str());
}
}
// add artwork
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
SetArtForItem(idActor, "actor", "thumb", thumb);
return idActor;
}
if (NULL == m_pDS.get()) return ;
CStdString strSQL;
- if (strArtist.IsEmpty()) // TODO: SMARTPLAYLISTS what is this here for???
+ if (strArtist.empty()) // TODO: SMARTPLAYLISTS what is this here for???
strSQL=PrepareSQL("select distinct * from musicvideoview join artistlinkmusicvideo on artistlinkmusicvideo.idMVideo=musicvideoview.idMVideo join actors on actors.idActor=artistlinkmusicvideo.idArtist");
else
strSQL=PrepareSQL("select * from musicvideoview join artistlinkmusicvideo on artistlinkmusicvideo.idMVideo=musicvideoview.idMVideo join actors on actors.idActor=artistlinkmusicvideo.idArtist where actors.strActor='%s'", strArtist.c_str());
{
CStdString sql = PrepareSQL("idShow=%i AND season=%i", showID, season);
CStdString id = GetSingleValue("seasons", "idSeason", sql);
- if (id.IsEmpty())
+ if (id.empty())
return -1;
return strtol(id.c_str(), NULL, 10);
}
for (it=mapAlbums.begin();it != mapAlbums.end();++it)
{
- if (!it->second.first.IsEmpty())
+ if (!it->second.first.empty())
{
CFileItemPtr pItem(new CFileItem(it->second.first));
pItem->GetVideoInfoTag()->m_lastPlayed = jItem->GetVideoInfoTag()->m_lastPlayed;
// check for fanart if not already set
- if (strFanArt.IsEmpty())
+ if (strFanArt.empty())
strFanArt = jItem->GetArt("fanart");
// remove duplicate entry
{
pItem->GetVideoInfoTag()->m_playCount = (pItem->GetVideoInfoTag()->m_iEpisode == (int)pItem->GetProperty("watchedepisodes").asInteger()) ? 1 : 0;
pItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, (pItem->GetVideoInfoTag()->m_playCount > 0) && (pItem->GetVideoInfoTag()->m_iEpisode > 0));
- if (!strFanArt.IsEmpty())
+ if (!strFanArt.empty())
pItem->SetArt("fanart", strFanArt);
}
// increment i to j which is the next item
iPlayCount += jTag->m_playCount;
// episodes dont have fanart yet
- //if (strFanArt.IsEmpty())
+ //if (strFanArt.empty())
// strFanArt = jItem->GetArt("fanart");
paths.push_back(jFileNameAndPath);
pItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, (pItem->GetVideoInfoTag()->m_playCount > 0) && (pItem->GetVideoInfoTag()->m_iEpisode > 0));
// episodes dont have fanart yet
- //if (!strFanArt.IsEmpty())
+ //if (!strFanArt.empty())
// pItem->SetArt("fanart", strFanArt);
}
// increment i to j which is the next item
char column[5];
sprintf(column, "c%0d", VIDEODB_ID_EPISODE_SEASON);
CStdString id = GetSingleValue("episode", column, PrepareSQL("idEpisode=%i", idEpisode));
- if (id.IsEmpty())
+ if (id.empty())
return -1;
return atoi(id.c_str());
}
foundDirectly = false;
try
{
- if (strPath.IsEmpty() || !m_pDB.get() || !m_pDS.get()) return ScraperPtr();
+ if (strPath.empty() || !m_pDB.get() || !m_pDS.get()) return ScraperPtr();
ScraperPtr scraper;
CStdString strPath2;
if (NULL == m_pDS.get()) return;
CStdString strLike;
- if (!strSearch.IsEmpty())
+ if (!strSearch.empty())
strLike = "and actors.strActor like '%%%s%%'";
if (CProfilesManager::Get().GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE && !g_passwordManager.bMasterUser)
strSQL=PrepareSQL("select actors.idActor,actors.strActor,path.strPath from artistlinkmusicvideo,actors,musicvideo,files,path where actors.idActor=artistlinkmusicvideo.idArtist and artistlinkmusicvideo.idMVideo=musicvideo.idMVideo and files.idFile=musicvideo.idFile and files.idPath=path.idPath "+strLike,strSearch.c_str());
if (NULL == m_pDS.get()) return;
CStdString strLike;
- if (!strSearch.IsEmpty())
+ if (!strSearch.empty())
{
strLike = StringUtils::Format("and musicvideo.c%02d",VIDEODB_ID_MUSICVIDEO_ALBUM);
strLike += "like '%%s%%%'";
strSQL=PrepareSQL("select distinct musicvideo.c%02d,musicvideo.idMVideo,path.strPath from musicvideo,files,path where files.idFile=musicvideo.idFile and files.idPath=path.idPath"+strLike,VIDEODB_ID_MUSICVIDEO_ALBUM,strSearch.c_str());
else
{
- if (!strLike.IsEmpty())
+ if (!strLike.empty())
strLike = "where "+strLike.Mid(4);
strSQL=PrepareSQL("select distinct musicvideo.c%02d,musicvideo.idMVideo from musicvideo"+strLike,VIDEODB_ID_MUSICVIDEO_ALBUM,strSearch.c_str());
}
if (NULL == m_pDS.get()) return -1;
CStdString strSQL;
- if (strAlbum.IsEmpty() && strTitle.IsEmpty())
+ if (strAlbum.empty() && strTitle.empty())
{ // we want to return matching artists only
if (CProfilesManager::Get().GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE && !g_passwordManager.bMasterUser)
strSQL=PrepareSQL("select distinct actors.idActor,path.strPath from artistlinkmusicvideo,actors,musicvideo,files,path where actors.idActor=artistlinkmusicvideo.idArtist and artistlinkmusicvideo.idMVideo=musicvideo.idMVideo and files.idFile=musicvideo.idFile and files.idPath=path.idPath and actors.strActor like '%s'",strArtist.c_str());
}
m_pDS->close();
- if ( ! filesToDelete.IsEmpty() )
+ if ( ! filesToDelete.empty() )
{
filesToDelete.TrimRight(",");
// now grab them movies
progress->Progress();
}
- if ( ! filesToDelete.IsEmpty() )
+ if ( ! filesToDelete.empty() )
{
filesToDelete = "(" + filesToDelete + ")";
CLog::Log(LOGDEBUG, "%s: Cleaning files table", __FUNCTION__);
m_pDS->exec(sql.c_str());
}
- if ( ! moviesToDelete.IsEmpty() )
+ if ( ! moviesToDelete.empty() )
{
moviesToDelete = "(" + moviesToDelete.TrimRight(",") + ")";
m_pDS->exec(sql.c_str());
}
- if ( ! episodesToDelete.IsEmpty() )
+ if ( ! episodesToDelete.empty() )
{
episodesToDelete = "(" + episodesToDelete.TrimRight(",") + ")";
m_pDS->next();
}
m_pDS->close();
- if (!strIds.IsEmpty())
+ if (!strIds.empty())
{
strIds.TrimRight(",");
sql = PrepareSQL("delete from path where idPath in (%s)",strIds.c_str());
m_pDS->next();
}
m_pDS->close();
- if (!showsToDelete.IsEmpty())
+ if (!showsToDelete.empty())
{
sql = "delete from tvshow where idShow in (" + showsToDelete.TrimRight(",") + ")";
m_pDS->exec(sql.c_str());
sql = "delete from movielinktvshow where idMovie not in (select distinct idMovie from movie)";
m_pDS->exec(sql.c_str());
- if ( ! musicVideosToDelete.IsEmpty() )
+ if ( ! musicVideosToDelete.empty() )
{
musicVideosToDelete = "(" + musicVideosToDelete.TrimRight(",") + ")";
{
CFileItem item;
item.SetLabel(iter->strName);
- if (!iter->thumb.IsEmpty())
+ if (!iter->thumb.empty())
{
CStdString thumbFile(GetSafeFile(strPath, iter->strName));
CTextureCache::Get().Export(iter->thumb, thumbFile, overwrite);
{
info.Load(movie);
CFileItem item(info);
- bool useFolders = info.m_basePath.IsEmpty() ? LookupByFolders(item.GetPath()) : false;
+ bool useFolders = info.m_basePath.empty() ? LookupByFolders(item.GetPath()) : false;
CStdString filename = info.m_strTitle;
if (info.m_iYear > 0)
filename.AppendFormat("_%i", info.m_iYear);
{
info.Load(movie);
CFileItem item(info);
- bool useFolders = info.m_basePath.IsEmpty() ? LookupByFolders(item.GetPath()) : false;
+ bool useFolders = info.m_basePath.empty() ? LookupByFolders(item.GetPath()) : false;
CStdString filename = StringUtils::Join(info.m_artist, g_advancedSettings.m_videoItemSeparator) + "." + info.m_strTitle;
if (info.m_iYear > 0)
filename.AppendFormat("_%i", info.m_iYear);
URIUtils::AddSlashAtEnd(info.m_strPath);
DeleteTvShow(info.m_strPath);
CFileItem showItem(info);
- bool useFolders = info.m_basePath.IsEmpty() ? LookupByFolders(showItem.GetPath(), true) : false;
+ bool useFolders = info.m_basePath.empty() ? LookupByFolders(showItem.GetPath(), true) : false;
CFileItem artItem(showItem);
CStdString artPath(GetSafeFile(tvshowsDir, info.m_strTitle));
artItem.SetPath(artPath);
m_pathsToScan.clear();
m_pathsToClean.clear();
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
{ // scan all paths in the database. We do this by scanning all paths in the db, and crossing them off the list as
// we go.
m_database.Open();
}
CStdString fastHash = GetFastHash(strDirectory);
- if (m_database.GetPathHash(strDirectory, dbHash) && !fastHash.IsEmpty() && fastHash == dbHash)
+ if (m_database.GetPathHash(strDirectory, dbHash) && !fastHash.empty() && fastHash == dbHash)
{ // fast hashes match - no need to process anything
CLog::Log(LOGDEBUG, "VideoInfoScanner: Skipping dir '%s' due to no change (fasthash)", CURL::GetRedacted(strDirectory).c_str());
hash = fastHash;
items.Stack();
// compute hash
GetPathHash(items, hash);
- if (hash != dbHash && !hash.IsEmpty())
+ if (hash != dbHash && !hash.empty())
{
- if (dbHash.IsEmpty())
+ if (dbHash.empty())
CLog::Log(LOGDEBUG, "VideoInfoScanner: Scanning dir '%s' as not in the database", CURL::GetRedacted(strDirectory).c_str());
else
CLog::Log(LOGDEBUG, "VideoInfoScanner: Rescanning dir '%s' due to change (%s != %s)", CURL::GetRedacted(strDirectory).c_str(), dbHash.c_str(), hash.c_str());
}
else
{ // they're the same or the hash is empty (dir empty/dir not retrievable)
- if (hash.IsEmpty() && !dbHash.IsEmpty())
+ if (hash.empty() && !dbHash.empty())
{
CLog::Log(LOGDEBUG, "VideoInfoScanner: Skipping dir '%s' as it's empty or doesn't exist - adding to clean list", CURL::GetRedacted(strDirectory).c_str());
m_pathsToClean.insert(m_database.GetPathId(strDirectory));
OnDirectoryScanned(strDirectory);
}
// update the hash to a fast hash if needed
- if (CanFastHash(items) && !fastHash.IsEmpty())
+ if (CanFastHash(items) && !fastHash.empty())
hash = fastHash;
}
}
* Next preference is the episode title. If it exists use that for matching the TV Show
* information.
*/
- if (!tag->m_strTitle.IsEmpty())
+ if (!tag->m_strTitle.empty())
{
EPISODE episode;
episode.strPath = item->GetPath();
art["thumb"] = "";
CVideoInfoTag &movieDetails = *pItem->GetVideoInfoTag();
- if (movieDetails.m_basePath.IsEmpty())
+ if (movieDetails.m_basePath.empty())
movieDetails.m_basePath = pItem->GetBaseMoviePath(videoFolder);
movieDetails.m_parentPathID = m_database.AddPath(URIUtils::GetParentPath(movieDetails.m_basePath));
{
// find local trailer first
CStdString strTrailer = pItem->FindTrailer();
- if (!strTrailer.IsEmpty())
+ if (!strTrailer.empty())
movieDetails.m_strTrailer = strTrailer;
lResult = m_database.SetDetailsForMovie(pItem->GetPath(), movieDetails, art);
if (!hasEpisodeGuide)
{
// fetch episode guide
- if (!showInfo.m_strEpisodeGuide.IsEmpty())
+ if (!showInfo.m_strEpisodeGuide.empty())
{
CScraperUrl url;
url.ParseEpisodeGuide(showInfo.m_strEpisodeGuide);
matches.push_back(*guide);
continue;
}
- if (!guide->cScraperUrl.strTitle.IsEmpty() && guide->cScraperUrl.strTitle.CompareNoCase(file->strTitle.c_str()) == 0)
+ if (!guide->cScraperUrl.strTitle.empty() && guide->cScraperUrl.strTitle.CompareNoCase(file->strTitle.c_str()) == 0)
{
bFound = true;
break;
item2.SetPath(firstFile);
nfoFile = GetnfoFile(&item2, bGrabAny);
// else try .nfo file matching stacked title
- if (nfoFile.IsEmpty())
+ if (nfoFile.empty())
{
CStdString stackedTitlePath = dir.GetStackedTitlePath(item->GetPath());
item2.SetPath(stackedTitlePath);
}
// test file existence
- if (!nfoFile.IsEmpty() && !CFile::Exists(nfoFile))
+ if (!nfoFile.empty() && !CFile::Exists(nfoFile))
nfoFile.clear();
- if (nfoFile.IsEmpty()) // final attempt - strip off any cd1 folders
+ if (nfoFile.empty()) // final attempt - strip off any cd1 folders
{
URIUtils::RemoveSlashAtEnd(strPath); // need no slash for the check that follows
CFileItem item2;
}
}
- if (nfoFile.IsEmpty() && item->IsOpticalMediaFile())
+ if (nfoFile.empty() && item->IsOpticalMediaFile())
{
CFileItem parentDirectory(item->GetLocalMetadataPath(), true);
nfoFile = GetnfoFile(&parentDirectory, true);
}
}
// folders (or stacked dvds) can take any nfo file if there's a unique one
- if (item->m_bIsFolder || item->IsOpticalMediaFile() || (bGrabAny && nfoFile.IsEmpty()))
+ if (item->m_bIsFolder || item->IsOpticalMediaFile() || (bGrabAny && nfoFile.empty()))
{
// see if there is a unique nfo file in this folder, and if so, use that
CFileItemList items;
{
CVideoInfoTag movieDetails;
- if (m_handle && !url.strTitle.IsEmpty())
+ if (m_handle && !url.strTitle.empty())
m_handle->SetText(url.strTitle);
CVideoInfoDownloader imdb(scraper);
if (nfoFile)
nfoFile->GetDetails(movieDetails,NULL,true);
- if (m_handle && url.strTitle.IsEmpty())
+ if (m_handle && url.strTitle.empty())
m_handle->SetText(movieDetails.m_strTitle);
if (pDialog)
void CVideoInfoScanner::ApplyThumbToFolder(const CStdString &folder, const CStdString &imdbThumb)
{
// copy icon to folder also;
- if (!imdbThumb.IsEmpty())
+ if (!imdbThumb.empty())
{
CFileItem folderItem(folder, true);
CThumbLoader loader;
DIR_FLAG_NO_FILE_INFO);
for (vector<SActorInfo>::iterator i = actors.begin(); i != actors.end(); ++i)
{
- if (i->thumb.IsEmpty())
+ if (i->thumb.empty())
{
CStdString thumbFile = i->strName;
thumbFile.Replace(" ","_");
break;
}
}
- if (i->thumb.IsEmpty() && !i->thumbUrl.GetFirstThumb().m_url.IsEmpty())
+ if (i->thumb.empty() && !i->thumbUrl.GetFirstThumb().m_url.empty())
i->thumb = CScraperUrl::GetThumbURL(i->thumbUrl.GetFirstThumb());
- if (!i->thumb.IsEmpty())
+ if (!i->thumb.empty())
CTextureCache::Get().BackgroundCacheImage(i->thumb);
}
}
strNfoFile = URIUtils::AddFileToFolder(pItem->GetPath(), "tvshow.nfo");
CNfoFile::NFOResult result=CNfoFile::NO_NFO;
- if (!strNfoFile.IsEmpty() && CFile::Exists(strNfoFile))
+ if (!strNfoFile.empty() && CFile::Exists(strNfoFile))
{
if (info->Content() == CONTENT_TVSHOWS && !pItem->m_bIsFolder)
result = m_nfoReader.Create(strNfoFile,info,pItem->GetVideoInfoTag()->m_iEpisode);
if (!movie) return false;
XMLUtils::SetString(movie, "title", m_strTitle);
- if (!m_strOriginalTitle.IsEmpty())
+ if (!m_strOriginalTitle.empty())
XMLUtils::SetString(movie, "originaltitle", m_strOriginalTitle);
- if (!m_strShowTitle.IsEmpty())
+ if (!m_strShowTitle.empty())
XMLUtils::SetString(movie, "showtitle", m_strShowTitle);
- if (!m_strSortTitle.IsEmpty())
+ if (!m_strSortTitle.empty())
XMLUtils::SetString(movie, "sorttitle", m_strSortTitle);
XMLUtils::SetFloat(movie, "rating", m_fRating);
XMLUtils::SetFloat(movie, "epbookmark", m_fEpBookmark);
XMLUtils::SetString(movie, "filenameandpath", m_strFileNameAndPath);
XMLUtils::SetString(movie, "basepath", m_basePath);
}
- if (!m_strEpisodeGuide.IsEmpty())
+ if (!m_strEpisodeGuide.empty())
{
CXBMCTinyXML doc;
doc.Parse(m_strEpisodeGuide);
actor["name"] = m_cast[i].strName;
actor["role"] = m_cast[i].strRole;
actor["order"] = m_cast[i].order;
- if (!m_cast[i].thumb.IsEmpty())
+ if (!m_cast[i].thumb.empty())
actor["thumbnail"] = CTextureUtils::GetWrappedImageURL(m_cast[i].thumb);
value["cast"].push_back(actor);
}
for (iCast it = m_cast.begin(); it != m_cast.end(); ++it)
{
CStdString character;
- if (it->strRole.IsEmpty() || !bIncludeRole)
+ if (it->strRole.empty() || !bIncludeRole)
character = StringUtils::Format("%s\n", it->strName.c_str());
else
character = StringUtils::Format("%s %s %s\n", it->strName.c_str(), g_localizeStrings.Get(20347).c_str(), it->strRole.c_str());
bool CVideoInfoTag::IsEmpty() const
{
- return (m_strTitle.IsEmpty() &&
- m_strFile.IsEmpty() &&
- m_strPath.IsEmpty());
+ return (m_strTitle.empty() &&
+ m_strFile.empty() &&
+ m_strPath.empty());
}
unsigned int CVideoInfoTag::GetDuration() const
const CStdString& GetPath() const
{
- if (m_strFileNameAndPath.IsEmpty())
+ if (m_strFileNameAndPath.empty())
return m_strPath;
return m_strFileNameAndPath;
};
if (db.Open())
{
if (info->m_iFileId < 0)
- db.SetStreamDetailsForFile(info->m_streamDetails, !info->m_strFileNameAndPath.IsEmpty() ? info->m_strFileNameAndPath : m_item.GetPath());
+ db.SetStreamDetailsForFile(info->m_streamDetails, !info->m_strFileNameAndPath.empty() ? info->m_strFileNameAndPath : m_item.GetPath());
else
db.SetStreamDetailsForFileId(info->m_streamDetails, info->m_iFileId);
bool CVideoThumbLoader::FillLibraryArt(CFileItem &item)
{
CVideoInfoTag &tag = *item.GetVideoInfoTag();
- if (tag.m_iDbId > -1 && !tag.m_type.IsEmpty())
+ if (tag.m_iDbId > -1 && !tag.m_type.empty())
{
map<string, string> artwork;
m_videoDatabase->Open();
if (item.HasArt("thumb"))
return true;
CStdString thumb = GetCachedImage(item, "thumb");
- if (thumb.IsEmpty())
+ if (thumb.empty())
{
thumb = GetLocalArt(item, "thumb");
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
SetCachedImage(item, "thumb", thumb);
}
item.SetArt("thumb", thumb);
- return !thumb.IsEmpty();
+ return !thumb.empty();
}
std::string CVideoThumbLoader::GetLocalArt(const CFileItem &item, const std::string &type, bool checkFolder)
int iControl = message.GetSenderId();
if (iControl == CONTROL_BTN_REFRESH)
{
- if (m_movieItem->GetVideoInfoTag()->m_iSeason < 0 && !m_movieItem->GetVideoInfoTag()->m_strShowTitle.IsEmpty()) // tv show
+ if (m_movieItem->GetVideoInfoTag()->m_iSeason < 0 && !m_movieItem->GetVideoInfoTag()->m_strShowTitle.empty()) // tv show
{
bool bCanceled=false;
if (CGUIDialogYesNo::ShowAndGetInput(20377,20378,-1,-1,bCanceled))
for (CVideoInfoTag::iCast it = m_movieItem->GetVideoInfoTag()->m_cast.begin(); it != m_movieItem->GetVideoInfoTag()->m_cast.end(); ++it)
{
CStdString character;
- if (it->strRole.IsEmpty())
+ if (it->strRole.empty())
character = it->strName;
else
character = StringUtils::Format("%s %s %s", it->strName.c_str(), g_localizeStrings.Get(20347).c_str(), it->strRole.c_str());
CFileItemPtr item(new CFileItem(it->strName));
- if (!it->thumb.IsEmpty())
+ if (!it->thumb.empty())
item->SetArt("thumb", it->thumb);
else if (CSettings::Get().GetBool("videolibrary.actorthumbs"))
{ // backward compatibility
CStdString thumb = CScraperUrl::GetThumbURL(it->thumbUrl.GetFirstThumb());
- if (!thumb.IsEmpty())
+ if (!thumb.empty())
{
item->SetArt("thumb", thumb);
CTextureCache::Get().BackgroundCacheImage(thumb);
// local trailers should always override non-local, so check
// for a local one if the registered trailer is online
- if (m_movieItem->GetVideoInfoTag()->m_strTrailer.IsEmpty() ||
+ if (m_movieItem->GetVideoInfoTag()->m_strTrailer.empty() ||
URIUtils::IsInternetStream(m_movieItem->GetVideoInfoTag()->m_strTrailer))
{
CStdString localTrailer = m_movieItem->FindTrailer();
- if (!localTrailer.IsEmpty())
+ if (!localTrailer.empty())
{
m_movieItem->GetVideoInfoTag()->m_strTrailer = localTrailer;
CVideoDatabase database;
{
// setup plot text area
CStdString strTmp = m_movieItem->GetVideoInfoTag()->m_strPlot;
- if (!(!m_movieItem->GetVideoInfoTag()->m_strShowTitle.IsEmpty() && m_movieItem->GetVideoInfoTag()->m_iSeason == 0)) // dont apply to tvshows
+ if (!(!m_movieItem->GetVideoInfoTag()->m_strShowTitle.empty() && m_movieItem->GetVideoInfoTag()->m_iSeason == 0)) // dont apply to tvshows
if (m_movieItem->GetVideoInfoTag()->m_playCount == 0 && !CSettings::Get().GetBool("videolibrary.showunwatchedplots"))
strTmp = g_localizeStrings.Get(20370);
void CGUIDialogVideoInfo::Play(bool resume)
{
- if (!m_movieItem->GetVideoInfoTag()->m_strEpisodeGuide.IsEmpty())
+ if (!m_movieItem->GetVideoInfoTag()->m_strEpisodeGuide.empty())
{
CStdString strPath = StringUtils::Format("videodb://tvshows/titles/%i/",m_movieItem->GetVideoInfoTag()->m_iDbId);
Close();
}
CFileItem movie(*m_movieItem->GetVideoInfoTag());
- if (m_movieItem->GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
+ if (m_movieItem->GetVideoInfoTag()->m_strFileNameAndPath.empty())
movie.SetPath(m_movieItem->GetPath());
CGUIWindowVideoNav* pWindow = (CGUIWindowVideoNav*)g_windowManager.GetWindow(WINDOW_VIDEO_NAV);
if (pWindow)
}
CStdString strLocal = item.GetLocalFanart();
- if (!strLocal.IsEmpty())
+ if (!strLocal.empty())
{
CFileItemPtr itemLocal(new CFileItem("fanart://Local",false));
itemLocal->SetArt("thumb", strLocal);
result.clear();
// set the fanart image
- if (flip && !result.IsEmpty())
+ if (flip && !result.empty())
result = CTextureUtils::GetWrappedImageURL(result, "", "flipped");
CVideoDatabase db;
if (db.Open())
void CGUIDialogVideoInfo::SetLabel(int iControl, const CStdString &strLabel)
{
- if (strLabel.IsEmpty())
+ if (strLabel.empty())
{
SET_CONTROL_LABEL(iControl, 416); // "Not available"
}
CStdString itemDir = item.GetVideoInfoTag()->m_basePath;
//season
- if (itemDir.IsEmpty())
+ if (itemDir.empty())
itemDir = item.GetVideoInfoTag()->GetPath();
CFileItem itemTmp(itemDir, false);
if (itemTmp.IsVideo())
itemDir = URIUtils::GetParentPath(itemDir);
- if (!itemDir.IsEmpty() && CDirectory::Exists(itemDir))
+ if (!itemDir.empty() && CDirectory::Exists(itemDir))
{
CMediaSource itemSource;
itemSource.strName = g_localizeStrings.Get(36041);
database.GetTvShowInfo(pItem->GetVideoInfoTag()->m_strFileNameAndPath, detail, iDbId);
CStdString currentTitle;
- if (detail.m_strSortTitle.IsEmpty())
+ if (detail.m_strSortTitle.empty())
currentTitle = detail.m_strTitle;
else
currentTitle = detail.m_strSortTitle;
}
CStdString resumeString = GetResumeString(*item);
- if (!resumeString.IsEmpty())
+ if (!resumeString.empty())
{
choices.Add(SELECT_ACTION_RESUME, resumeString);
choices.Add(SELECT_ACTION_PLAY, 12021); // Start from beginning
CStdString strDir;
if (item->IsVideoDb() &&
item->HasVideoInfoTag() &&
- !item->GetVideoInfoTag()->m_strPath.IsEmpty())
+ !item->GetVideoInfoTag()->m_strPath.empty())
{
strDir = item->GetVideoInfoTag()->m_strPath;
}
if (!item.m_bIsFolder && !item.IsLiveTV())
{
CStdString resumeString = GetResumeString(item);
- if (!resumeString.IsEmpty())
+ if (!resumeString.empty())
{ // prompt user whether they wish to resume
CContextButtons choices;
choices.Add(1, resumeString);
CStdString resumeString = GetResumeString(*item);
- if (!resumeString.IsEmpty())
+ if (!resumeString.empty())
{
CContextButtons choices;
choices.Add(SELECT_ACTION_RESUME, resumeString);
buttons.Add(CONTEXT_BUTTON_PLAY_PART, 20324);
}
- if (!m_vecItems->GetPath().IsEmpty() && !StringUtils::StartsWithNoCase(item->GetPath(), "newsmartplaylist://") && !StringUtils::StartsWithNoCase(item->GetPath(), "newtag://")
+ if (!m_vecItems->GetPath().empty() && !StringUtils::StartsWithNoCase(item->GetPath(), "newsmartplaylist://") && !StringUtils::StartsWithNoCase(item->GetPath(), "newtag://")
&& !m_vecItems->IsSourcesPath())
{
buttons.Add(CONTEXT_BUTTON_QUEUE_ITEM, 13347); // Add to Playlist
{
CStdString resumeString = CGUIWindowVideoBase::GetResumeString(*(parts[selectedFile - 1].get()));
stack->m_lStartOffset = 0;
- if (!resumeString.IsEmpty())
+ if (!resumeString.empty())
{
CContextButtons choices;
choices.Add(SELECT_ACTION_RESUME, resumeString);
{
case CONTEXT_BUTTON_SET_CONTENT:
{
- OnAssignContent(item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strPath.IsEmpty() ? item->GetVideoInfoTag()->m_strPath : item->GetPath());
+ OnAssignContent(item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strPath.empty() ? item->GetVideoInfoTag()->m_strPath : item->GetPath());
return true;
}
case CONTEXT_BUTTON_PLAY_PART:
SScanSettings settings;
GetScraperForItem(item.get(), info, settings);
CStdString strPath = item->GetPath();
- if (item->IsVideoDb() && (!item->m_bIsFolder || item->GetVideoInfoTag()->m_strPath.IsEmpty()))
+ if (item->IsVideoDb() && (!item->m_bIsFolder || item->GetVideoInfoTag()->m_strPath.empty()))
return false;
if (item->IsVideoDb())
/* For recordings we check here for a available stream URL */
CFileItemPtr tag = g_PVRRecordings->GetByPath(item.GetPath());
- if (tag && tag->HasPVRRecordingInfoTag() && !tag->GetPVRRecordingInfoTag()->m_strStreamURL.IsEmpty())
+ if (tag && tag->HasPVRRecordingInfoTag() && !tag->GetPVRRecordingInfoTag()->m_strStreamURL.empty())
{
CStdString stream = tag->GetPVRRecordingInfoTag()->m_strStreamURL;
return;
// enter new genre string
- if (strGenre.IsEmpty())
+ if (strGenre.empty())
{
strGenre = g_localizeStrings.Get(532); // Manual Addition
if (!CGUIKeyboardFactory::ShowAndGetInput(strGenre, g_localizeStrings.Get(533), false)) // Enter Genre
return; // user backed out
- if (strGenre.IsEmpty())
+ if (strGenre.empty())
return; // no genre string
}
}
bool foundDirectly = false;
- info = m_database.GetScraperForPath(item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strPath.IsEmpty() ? item->GetVideoInfoTag()->m_strPath : item->GetPath(), settings, foundDirectly);
+ info = m_database.GetScraperForPath(item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strPath.empty() ? item->GetVideoInfoTag()->m_strPath : item->GetPath(), settings, foundDirectly);
return foundDirectly ? 1 : 0;
}
else if (!items.IsVirtualDirectoryRoot())
{ // load info from the database
CStdString label;
- if (items.GetLabel().IsEmpty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::Get().GetSources("video"), &label))
+ if (items.GetLabel().empty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::Get().GetSources("video"), &label))
items.SetLabel(label);
if (!items.IsSourcesPath())
LoadVideoInfo(items);
{
// TODO: this could possibly be threaded as per the music info loading,
// we could also cache the info
- if (!items.GetContent().IsEmpty() && !items.IsPlugin())
+ if (!items.GetContent().empty() && !items.IsPlugin())
return; // don't load for listings that have content set and weren't created from plugins
CStdString content = items.GetContent();
// determine content only if it isn't set
- if (content.IsEmpty())
+ if (content.empty())
{
content = database.GetContentForPath(items.GetPath());
- items.SetContent(content.IsEmpty() ? "files" : content);
+ items.SetContent(content.empty() ? "files" : content);
}
/*
/* NOTE: In the future when GetItemsForPath returns all items regardless of whether they're "in the library"
we won't need the fetchedPlayCounts code, and can "simply" do this directly on absense of content. */
bool fetchedPlayCounts = false;
- if (!content.IsEmpty())
+ if (!content.empty())
{
database.GetItemsForPath(content, items.GetPath(), dbItems);
dbItems.SetFastLookup(true);
{
CFileItemPtr pItem = items[i];
CFileItemPtr match;
- if (!content.IsEmpty()) /* optical media will be stacked down, so it's path won't match the base path */
+ if (!content.empty()) /* optical media will be stacked down, so it's path won't match the base path */
match = dbItems.Get(pItem->IsOpticalMediaFile() ? pItem->GetLocalMetadataPath() : pItem->GetPath());
if (match)
{
return false;
VIDEODB_CONTENT_TYPE iType=VIDEODB_CONTENT_MOVIES;
- if (pItem->HasVideoInfoTag() && !pItem->GetVideoInfoTag()->m_strShowTitle.IsEmpty())
+ if (pItem->HasVideoInfoTag() && !pItem->GetVideoInfoTag()->m_strShowTitle.empty())
iType = VIDEODB_CONTENT_TVSHOWS;
if (pItem->HasVideoInfoTag() && pItem->GetVideoInfoTag()->m_iSeason > -1 && !pItem->m_bIsFolder)
iType = VIDEODB_CONTENT_EPISODES;
database.Open();
database.GetFilePathById(pItem->GetVideoInfoTag()->m_iDbId, path, iType);
- if (path.IsEmpty())
+ if (path.empty())
return false;
if (iType == VIDEODB_CONTENT_MOVIES)
database.DeleteMovie(path);
else if ((artType == "poster" || artType == "banner") && currentArt.find("thumb") != currentArt.end())
currentThumb = currentArt["thumb"];
}
- if (!currentThumb.IsEmpty())
+ if (!currentThumb.empty())
{
CFileItemPtr item(new CFileItem("thumb://Current", false));
item->SetArt("thumb", currentThumb);
if (result.Equals("fanart://None") || !CFile::Exists(result))
result.clear();
- if (!result.IsEmpty() && flip)
+ if (!result.empty() && flip)
result = CTextureUtils::GetWrappedImageURL(result, "", "flipped");
// update the db
void CGUIViewControl::SetSelectedItem(const CStdString &itemPath)
{
- if (!m_fileItems || itemPath.IsEmpty())
+ if (!m_fileItems || itemPath.empty())
return;
CStdString comparePath(itemPath);
CMediaSource source;
source.strPath = "addons://sources/" + content + "/";
source.strName = label;
- if (!thumb.IsEmpty() && g_TextureManager.HasTexture(thumb))
+ if (!thumb.empty() && g_TextureManager.HasTexture(thumb))
source.m_strThumbnailImage = thumb;
source.m_iDriveType = CMediaSource::SOURCE_TYPE_LOCAL;
source.m_ignore = true;
CMediaSource source;
source.strPath = "androidapp://sources/" + content + "/";
source.strName = label;
- if (!thumb.IsEmpty() && g_TextureManager.HasTexture(thumb))
+ if (!thumb.empty() && g_TextureManager.HasTexture(thumb))
source.m_strThumbnailImage = thumb;
source.m_iDriveType = CMediaSource::SOURCE_TYPE_LOCAL;
source.m_ignore = true;
CStdString path1(path);
URIUtils::AddSlashAtEnd(path1);
- if (path1.IsEmpty()) path1 = "root://";
+ if (path1.empty()) path1 = "root://";
CStdString sql;
- if (skin.IsEmpty())
+ if (skin.empty())
sql = PrepareSQL("select * from view where window = %i and path='%s'", window, path1.c_str());
else
sql = PrepareSQL("select * from view where window = %i and path='%s' and skin='%s'", window, path1.c_str(), skin.c_str());
CStdString path1(path);
URIUtils::AddSlashAtEnd(path1);
- if (path1.IsEmpty()) path1 = "root://";
+ if (path1.empty()) path1 = "root://";
CStdString sql = PrepareSQL("select idView from view where window = %i and path='%s' and skin='%s'", window, path1.c_str(), skin.c_str());
m_pDS->query(sql.c_str());
CStdString strWorkingDir;
strCommand.Trim();
- if (strCommand.IsEmpty())
+ if (strCommand.empty())
{
return false;
}
CStdString strEnv;
CStdStringArray vecEnv;
strEnv = CEnvironment::getenv("PATH");
- if (strEnv.IsEmpty())
+ if (strEnv.empty())
CLog::Log(LOGWARNING, "Can get system env PATH or PATH is empty");
StringUtils::SplitString(DLL_ENV_PATH, ";", vecEnv);
share.strName = StringUtils::Format( "%s (%s)", share.strPath.c_str(), g_localizeStrings.Get(218).c_str());
break;
case DRIVE_REMOVABLE:
- if(share.strName.IsEmpty())
+ if(share.strName.empty())
share.strName = StringUtils::Format( "%s (%s)", g_localizeStrings.Get(437).c_str(), share.strPath.c_str());
break;
case DRIVE_UNKNOWN:
CStdString dir = message.GetStringParam(0);
const CStdString &ret = message.GetStringParam(1);
bool returning = ret.CompareNoCase("return") == 0;
- if (!dir.IsEmpty())
+ if (!dir.empty())
{
m_history.ClearPathHistory();
// ensure our directory is valid
// see if we can load a previously cached folder
CFileItemList cachedItems(strDirectory);
- if (!strDirectory.IsEmpty() && cachedItems.Load(GetID()))
+ if (!strDirectory.empty() && cachedItems.Load(GetID()))
{
items.Assign(cachedItems);
}
{
unsigned int time = XbmcThreads::SystemClockMillis();
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
SetupShares();
if (!m_rootDir.GetDirectory(strDirectory, items))
m_history.RemoveParentPath();
}
- if (m_guiState.get() && !m_guiState->HideParentDirItems() && !items.GetPath().IsEmpty())
+ if (m_guiState.get() && !m_guiState->HideParentDirItems() && !items.GetPath().empty())
{
CFileItemPtr pItem(new CFileItem(".."));
pItem->SetPath(strParentPath);
return false;
}
- if (items.GetLabel().IsEmpty())
+ if (items.GetLabel().empty())
items.SetLabel(CUtil::GetTitleFromPath(items.GetPath(), true));
ClearFileItems();
// if we're getting the root source listing
// make sure the path history is clean
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
m_history.ClearPathHistory();
int iWindow = GetID();
int showLabel = 0;
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
{
if (iWindow == WINDOW_PICTURES)
showLabel = 997;
{
const CStdString& strLockType=m_guiState->GetLockType();
if (CProfilesManager::Get().GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE)
- if (!strLockType.IsEmpty() && !g_passwordManager.IsItemUnlocked(pItem.get(), strLockType))
+ if (!strLockType.empty() && !g_passwordManager.IsItemUnlocked(pItem.get(), strLockType))
return true;
if (!HaveDiscOrConnection(pItem->GetPath(), pItem->m_iDriveType))
CURL url(pItem->GetPath());
const CStdString& strHostName = url.GetHostName();
- if (url.GetProtocol() == "smb" && strHostName.IsEmpty()) // smb workgroup
+ if (url.GetProtocol() == "smb" && strHostName.empty()) // smb workgroup
idMessageText = 15303; // Workgroup not found
else if (pItem->m_iDriveType == CMediaSource::SOURCE_TYPE_REMOTE || URIUtils::IsRemote(pItem->GetPath()))
idMessageText = 15301; // Could not connect to network server
// in case the path history is messed up and the current folder is on
// the stack more than once, keep going until there's nothing left or they
// dont match anymore.
- while (!strParent.IsEmpty())
+ while (!strParent.empty())
{
URIUtils::AddSlashAtEnd(strParent);
if (strParent.Equals(strPath))
{
// Make sure our shares are configured
SetupShares();
- if (!strDirectory.IsEmpty())
+ if (!strDirectory.empty())
{
// Build the directory history for default path
CStdString strPath, strParentPath;
CStdString trimmedFilter(filter);
trimmedFilter.TrimLeft().ToLower();
- if (trimmedFilter.IsEmpty())
+ if (trimmedFilter.empty())
return result;
CFileItemList filteredItems(items.GetPath()); // use the original path - it'll likely be relied on for other things later.
// render the skin debug info
if (g_SkinInfo->IsDebugging())
{
- if (!info.IsEmpty())
+ if (!info.empty())
info += "\n";
CGUIWindow *window = g_windowManager.GetWindow(g_windowManager.GetFocusedWindow());
CGUIWindow *pointer = g_windowManager.GetWindow(WINDOW_DIALOG_POINTER);
if (window)
{
CStdString windowName = CButtonTranslator::TranslateWindow(window->GetID());
- if (!windowName.IsEmpty())
+ if (!windowName.empty())
windowName += " (" + CStdString(window->GetProperty("xmlfile").asString()) + ")";
else
windowName = window->GetProperty("xmlfile").asString();
{
// update our current directory labels
CStdString strDir = CURL(m_Directory[0]->GetPath()).GetWithoutUserDetails();
- if (strDir.IsEmpty())
+ if (strDir.empty())
{
SET_CONTROL_LABEL(CONTROL_CURRENTDIRLABEL_LEFT,g_localizeStrings.Get(20108));
}
SET_CONTROL_LABEL(CONTROL_CURRENTDIRLABEL_LEFT, strDir);
}
strDir = CURL(m_Directory[1]->GetPath()).GetWithoutUserDetails();
- if (strDir.IsEmpty())
+ if (strDir.empty())
{
SET_CONTROL_LABEL(CONTROL_CURRENTDIRLABEL_RIGHT,g_localizeStrings.Get(20108));
}
CStdString strParentPath;
URIUtils::GetParentPath(strDirectory, strParentPath);
- if (strDirectory.IsEmpty() && (m_vecItems[iList]->Size() == 0 || CSettings::Get().GetBool("filelists.showaddsourcebuttons")))
+ if (strDirectory.empty() && (m_vecItems[iList]->Size() == 0 || CSettings::Get().GetBool("filelists.showaddsourcebuttons")))
{ // add 'add source button'
CStdString strLabel = g_localizeStrings.Get(1026);
CFileItemPtr pItem(new CFileItem(strLabel));
m_strParentPath[iList] = (m_rootDir.IsSource(strDirectory) ? "" : strParentPath);
- if (strDirectory.IsEmpty())
+ if (strDirectory.empty())
{
CFileItemPtr pItem(new CFileItem("special://profile/", true));
pItem->SetLabel(g_localizeStrings.Get(20070));
if ((url.GetProtocol() == "rar") || (url.GetProtocol() == "zip"))
{
// check for step-below, if, unmount rar
- if (url.GetFileName().IsEmpty())
+ if (url.GetFileName().empty())
if (url.GetProtocol() == "zip")
g_ZipManager.release(m_Directory[iList]->GetPath()); // release resources
}
CURL url(pItem->GetPath());
const CStdString& strHostName = url.GetHostName();
- if (url.GetProtocol() == "smb" && strHostName.IsEmpty()) // smb workgroup
+ if (url.GetProtocol() == "smb" && strHostName.empty()) // smb workgroup
idMessageText = 15303; // Workgroup not found
else if (pItem->m_iDriveType == CMediaSource::SOURCE_TYPE_REMOTE || URIUtils::IsRemote(pItem->GetPath()))
idMessageText = 15301; // Could not connect to network server
// check for a passed destination path
CStdString strDestination = path;
m_rootDir.SetSources(*CMediaSourceSettings::Get().GetSources("files"));
- if (!strDestination.IsEmpty())
+ if (!strDestination.empty())
{
CLog::Log(LOGINFO, "Attempting to quickpath to: %s", strDestination.c_str());
}
CLog::Log(LOGINFO, "Attempting to default to: %s", strDestination.c_str());
}
// try to open the destination path
- if (!strDestination.IsEmpty())
+ if (!strDestination.empty())
{
// open root
if (strDestination.Equals("$ROOT"))
const CProfile *profile = CProfilesManager::Get().GetProfile(i);
CFileItemPtr item(new CFileItem(profile->getName()));
CStdString strLabel;
- if (profile->getDate().IsEmpty())
+ if (profile->getDate().empty())
strLabel = g_localizeStrings.Get(20113);
else
strLabel = StringUtils::Format(g_localizeStrings.Get(20112).c_str(), profile->getDate().c_str());
item->SetLabel2(strLabel);
item->SetArt("thumb", profile->getThumb());
- if (profile->getThumb().IsEmpty() || profile->getThumb().Equals("-"))
+ if (profile->getThumb().empty() || profile->getThumb().Equals("-"))
item->SetArt("thumb", "unknown-user.png");
item->SetLabelPreformated(true);
m_vecItems->Add(item);