From 412f9113e9d366c1ebb03ec066102f5d9d2733fb Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 26 Jun 2014 11:19:43 +0200 Subject: [PATCH] [stdstring] get rid of CStdString in video/dialogs/ --- .../GUIDialogAudioSubtitleSettings.cpp | 8 +- xbmc/video/dialogs/GUIDialogFileStacking.cpp | 2 +- xbmc/video/dialogs/GUIDialogSubtitles.cpp | 32 ++--- xbmc/video/dialogs/GUIDialogSubtitles.h | 4 +- .../video/dialogs/GUIDialogVideoBookmarks.cpp | 10 +- xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 109 +++++++++--------- xbmc/video/dialogs/GUIDialogVideoInfo.h | 8 +- 7 files changed, 87 insertions(+), 86 deletions(-) diff --git a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp index 32a9ba4158951..aea90e8948f70 100644 --- a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp +++ b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp @@ -184,7 +184,7 @@ void CGUIDialogAudioSubtitleSettings::OnSettingAction(const CSetting *setting) const std::string &settingId = setting->GetId(); if (settingId == SETTING_SUBTITLE_BROWSER) { - CStdString strPath; + std::string strPath; if (URIUtils::IsInRAR(g_application.CurrentFileItem().GetPath()) || URIUtils::IsInZIP(g_application.CurrentFileItem().GetPath())) strPath = CURL(g_application.CurrentFileItem().GetPath()).GetHostName(); else @@ -414,7 +414,7 @@ void CGUIDialogAudioSubtitleSettings::AudioStreamsOptionFiller(const CSetting *s for (int i = 0; i < audioStreamCount; ++i) { std::string strItem; - CStdString strLanguage; + std::string strLanguage; SPlayerAudioStreamInfo info; g_application.m_pPlayer->GetAudioStreamInfo(i, info); @@ -448,8 +448,8 @@ void CGUIDialogAudioSubtitleSettings::SubtitleStreamsOptionFiller(const CSetting SPlayerSubtitleStreamInfo info; g_application.m_pPlayer->GetSubtitleStreamInfo(i, info); - CStdString strItem; - CStdString strLanguage; + std::string strItem; + std::string strLanguage; if (!g_LangCodeExpander.Lookup(strLanguage, info.language)) strLanguage = g_localizeStrings.Get(13205); // Unknown diff --git a/xbmc/video/dialogs/GUIDialogFileStacking.cpp b/xbmc/video/dialogs/GUIDialogFileStacking.cpp index dfa9e3eba888b..0207de581222c 100644 --- a/xbmc/video/dialogs/GUIDialogFileStacking.cpp +++ b/xbmc/video/dialogs/GUIDialogFileStacking.cpp @@ -94,7 +94,7 @@ void CGUIDialogFileStacking::OnInitWindow() SendMessage(GUI_MSG_LABEL_RESET, GetID(), STACK_LIST); for (int i = 0; i < m_iNumberOfFiles; i++) { - CStdString label = StringUtils::Format(g_localizeStrings.Get(23051).c_str(), i+1); + std::string label = StringUtils::Format(g_localizeStrings.Get(23051).c_str(), i+1); CFileItemPtr item(new CFileItem(label)); m_stackItems->Add(item); } diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.cpp b/xbmc/video/dialogs/GUIDialogSubtitles.cpp index e3939f1dd427e..e49d9916e03c9 100644 --- a/xbmc/video/dialogs/GUIDialogSubtitles.cpp +++ b/xbmc/video/dialogs/GUIDialogSubtitles.cpp @@ -339,7 +339,7 @@ void CGUIDialogSubtitles::Search(const std::string &search/*=""*/) if(StringUtils::EqualsNoCase(preferredLanguage, "original")) { SPlayerAudioStreamInfo info; - CStdString strLanguage; + std::string strLanguage; int currentAudio = g_application.m_pPlayer->GetAudioStream(); g_application.m_pPlayer->GetAudioStreamInfo(currentAudio, info); @@ -446,13 +446,13 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s SUBTITLE_STORAGEMODE storageMode = (SUBTITLE_STORAGEMODE) CSettings::Get().GetInt("subtitles.storagemode"); // Get (unstacked) path - CStdString strCurrentFile = g_application.CurrentUnstackedItem().GetPath(); + std::string strCurrentFile = g_application.CurrentUnstackedItem().GetPath(); - CStdString strDownloadPath = "special://temp"; - CStdString strDestPath; + std::string strDownloadPath = "special://temp"; + std::string strDestPath; std::vector vecFiles; - CStdString strCurrentFilePath; + std::string strCurrentFilePath; if (StringUtils::StartsWith(strCurrentFilePath, "http://")) { strCurrentFile = "TempSubtitle"; @@ -460,7 +460,7 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s } else { - CStdString subPath = CSpecialProtocol::TranslatePath("special://subtitles"); + std::string subPath = CSpecialProtocol::TranslatePath("special://subtitles"); if (!subPath.empty()) strDownloadPath = subPath; @@ -501,23 +501,23 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s strDestPath = strDownloadPath; // Extract the language and appropriate extension - CStdString strSubLang; + std::string strSubLang; g_LangCodeExpander.ConvertToTwoCharCode(strSubLang, language); // Iterate over all items to transfer for (unsigned int i = 0; i < vecFiles.size() && i < (unsigned int) items->Size(); i++) { - CStdString strUrl = items->Get(i)->GetPath(); - CStdString strFileName = URIUtils::GetFileName(vecFiles[i]); + std::string strUrl = items->Get(i)->GetPath(); + std::string strFileName = URIUtils::GetFileName(vecFiles[i]); URIUtils::RemoveExtension(strFileName); // construct subtitle path - CStdString strSubExt = URIUtils::GetExtension(strUrl); - CStdString strSubName = StringUtils::Format("%s.%s%s", strFileName.c_str(), strSubLang.c_str(), strSubExt.c_str()); + std::string strSubExt = URIUtils::GetExtension(strUrl); + std::string strSubName = StringUtils::Format("%s.%s%s", strFileName.c_str(), strSubLang.c_str(), strSubExt.c_str()); // Handle URL encoding: - CStdString strDownloadFile = URIUtils::ChangeBasePath(strCurrentFilePath, strSubName, strDownloadPath); - CStdString strDestFile = strDownloadFile; + std::string strDownloadFile = URIUtils::ChangeBasePath(strCurrentFilePath, strSubName, strDownloadPath); + std::string strDestFile = strDownloadFile; if (!CFile::Copy(strUrl, strDownloadFile)) { @@ -529,7 +529,7 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s if (strDestPath != strDownloadPath) { // Handle URL encoding: - CStdString strTryDestFile = URIUtils::ChangeBasePath(strCurrentFilePath, strSubName, strDestPath); + std::string strTryDestFile = URIUtils::ChangeBasePath(strCurrentFilePath, strSubName, strDestPath); /* Copy the file from temp to our final destination, if that fails fallback to download path * (ie. special://subtitles or use special://temp). Note that after the first item strDownloadPath equals strDestpath @@ -555,12 +555,12 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s } // for ".sub" subtitles we check if ".idx" counterpart exists and copy that as well - if (strSubExt.Equals(".sub")) + if (StringUtils::EqualsNoCase(strSubExt, ".sub")) { strUrl = URIUtils::ReplaceExtension(strUrl, ".idx"); if(CFile::Exists(strUrl)) { - CStdString strSubNameIdx = StringUtils::Format("%s.%s.idx", strFileName.c_str(), strSubLang.c_str()); + std::string strSubNameIdx = StringUtils::Format("%s.%s.idx", strFileName.c_str(), strSubLang.c_str()); // Handle URL encoding: strDestFile = URIUtils::ChangeBasePath(strCurrentFilePath, strSubNameIdx, strDestPath); CFile::Copy(strUrl, strDestFile); diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.h b/xbmc/video/dialogs/GUIDialogSubtitles.h index dea4a6608163d..da81a3a13829e 100644 --- a/xbmc/video/dialogs/GUIDialogSubtitles.h +++ b/xbmc/video/dialogs/GUIDialogSubtitles.h @@ -68,8 +68,8 @@ class CGUIDialogSubtitles : public CGUIDialog, CJobQueue CFileItemList* m_serviceItems; std::string m_currentService; std::string m_status; - CStdString m_strManualSearch; + std::string m_strManualSearch; bool m_pausedOnRun; bool m_updateSubsList; ///< true if we need to update our subs list - CStdString m_LastAutoDownloaded; ///< Last video file path which automatically downloaded subtitle + std::string m_LastAutoDownloaded; ///< Last video file path which automatically downloaded subtitle }; diff --git a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp index 1ccabc806e4ee..c77955c737261 100644 --- a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp @@ -202,7 +202,7 @@ void CGUIDialogVideoBookmarks::OnRefreshList() CBookmark resumemark; // open the d/b and retrieve the bookmarks for the current movie - CStdString path = g_application.CurrentFile(); + std::string path = g_application.CurrentFile(); if (g_application.CurrentFileItem().HasProperty("original_listitem_url") && !URIUtils::IsVideoDb(g_application.CurrentFileItem().GetProperty("original_listitem_url").asString())) path = g_application.CurrentFileItem().GetProperty("original_listitem_url").asString(); @@ -222,7 +222,7 @@ void CGUIDialogVideoBookmarks::OnRefreshList() if (m_bookmarks[i].type == CBookmark::RESUME) m_bookmarks[i].thumbNailImage = "bookmark-resume.png"; - CStdString bookmarkTime; + std::string bookmarkTime; if (m_bookmarks[i].type == CBookmark::EPISODE) bookmarkTime = StringUtils::Format("%s %li %s %li", g_localizeStrings.Get(20373).c_str(), m_bookmarks[i].seasonNumber, g_localizeStrings.Get(20359).c_str(), m_bookmarks[i].episodeNumber); else @@ -293,7 +293,7 @@ void CGUIDialogVideoBookmarks::ClearBookmarks() { CVideoDatabase videoDatabase; videoDatabase.Open(); - CStdString path = g_application.CurrentFile(); + std::string path = g_application.CurrentFile(); if (g_application.CurrentFileItem().HasProperty("original_listitem_url") && !URIUtils::IsVideoDb(g_application.CurrentFileItem().GetProperty("original_listitem_url").asString())) path = g_application.CurrentFileItem().GetProperty("original_listitem_url").asString(); @@ -361,7 +361,7 @@ bool CGUIDialogVideoBookmarks::AddBookmark(CVideoInfoTag* tag) videoDatabase.AddBookMarkForEpisode(*tag, bookmark); else { - CStdString path = g_application.CurrentFile(); + std::string path = g_application.CurrentFile(); if (g_application.CurrentFileItem().HasProperty("original_listitem_url") && !URIUtils::IsVideoDb(g_application.CurrentFileItem().GetProperty("original_listitem_url").asString())) path = g_application.CurrentFileItem().GetProperty("original_listitem_url").asString(); @@ -404,7 +404,7 @@ bool CGUIDialogVideoBookmarks::AddEpisodeBookmark() CContextButtons choices; for (unsigned int i=0; i < episodes.size(); ++i) { - CStdString strButton = StringUtils::Format("%s %i, %s %i", + std::string strButton = StringUtils::Format("%s %i, %s %i", g_localizeStrings.Get(20373).c_str(), episodes[i].m_iSeason, g_localizeStrings.Get(20359).c_str(), episodes[i].m_iEpisode); choices.Add(i, strButton); diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp index 5050eccda7e9a..3923b6ca964f2 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp @@ -163,7 +163,7 @@ bool CGUIDialogVideoInfo::OnMessage(CGUIMessage& message) } else if (iControl == CONTROL_BTN_DIRECTOR) { - CStdString strDirector = StringUtils::Join(m_movieItem->GetVideoInfoTag()->m_director, g_advancedSettings.m_videoItemSeparator); + std::string strDirector = StringUtils::Join(m_movieItem->GetVideoInfoTag()->m_director, g_advancedSettings.m_videoItemSeparator); OnSearch(strDirector); } else if (iControl == CONTROL_LIST) @@ -176,12 +176,12 @@ bool CGUIDialogVideoInfo::OnMessage(CGUIMessage& message) int iItem = msg.GetParam1(); if (iItem < 0 || iItem >= m_castList->Size()) break; - CStdString strItem = m_castList->Get(iItem)->GetLabel(); - CStdString strFind = StringUtils::Format(" %s ",g_localizeStrings.Get(20347).c_str()); + std::string strItem = m_castList->Get(iItem)->GetLabel(); + std::string strFind = StringUtils::Format(" %s ",g_localizeStrings.Get(20347).c_str()); size_t iPos = strItem.find(strFind); if (iPos == std::string::npos) iPos = strItem.size(); - CStdString tmp = strItem.substr(0, iPos); + std::string tmp = strItem.substr(0, iPos); OnSearch(tmp); } } @@ -263,7 +263,7 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item) for (std::vector::const_iterator it = artists.begin(); it != artists.end(); ++it) { int idArtist = database.GetArtistByName(*it); - CStdString thumb = database.GetArtForItem(idArtist, MediaTypeArtist, "thumb"); + std::string thumb = database.GetArtForItem(idArtist, MediaTypeArtist, "thumb"); CFileItemPtr item(new CFileItem(*it)); if (!thumb.empty()) item->SetArt("thumb", thumb); @@ -276,7 +276,7 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item) { // movie/show/episode for (CVideoInfoTag::iCast it = m_movieItem->GetVideoInfoTag()->m_cast.begin(); it != m_movieItem->GetVideoInfoTag()->m_cast.end(); ++it) { - CStdString character; + std::string character; if (it->strRole.empty()) character = it->strName; else @@ -286,7 +286,7 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item) item->SetArt("thumb", it->thumb); else if (CSettings::Get().GetBool("videolibrary.actorthumbs")) { // backward compatibility - CStdString thumb = CScraperUrl::GetThumbURL(it->thumbUrl.GetFirstThumb()); + std::string thumb = CScraperUrl::GetThumbURL(it->thumbUrl.GetFirstThumb()); if (!thumb.empty()) { item->SetArt("thumb", thumb); @@ -351,7 +351,7 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item) if (m_movieItem->GetVideoInfoTag()->m_strTrailer.empty() || URIUtils::IsInternetStream(m_movieItem->GetVideoInfoTag()->m_strTrailer)) { - CStdString localTrailer = m_movieItem->FindTrailer(); + std::string localTrailer = m_movieItem->FindTrailer(); if (!localTrailer.empty()) { m_movieItem->GetVideoInfoTag()->m_strTrailer = localTrailer; @@ -375,7 +375,7 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item) void CGUIDialogVideoInfo::Update() { // setup plot text area - CStdString strTmp = m_movieItem->GetVideoInfoTag()->m_strPlot; + std::string strTmp = m_movieItem->GetVideoInfoTag()->m_strPlot; 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); @@ -447,7 +447,7 @@ bool CGUIDialogVideoInfo::RefreshAll() const } /// \brief Search the current directory for a string got from the virtual keyboard -void CGUIDialogVideoInfo::OnSearch(CStdString& strSearch) +void CGUIDialogVideoInfo::OnSearch(std::string& strSearch) { CGUIDialogProgress *progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); if (progress) @@ -498,7 +498,7 @@ void CGUIDialogVideoInfo::OnSearch(CStdString& strSearch) /// \brief Make the actual search for the OnSearch function. /// \param strSearch The search string /// \param items Items Found -void CGUIDialogVideoInfo::DoSearch(CStdString& strSearch, CFileItemList& items) +void CGUIDialogVideoInfo::DoSearch(std::string& strSearch, CFileItemList& items) { CVideoDatabase db; if (!db.Open()) @@ -508,7 +508,7 @@ void CGUIDialogVideoInfo::DoSearch(CStdString& strSearch, CFileItemList& items) db.GetMoviesByActor(strSearch, movies); for (int i = 0; i < movies.Size(); ++i) { - CStdString label = movies[i]->GetVideoInfoTag()->m_strTitle; + std::string label = movies[i]->GetVideoInfoTag()->m_strTitle; if (movies[i]->GetVideoInfoTag()->m_iYear > 0) label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->m_iYear); movies[i]->SetLabel(label); @@ -518,7 +518,7 @@ void CGUIDialogVideoInfo::DoSearch(CStdString& strSearch, CFileItemList& items) db.GetTvShowsByActor(strSearch, movies); for (int i = 0; i < movies.Size(); ++i) { - CStdString label = movies[i]->GetVideoInfoTag()->m_strShowTitle; + std::string label = movies[i]->GetVideoInfoTag()->m_strShowTitle; if (movies[i]->GetVideoInfoTag()->m_iYear > 0) label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->m_iYear); movies[i]->SetLabel(label); @@ -528,7 +528,7 @@ void CGUIDialogVideoInfo::DoSearch(CStdString& strSearch, CFileItemList& items) db.GetEpisodesByActor(strSearch, movies); for (int i = 0; i < movies.Size(); ++i) { - CStdString label = movies[i]->GetVideoInfoTag()->m_strTitle + " (" + movies[i]->GetVideoInfoTag()->m_strShowTitle + ")"; + std::string label = movies[i]->GetVideoInfoTag()->m_strTitle + " (" + movies[i]->GetVideoInfoTag()->m_strShowTitle + ")"; movies[i]->SetLabel(label); } CGUIWindowVideoBase::AppendAndClearSearchItems(movies, "[" + g_localizeStrings.Get(20359) + "] ", items); @@ -585,7 +585,7 @@ void CGUIDialogVideoInfo::Play(bool resume) { if (!m_movieItem->GetVideoInfoTag()->m_strEpisodeGuide.empty()) { - CStdString strPath = StringUtils::Format("videodb://tvshows/titles/%i/",m_movieItem->GetVideoInfoTag()->m_iDbId); + std::string strPath = StringUtils::Format("videodb://tvshows/titles/%i/",m_movieItem->GetVideoInfoTag()->m_iDbId); Close(); g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath); return; @@ -662,7 +662,7 @@ string CGUIDialogVideoInfo::ChooseArtType(const CFileItem &videoItem, mapIsButtonPressed()) { // Get the new artwork name - CStdString strArtworkName; + std::string strArtworkName; if (!CGUIKeyboardFactory::ShowAndGetInput(strArtworkName, g_localizeStrings.Get(13516), false)) return ""; @@ -709,7 +709,7 @@ void CGUIDialogVideoInfo::OnGetArt() for (unsigned int i = 0; i < thumbs.size(); ++i) { - CStdString strItemPath = StringUtils::Format("thumb://Remote%i", i); + std::string strItemPath = StringUtils::Format("thumb://Remote%i", i); CFileItemPtr item(new CFileItem(strItemPath, false)); item->SetArt("thumb", thumbs[i]); item->SetIconImage("DefaultPicture.png"); @@ -720,7 +720,7 @@ void CGUIDialogVideoInfo::OnGetArt() items.Add(item); } - CStdString localThumb = CVideoThumbLoader::GetLocalArt(*m_movieItem, type); + std::string localThumb = CVideoThumbLoader::GetLocalArt(*m_movieItem, type); if (!localThumb.empty()) { CFileItemPtr item(new CFileItem("thumb://Local", false)); @@ -738,14 +738,14 @@ void CGUIDialogVideoInfo::OnGetArt() items.Add(item); } - CStdString result; + std::string result; VECSOURCES sources(*CMediaSourceSettings::Get().GetSources("video")); AddItemPathToFileBrowserSources(sources, *m_movieItem); g_mediaManager.GetLocalDrives(sources); if (CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(13511), result) && result != "thumb://Current") // user didn't choose the one they have { - CStdString newThumb; + std::string newThumb; if (StringUtils::StartsWith(result, "thumb://Remote")) { int number = atoi(result.substr(14).c_str()); @@ -804,9 +804,9 @@ void CGUIDialogVideoInfo::OnGetFanart() // Grab the thumbnails from the web for (unsigned int i = 0; i < m_movieItem->GetVideoInfoTag()->m_fanart.GetNumFanarts(); i++) { - CStdString strItemPath = StringUtils::Format("fanart://Remote%i",i); + std::string strItemPath = StringUtils::Format("fanart://Remote%i",i); CFileItemPtr item(new CFileItem(strItemPath, false)); - CStdString thumb = m_movieItem->GetVideoInfoTag()->m_fanart.GetPreviewURL(i); + std::string thumb = m_movieItem->GetVideoInfoTag()->m_fanart.GetPreviewURL(i); item->SetArt("thumb", CTextureUtils::GetWrappedThumbURL(thumb)); item->SetIconImage("DefaultPicture.png"); item->SetLabel(g_localizeStrings.Get(20441)); @@ -817,7 +817,7 @@ void CGUIDialogVideoInfo::OnGetFanart() } CFileItem item(*m_movieItem->GetVideoInfoTag()); - CStdString strLocal = item.GetLocalFanart(); + std::string strLocal = item.GetLocalFanart(); if (!strLocal.empty()) { CFileItemPtr itemLocal(new CFileItem("fanart://Local",false)); @@ -836,15 +836,16 @@ void CGUIDialogVideoInfo::OnGetFanart() items.Add(itemNone); } - CStdString result; + std::string result; VECSOURCES sources(*CMediaSourceSettings::Get().GetSources("video")); AddItemPathToFileBrowserSources(sources, item); g_mediaManager.GetLocalDrives(sources); bool flip=false; - if (!CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(20437), result, &flip, 20445) || result.Equals("fanart://Current")) + if (!CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(20437), result, &flip, 20445) || + StringUtils::CompareNoCase(result, "fanart://Current")) return; // user cancelled - if (result.Equals("fanart://Local")) + if (StringUtils::EqualsNoCase(result, "fanart://Local")) result = strLocal; if (StringUtils::StartsWith(result, "fanart://Remote")) @@ -860,7 +861,7 @@ void CGUIDialogVideoInfo::OnGetFanart() } result = m_movieItem->GetVideoInfoTag()->m_fanart.GetImageURL(); } - else if (result.Equals("fanart://None") || !CFile::Exists(result)) + else if (StringUtils::EqualsNoCase(result, "fanart://None") || !CFile::Exists(result)) result.clear(); // set the fanart image @@ -903,7 +904,7 @@ void CGUIDialogVideoInfo::PlayTrailer() CApplicationMessenger::Get().PlayFile(item); } -void CGUIDialogVideoInfo::SetLabel(int iControl, const CStdString &strLabel) +void CGUIDialogVideoInfo::SetLabel(int iControl, const std::string &strLabel) { if (strLabel.empty()) { @@ -925,7 +926,7 @@ void CGUIDialogVideoInfo::AddItemPathToFileBrowserSources(VECSOURCES &sources, c if (!item.HasVideoInfoTag()) return; - CStdString itemDir = item.GetVideoInfoTag()->m_basePath; + std::string itemDir = item.GetVideoInfoTag()->m_basePath; //season if (itemDir.empty()) @@ -1229,7 +1230,7 @@ bool CGUIDialogVideoInfo::DeleteVideoItemFromDatabase(const CFileItemPtr &item, return false; } - CStdString path; + std::string path; database.GetFilePathById(item->GetVideoInfoTag()->m_iDbId, path, type); if (!path.empty()) { @@ -1257,9 +1258,9 @@ bool CGUIDialogVideoInfo::DeleteVideoItem(const CFileItemPtr &item, bool unavail g_passwordManager.IsMasterLockUnlocked(true)) && CSettings::Get().GetBool("filelists.allowfiledeletion")) { - CStdString strDeletePath = item->GetVideoInfoTag()->GetPath(); + std::string strDeletePath = item->GetVideoInfoTag()->GetPath(); - if (URIUtils::GetFileName(strDeletePath).Equals("VIDEO_TS.IFO")) + if (StringUtils::EqualsNoCase(URIUtils::GetFileName(strDeletePath), "VIDEO_TS.IFO")) { strDeletePath = URIUtils::GetDirectory(strDeletePath); if (StringUtils::EndsWithNoCase(strDeletePath, "video_ts/")) @@ -1338,8 +1339,8 @@ bool CGUIDialogVideoInfo::GetMoviesForSet(const CFileItem *setItem, CFileItemLis if (!videodb.Open()) return false; - CStdString strHeading = g_localizeStrings.Get(20457); - CStdString baseDir = StringUtils::Format("videodb://movies/sets/%d", setItem->GetVideoInfoTag()->m_iDbId); + std::string strHeading = g_localizeStrings.Get(20457); + std::string baseDir = StringUtils::Format("videodb://movies/sets/%d", setItem->GetVideoInfoTag()->m_iDbId); if (!CDirectory::GetDirectory(baseDir, originalMovies) || originalMovies.Size() <= 0) // keep a copy of the original members of the set return false; @@ -1393,13 +1394,13 @@ bool CGUIDialogVideoInfo::GetSetForMovie(const CFileItem *movieItem, CFileItemPt return false; CFileItemList listItems; - CStdString baseDir = "videodb://movies/sets/"; + std::string baseDir = "videodb://movies/sets/"; if (!CDirectory::GetDirectory(baseDir, listItems)) return false; listItems.Sort(SortByLabel, SortOrderAscending, SortAttributeIgnoreArticle); int currentSetId = 0; - CStdString currentSetLabel; + std::string currentSetLabel; if (movieItem->GetVideoInfoTag()->m_iSetId > currentSetId) { @@ -1410,12 +1411,12 @@ bool CGUIDialogVideoInfo::GetSetForMovie(const CFileItem *movieItem, CFileItemPt if (currentSetId > 0) { // add clear item - CStdString strClear = StringUtils::Format(g_localizeStrings.Get(20467).c_str(), currentSetLabel.c_str()); + std::string strClear = StringUtils::Format(g_localizeStrings.Get(20467).c_str(), currentSetLabel.c_str()); CFileItemPtr clearItem(new CFileItem(strClear)); clearItem->GetVideoInfoTag()->m_iDbId = -1; // -1 will be used to clear set listItems.AddFront(clearItem, 0); // add keep current set item - CStdString strKeep = StringUtils::Format(g_localizeStrings.Get(20469).c_str(), currentSetLabel.c_str()); + std::string strKeep = StringUtils::Format(g_localizeStrings.Get(20469).c_str(), currentSetLabel.c_str()); CFileItemPtr keepItem(new CFileItem(strKeep)); keepItem->GetVideoInfoTag()->m_iDbId = currentSetId; listItems.AddFront(keepItem, 1); @@ -1425,7 +1426,7 @@ bool CGUIDialogVideoInfo::GetSetForMovie(const CFileItem *movieItem, CFileItemPt if (dialog == NULL) return false; - CStdString strHeading = g_localizeStrings.Get(20466); + std::string strHeading = g_localizeStrings.Get(20466); dialog->Reset(); dialog->SetHeading(strHeading); dialog->SetItems(&listItems); @@ -1445,7 +1446,7 @@ bool CGUIDialogVideoInfo::GetSetForMovie(const CFileItem *movieItem, CFileItemPt if (dialog->IsButtonPressed()) { // creating new set - CStdString newSetTitle; + std::string newSetTitle; if (!CGUIKeyboardFactory::ShowAndGetInput(newSetTitle, g_localizeStrings.Get(20468), false)) return false; int idSet = videodb.AddSet(newSetTitle); @@ -1483,7 +1484,7 @@ bool CGUIDialogVideoInfo::SetMovieSet(const CFileItem *movieItem, const CFileIte return true; } -bool CGUIDialogVideoInfo::GetItemsForTag(const CStdString &strHeading, const std::string &type, CFileItemList &items, int idTag /* = -1 */, bool showAll /* = true */) +bool CGUIDialogVideoInfo::GetItemsForTag(const std::string &strHeading, const std::string &type, CFileItemList &items, int idTag /* = -1 */, bool showAll /* = true */) { CVideoDatabase videodb; if (!videodb.Open()) @@ -1626,7 +1627,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const CFileItemPtr noneitem(new CFileItem("thumb://None", false)); std::string currentThumb; int idArtist = -1; - CStdString artistPath; + std::string artistPath; string artType = "thumb"; if (type == MediaTypeArtist) { @@ -1683,7 +1684,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const else if (type == MediaTypeVideoCollection) { CFileItemList items; - CStdString baseDir = StringUtils::Format("videodb://movies/sets/%d", item->GetVideoInfoTag()->m_iDbId); + std::string baseDir = StringUtils::Format("videodb://movies/sets/%d", item->GetVideoInfoTag()->m_iDbId); if (videodb.GetMoviesNav(baseDir, items)) { for (int i=0; i < items.Size(); i++) @@ -1714,8 +1715,8 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const if (type == "actor") { - CStdString picturePath; - CStdString strThumb = URIUtils::AddFileToFolder(picturePath, "folder.jpg"); + std::string picturePath; + std::string strThumb = URIUtils::AddFileToFolder(picturePath, "folder.jpg"); if (XFILE::CFile::Exists(strThumb)) { CFileItemPtr pItem(new CFileItem(strThumb,false)); @@ -1733,7 +1734,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const } else { - CStdString strThumb = URIUtils::AddFileToFolder(artistPath, "folder.jpg"); + std::string strThumb = URIUtils::AddFileToFolder(artistPath, "folder.jpg"); if (XFILE::CFile::Exists(strThumb)) { CFileItemPtr pItem(new CFileItem(strThumb, false)); @@ -1749,7 +1750,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const if (!local) items.Add(noneitem); - CStdString result; + std::string result; VECSOURCES sources=*CMediaSourceSettings::Get().GetSources("video"); g_mediaManager.GetLocalDrives(sources); AddItemPathToFileBrowserSources(sources, *item); @@ -1824,7 +1825,7 @@ bool CGUIDialogVideoInfo::UpdateVideoItemSortTitle(const CFileItemPtr &pItem) else if (iType == VIDEODB_CONTENT_TVSHOWS) database.GetTvShowInfo(pItem->GetVideoInfoTag()->m_strFileNameAndPath, detail, iDbId); - CStdString currentTitle; + std::string currentTitle; if (detail.m_strSortTitle.empty()) currentTitle = detail.m_strTitle; else @@ -1921,11 +1922,11 @@ bool CGUIDialogVideoInfo::OnGetFanart(const CFileItemPtr &videoItem) items.Add(itemCurrent); } - vector thumbs; + vector thumbs; if (videoItem->GetVideoInfoTag()->m_type == MediaTypeVideoCollection) { CFileItemList movies; - CStdString baseDir = StringUtils::Format("videodb://movies/sets/%d", videoItem->GetVideoInfoTag()->m_iDbId); + std::string baseDir = StringUtils::Format("videodb://movies/sets/%d", videoItem->GetVideoInfoTag()->m_iDbId); if (videodb.GetMoviesNav(baseDir, movies)) { for (int i=0; i < movies.Size(); i++) @@ -1936,9 +1937,9 @@ bool CGUIDialogVideoInfo::OnGetFanart(const CFileItemPtr &videoItem) // Grab the thumbnails from the web for (unsigned int j = 0; j < movies[i]->GetVideoInfoTag()->m_fanart.GetNumFanarts(); j++) { - CStdString strItemPath = StringUtils::Format("fanart://Remote%i",j); + std::string strItemPath = StringUtils::Format("fanart://Remote%i",j); CFileItemPtr item(new CFileItem(strItemPath, false)); - CStdString thumb = movies[i]->GetVideoInfoTag()->m_fanart.GetPreviewURL(j); + std::string thumb = movies[i]->GetVideoInfoTag()->m_fanart.GetPreviewURL(j); item->SetArt("thumb", CTextureUtils::GetWrappedThumbURL(thumb)); item->SetIconImage("DefaultPicture.png"); item->SetLabel(g_localizeStrings.Get(20441)); @@ -1958,7 +1959,7 @@ bool CGUIDialogVideoInfo::OnGetFanart(const CFileItemPtr &videoItem) items.Add(itemNone); } - CStdString result; + std::string result; VECSOURCES sources(*CMediaSourceSettings::Get().GetSources("video")); g_mediaManager.GetLocalDrives(sources); AddItemPathToFileBrowserSources(sources, item); @@ -1972,7 +1973,7 @@ bool CGUIDialogVideoInfo::OnGetFanart(const CFileItemPtr &videoItem) int iFanart = atoi(result.substr(15).c_str()); result = thumbs[iFanart]; } - else if (result.Equals("fanart://None") || !CFile::Exists(result)) + else if (StringUtils::EqualsNoCase(result, "fanart://None") || !CFile::Exists(result)) result.clear(); if (!result.empty() && flip) result = CTextureUtils::GetWrappedImageURL(result, "", "flipped"); diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.h b/xbmc/video/dialogs/GUIDialogVideoInfo.h index 92d3fdaf92469..3b6c772d1ef87 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.h +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.h @@ -57,7 +57,7 @@ class CGUIDialogVideoInfo : static bool GetSetForMovie(const CFileItem *movieItem, CFileItemPtr &selectedSet); static bool SetMovieSet(const CFileItem *movieItem, const CFileItem *selectedSet); - static bool GetItemsForTag(const CStdString &strHeading, const std::string &type, CFileItemList &items, int idTag = -1, bool showAll = true); + static bool GetItemsForTag(const std::string &strHeading, const std::string &type, CFileItemList &items, int idTag = -1, bool showAll = true); static bool AddItemsToTag(const CFileItemPtr &tagItem); static bool RemoveItemsFromTag(const CFileItemPtr &tagItem); @@ -67,12 +67,12 @@ class CGUIDialogVideoInfo : protected: virtual void OnInitWindow(); void Update(); - void SetLabel(int iControl, const CStdString& strLabel); + void SetLabel(int iControl, const std::string& strLabel); // link cast to movies void ClearCastList(); - void OnSearch(CStdString& strSearch); - void DoSearch(CStdString& strSearch, CFileItemList& items); + void OnSearch(std::string& strSearch); + void DoSearch(std::string& strSearch, CFileItemList& items); void OnSearchItemFound(const CFileItem* pItem); void Play(bool resume = false); void OnGetArt();