Permalink
Browse files

switch CFileItem::m_strPath to private, and add GetPath/SetPath for a…

…ccess
  • Loading branch information...
1 parent fc785d4 commit 6d27f0fc4db267636bf108e9407d55c0e01a867b Jonathan Marshall committed Aug 7, 2011
Showing with 1,311 additions and 1,275 deletions.
  1. +31 −31 xbmc/Application.cpp
  2. +2 −4 xbmc/ApplicationMessenger.cpp
  3. +11 −11 xbmc/Autorun.cpp
  4. +1 −1 xbmc/BackgroundInfoLoader.cpp
  5. +2 −2 xbmc/CueDocument.cpp
  6. +8 −8 xbmc/Favourites.cpp
  7. +41 −43 xbmc/FileItem.cpp
  8. +5 −1 xbmc/FileItem.h
  9. +19 −19 xbmc/GUIInfoManager.cpp
  10. +1 −1 xbmc/GUIViewControl.cpp
  11. +4 −4 xbmc/GUIViewState.cpp
  12. +1 −1 xbmc/PartyModeManager.cpp
  13. +2 −2 xbmc/PlayListPlayer.cpp
  14. +2 −2 xbmc/SortFileItem.cpp
  15. +7 −7 xbmc/ThumbLoader.cpp
  16. +3 −3 xbmc/ThumbnailCache.cpp
  17. +3 −3 xbmc/URL.cpp
  18. +15 −15 xbmc/Util.cpp
  19. +2 −2 xbmc/addons/AddonInstaller.cpp
  20. +1 −1 xbmc/addons/GUIDialogAddonInfo.cpp
  21. +2 −2 xbmc/addons/GUIViewStateAddonBrowser.cpp
  22. +9 −9 xbmc/addons/GUIWindowAddonBrowser.cpp
  23. +1 −1 xbmc/addons/Scraper.cpp
  24. +7 −7 xbmc/cdrip/CDDARipper.cpp
  25. +1 −1 xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
  26. +1 −1 xbmc/cores/dvdplayer/DVDFileInfo.cpp
  27. +1 −1 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamHTSP.cpp
  28. +3 −3 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp
  29. +2 −2 xbmc/cores/dvdplayer/DVDPlayer.cpp
  30. +3 −3 xbmc/cores/paplayer/AudioDecoder.cpp
  31. +4 −4 xbmc/cores/paplayer/PAPlayer.cpp
  32. +3 −3 xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
  33. +2 −2 xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
  34. +6 −6 xbmc/dialogs/GUIDialogContextMenu.cpp
  35. +1 −1 xbmc/dialogs/GUIDialogFavourites.cpp
  36. +40 −40 xbmc/dialogs/GUIDialogFileBrowser.cpp
  37. +1 −1 xbmc/dialogs/GUIDialogFileBrowser.h
  38. +12 −10 xbmc/dialogs/GUIDialogMediaSource.cpp
  39. +3 −3 xbmc/dialogs/GUIDialogPlayEject.cpp
  40. +4 −4 xbmc/filesystem/AddonsDirectory.cpp
  41. +4 −2 xbmc/filesystem/CDDADirectory.cpp
  42. +13 −10 xbmc/filesystem/DAAPDirectory.cpp
  43. +10 −8 xbmc/filesystem/DAVDirectory.cpp
  44. +5 −5 xbmc/filesystem/Directory.cpp
  45. +4 −4 xbmc/filesystem/FTPDirectory.cpp
  46. +2 −2 xbmc/filesystem/FactoryFileDirectory.cpp
  47. +1 −2 xbmc/filesystem/FileSFTP.cpp
  48. +4 −5 xbmc/filesystem/HDDirectory.cpp
  49. +3 −2 xbmc/filesystem/HDHomeRun.cpp
  50. +3 −3 xbmc/filesystem/HTSPDirectory.cpp
  51. +2 −2 xbmc/filesystem/HTSPSession.cpp
  52. +4 −4 xbmc/filesystem/HTTPDirectory.cpp
  53. +4 −5 xbmc/filesystem/ISO9660Directory.cpp
  54. +2 −2 xbmc/filesystem/LastFMDirectory.cpp
  55. +5 −5 xbmc/filesystem/MultiPathDirectory.cpp
  56. +4 −4 xbmc/filesystem/MusicDatabaseDirectory.cpp
  57. +4 −4 xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp
  58. +1 −1 xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeOverview.cpp
  59. +1 −1 xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeTop100.cpp
  60. +2 −1 xbmc/filesystem/MusicFileDirectory.cpp
  61. +1 −1 xbmc/filesystem/MusicSearchDirectory.cpp
  62. +2 −2 xbmc/filesystem/MythSession.cpp
  63. +9 −6 xbmc/filesystem/NFSDirectory.cpp
  64. +3 −3 xbmc/filesystem/PluginDirectory.cpp
  65. +5 −5 xbmc/filesystem/RSSDirectory.cpp
  66. +3 −3 xbmc/filesystem/RTVDirectory.cpp
  67. +1 −1 xbmc/filesystem/RarDirectory.cpp
  68. +4 −6 xbmc/filesystem/RarManager.cpp
  69. +1 −1 xbmc/filesystem/SAPDirectory.cpp
  70. +6 −5 xbmc/filesystem/SMBDirectory.cpp
  71. +1 −1 xbmc/filesystem/SmartPlaylistDirectory.cpp
  72. +7 −7 xbmc/filesystem/SourcesDirectory.cpp
  73. +3 −3 xbmc/filesystem/SpecialProtocolDirectory.cpp
  74. +6 −6 xbmc/filesystem/StackDirectory.cpp
  75. +4 −5 xbmc/filesystem/UDFDirectory.cpp
  76. +5 −5 xbmc/filesystem/UPnPDirectory.cpp
  77. +2 −1 xbmc/filesystem/VTPDirectory.cpp
  78. +4 −4 xbmc/filesystem/VideoDatabaseDirectory.cpp
  79. +2 −2 xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp
  80. +1 −1 xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideosOverview.cpp
  81. +1 −1 xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeSeasons.cpp
  82. +1 −1 xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTvShowsOverview.cpp
  83. +1 −1 xbmc/filesystem/VirtualDirectory.cpp
  84. +2 −2 xbmc/filesystem/ZeroconfDirectory.cpp
  85. +4 −3 xbmc/filesystem/ZipDirectory.cpp
  86. +1 −1 xbmc/guilib/GUIBaseContainer.cpp
  87. +1 −1 xbmc/guilib/GUIMultiImage.cpp
  88. +6 −4 xbmc/guilib/GUIStaticItem.cpp
  89. +1 −1 xbmc/input/ButtonTranslator.cpp
  90. +3 −3 xbmc/interfaces/Builtins.cpp
  91. +42 −42 xbmc/interfaces/http-api/XBMChttp.cpp
  92. +7 −3 xbmc/interfaces/json-rpc/FileItemHandler.cpp
  93. +9 −9 xbmc/interfaces/json-rpc/FileOperations.cpp
  94. +2 −1 xbmc/interfaces/json-rpc/VideoLibrary.cpp
  95. +3 −3 xbmc/interfaces/python/xbmcmodule/listitem.cpp
  96. +2 −2 xbmc/interfaces/python/xbmcmodule/player.cpp
  97. +5 −5 xbmc/interfaces/python/xbmcmodule/pyplaylist.cpp
  98. +2 −2 xbmc/interfaces/python/xbmcmodule/xbmcplugin.cpp
  99. +27 −27 xbmc/music/GUIViewStateMusic.cpp
  100. +2 −2 xbmc/music/LastFmManager.cpp
  101. +7 −6 xbmc/music/MusicDatabase.cpp
  102. +9 −9 xbmc/music/MusicInfoLoader.cpp
  103. +5 −3 xbmc/music/dialogs/GUIDialogSongInfo.cpp
  104. +18 −18 xbmc/music/infoscanner/MusicInfoScanner.cpp
  105. +2 −2 xbmc/music/karaoke/karaokewindowbackground.cpp
  106. +33 −33 xbmc/music/windows/GUIWindowMusicBase.cpp
  107. +48 −46 xbmc/music/windows/GUIWindowMusicNav.cpp
  108. +12 −12 xbmc/music/windows/GUIWindowMusicPlaylist.cpp
  109. +3 −3 xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp
  110. +18 −18 xbmc/music/windows/GUIWindowMusicSongs.cpp
  111. +12 −12 xbmc/network/UPnP.cpp
  112. +2 −2 xbmc/pictures/GUIDialogPictureInfo.cpp
  113. +2 −2 xbmc/pictures/GUIViewStatePictures.cpp
  114. +14 −14 xbmc/pictures/GUIWindowPictures.cpp
  115. +17 −17 xbmc/pictures/GUIWindowSlideShow.cpp
  116. +3 −3 xbmc/pictures/PictureInfoLoader.cpp
  117. +15 −15 xbmc/pictures/PictureThumbLoader.cpp
  118. +8 −8 xbmc/playlists/PlayList.cpp
  119. +2 −2 xbmc/playlists/PlayListB4S.cpp
  120. +2 −2 xbmc/playlists/PlayListFactory.cpp
  121. +1 −1 xbmc/playlists/PlayListM3U.cpp
  122. +6 −6 xbmc/playlists/PlayListPLS.cpp
  123. +2 −2 xbmc/playlists/PlayListWPL.cpp
  124. +2 −2 xbmc/playlists/PlayListXML.cpp
  125. +2 −2 xbmc/programs/GUIViewStatePrograms.cpp
  126. +6 −6 xbmc/programs/GUIWindowPrograms.cpp
  127. +8 −8 xbmc/programs/ProgramDatabase.cpp
  128. +1 −1 xbmc/settings/AppParamParser.cpp
  129. +3 −3 xbmc/settings/GUIDialogContentSettings.cpp
  130. +0 −2 xbmc/settings/GUIWindowSettingsProfile.cpp
  131. +1 −1 xbmc/settings/Settings.cpp
  132. +7 −7 xbmc/utils/FileOperationJob.cpp
  133. +1 −1 xbmc/utils/FileUtils.cpp
  134. +3 −3 xbmc/utils/LabelFormatter.cpp
  135. +2 −2 xbmc/utils/SaveFileStateJob.h
  136. +11 −11 xbmc/utils/TuxBoxUtil.cpp
  137. +5 −5 xbmc/utils/URIUtils.cpp
  138. +28 −28 xbmc/video/GUIViewStateVideo.cpp
  139. +64 −54 xbmc/video/VideoDatabase.cpp
  140. +75 −74 xbmc/video/VideoInfoScanner.cpp
  141. +3 −3 xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp
  142. +7 −7 xbmc/video/dialogs/GUIDialogVideoInfo.cpp
  143. +85 −82 xbmc/video/windows/GUIWindowVideoBase.cpp
  144. +62 −62 xbmc/video/windows/GUIWindowVideoNav.cpp
  145. +7 −7 xbmc/video/windows/GUIWindowVideoPlaylist.cpp
  146. +7 −10 xbmc/win32/WINSMBDirectory.cpp
  147. +76 −73 xbmc/windows/GUIMediaWindow.cpp
  148. +1 −1 xbmc/windows/GUIMediaWindow.h
  149. +66 −65 xbmc/windows/GUIWindowFileManager.cpp
View
62 xbmc/Application.cpp
@@ -527,7 +527,7 @@ bool CApplication::Create()
CFileItemList items;
CUtil::GetRecursiveListing("special://xbmc/userdata",items,"");
for (int i=0;i<items.Size();++i)
- CFile::Cache(items[i]->m_strPath,"special://masterprofile/"+URIUtils::GetFileName(items[i]->m_strPath));
+ CFile::Cache(items[i]->GetPath(),"special://masterprofile/"+URIUtils::GetFileName(items[i]->GetPath()));
}
g_settings.m_logFolder = "special://masterprofile/";
}
@@ -1738,13 +1738,13 @@ bool CApplication::LoadUserWindows()
{
if (items[i]->m_bIsFolder)
continue;
- CStdString skinFile = URIUtils::GetFileName(items[i]->m_strPath);
+ CStdString skinFile = URIUtils::GetFileName(items[i]->GetPath());
if (skinFile.Left(6).CompareNoCase("custom") == 0)
{
TiXmlDocument xmlDoc;
- if (!xmlDoc.LoadFile(items[i]->m_strPath))
+ if (!xmlDoc.LoadFile(items[i]->GetPath()))
{
- CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", items[i]->m_strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc());
+ CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", items[i]->GetPath().c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc());
continue;
}
@@ -2334,7 +2334,7 @@ bool CApplication::OnAction(const CAction &action)
CMusicDatabase db;
if (db.Open()) // OpenForWrite() ?
{
- db.SetSongRating(m_itemCurrentFile->m_strPath, m_itemCurrentFile->GetMusicInfoTag()->GetRating());
+ db.SetSongRating(m_itemCurrentFile->GetPath(), m_itemCurrentFile->GetMusicInfoTag()->GetRating());
db.Close();
}
// send a message to all windows to tell them to update the fileitem (eg playlistplayer, media windows)
@@ -3303,11 +3303,11 @@ bool CApplication::PlayMedia(const CFileItem& item, int iPlaylist)
{
CDirectory dir;
CFileItemList items;
- if (dir.GetDirectory(item.m_strPath, items) && items.Size())
+ if (dir.GetDirectory(item.GetPath(), items) && items.Size())
{
CSmartPlaylist smartpl;
//get name and type of smartplaylist, this will always succeed as GetDirectory also did this.
- smartpl.OpenAndReadName(item.m_strPath);
+ smartpl.OpenAndReadName(item.GetPath());
CPlayList playlist;
playlist.Add(items);
return ProcessAndStartPlaylist(smartpl.GetName(), playlist, (smartpl.GetType() == "songs" || smartpl.GetType() == "albums") ? PLAYLIST_MUSIC:PLAYLIST_VIDEO);
@@ -3319,7 +3319,7 @@ bool CApplication::PlayMedia(const CFileItem& item, int iPlaylist)
//is or could be a playlist
auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(item));
- bool gotPlayList = (pPlayList.get() && pPlayList->Load(item.m_strPath));
+ bool gotPlayList = (pPlayList.get() && pPlayList->Load(item.GetPath()));
if (dlgCache)
{
@@ -3332,10 +3332,10 @@ bool CApplication::PlayMedia(const CFileItem& item, int iPlaylist)
{
if (iPlaylist != PLAYLIST_NONE)
- return ProcessAndStartPlaylist(item.m_strPath, *pPlayList, iPlaylist);
+ return ProcessAndStartPlaylist(item.GetPath(), *pPlayList, iPlaylist);
else
{
- CLog::Log(LOGWARNING, "CApplication::PlayMedia called to play a playlist %s but no idea which playlist to use, playing first item", item.m_strPath.c_str());
+ CLog::Log(LOGWARNING, "CApplication::PlayMedia called to play a playlist %s but no idea which playlist to use, playing first item", item.GetPath().c_str());
if(pPlayList->size())
return PlayFile(*(*pPlayList)[0], false);
}
@@ -3368,15 +3368,15 @@ bool CApplication::PlayStack(const CFileItem& item, bool bRestart)
CVideoDatabase dbs;
if (dbs.Open())
{
- dbs.GetVideoSettings(item.m_strPath, g_settings.m_currentVideoSettings);
- haveTimes = dbs.GetStackTimes(item.m_strPath, times);
+ dbs.GetVideoSettings(item.GetPath(), g_settings.m_currentVideoSettings);
+ haveTimes = dbs.GetStackTimes(item.GetPath(), times);
dbs.Close();
}
// calculate the total time of the stack
CStackDirectory dir;
- dir.GetDirectory(item.m_strPath, *m_currentStack);
+ dir.GetDirectory(item.GetPath(), *m_currentStack);
long totalTime = 0;
for (int i = 0; i < m_currentStack->Size(); i++)
{
@@ -3385,7 +3385,7 @@ bool CApplication::PlayStack(const CFileItem& item, bool bRestart)
else
{
int duration;
- if (!CDVDFileInfo::GetFileDuration((*m_currentStack)[i]->m_strPath, duration))
+ if (!CDVDFileInfo::GetFileDuration((*m_currentStack)[i]->GetPath(), duration))
{
m_currentStack->Clear();
return false;
@@ -3403,13 +3403,13 @@ bool CApplication::PlayStack(const CFileItem& item, bool bRestart)
if (dbs.Open())
{
if( !haveTimes )
- dbs.SetStackTimes(item.m_strPath, times);
+ dbs.SetStackTimes(item.GetPath(), times);
if( item.m_lStartOffset == STARTOFFSET_RESUME )
{
// can only resume seek here, not dvdstate
CBookmark bookmark;
- if( dbs.GetResumeBookMark(item.m_strPath, bookmark) )
+ if( dbs.GetResumeBookMark(item.GetPath(), bookmark) )
seconds = bookmark.timeInSeconds;
else
seconds = 0.0f;
@@ -3478,15 +3478,15 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
if (item.IsPlugin())
{ // we modify the item so that it becomes a real URL
CFileItem item_new(item);
- if (XFILE::CPluginDirectory::GetPluginResult(item.m_strPath, item_new))
+ if (XFILE::CPluginDirectory::GetPluginResult(item.GetPath(), item_new))
return PlayFile(item_new, false);
return false;
}
- if (URIUtils::IsUPnP(item.m_strPath))
+ if (URIUtils::IsUPnP(item.GetPath()))
{
CFileItem item_new(item);
- if (XFILE::CUPnPDirectory::GetResource(item.m_strPath, item_new))
+ if (XFILE::CUPnPDirectory::GetResource(item.GetPath(), item_new))
return PlayFile(item_new, false);
return false;
}
@@ -3500,7 +3500,7 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
//Is TuxBox, this should probably be moved to CFileTuxBox
if(item.IsTuxBox())
{
- CLog::Log(LOGDEBUG, "%s - TuxBox URL Detected %s",__FUNCTION__, item.m_strPath.c_str());
+ CLog::Log(LOGDEBUG, "%s - TuxBox URL Detected %s",__FUNCTION__, item.GetPath().c_str());
if(g_tuxboxService.IsRunning())
g_tuxboxService.Stop();
@@ -3550,13 +3550,13 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
// open the d/b and retrieve the bookmarks for the current movie
CVideoDatabase dbs;
dbs.Open();
- dbs.GetVideoSettings(item.m_strPath, g_settings.m_currentVideoSettings);
+ dbs.GetVideoSettings(item.GetPath(), g_settings.m_currentVideoSettings);
if( item.m_lStartOffset == STARTOFFSET_RESUME )
{
options.starttime = 0.0f;
CBookmark bookmark;
- CStdString path = item.m_strPath;
+ CStdString path = item.GetPath();
if (item.IsDVD())
path = item.GetVideoInfoTag()->m_strFileNameAndPath;
if(dbs.GetResumeBookMark(path, bookmark))
@@ -3656,7 +3656,7 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
}
else
{
- CLog::Log(LOGERROR, "Error creating player for item %s (File doesn't exist?)", item.m_strPath.c_str());
+ CLog::Log(LOGERROR, "Error creating player for item %s (File doesn't exist?)", item.GetPath().c_str());
bResult = false;
}
@@ -3986,7 +3986,7 @@ void CApplication::SaveFileState()
void CApplication::UpdateFileState()
{
// Did the file change?
- if (m_progressTrackingItem->m_strPath != "" && m_progressTrackingItem->m_strPath != CurrentFile())
+ if (m_progressTrackingItem->GetPath() != "" && m_progressTrackingItem->GetPath() != CurrentFile())
{
SaveFileState();
@@ -3997,7 +3997,7 @@ void CApplication::UpdateFileState()
{
if (IsPlayingVideo() || IsPlayingAudio())
{
- if (m_progressTrackingItem->m_strPath == "")
+ if (m_progressTrackingItem->GetPath() == "")
{
// Init some stuff
*m_progressTrackingItem = CurrentFileItem();
@@ -4389,14 +4389,14 @@ bool CApplication::OnMessage(CGUIMessage& message)
{
if (!m_itemCurrentFile->HasMusicInfoTag() || !m_itemCurrentFile->GetMusicInfoTag()->Loaded())
{
- IMusicInfoTagLoader* tagloader = CMusicInfoTagLoaderFactory::CreateLoader(m_itemCurrentFile->m_strPath);
- tagloader->Load(m_itemCurrentFile->m_strPath,*m_itemCurrentFile->GetMusicInfoTag());
+ IMusicInfoTagLoader* tagloader = CMusicInfoTagLoaderFactory::CreateLoader(m_itemCurrentFile->GetPath());
+ tagloader->Load(m_itemCurrentFile->GetPath(),*m_itemCurrentFile->GetMusicInfoTag());
delete tagloader;
}
m_pKaraokeMgr->Start(m_itemCurrentFile->GetMusicInfoTag()->GetURL());
}
else
- m_pKaraokeMgr->Start(m_itemCurrentFile->m_strPath);
+ m_pKaraokeMgr->Start(m_itemCurrentFile->GetPath());
}
#endif
// Let scrobbler know about the track
@@ -4563,7 +4563,7 @@ bool CApplication::ExecuteXBMCAction(std::string actionStr)
#ifdef HAS_PYTHON
if (item.IsPythonScript())
{ // a python script
- g_pythonParser.evalFile(item.m_strPath.c_str(),ADDON::AddonPtr());
+ g_pythonParser.evalFile(item.GetPath().c_str(),ADDON::AddonPtr());
}
else
#endif
@@ -4836,7 +4836,7 @@ void CApplication::Restart(bool bSamePosition)
const CStdString& CApplication::CurrentFile()
{
- return m_itemCurrentFile->m_strPath;
+ return m_itemCurrentFile->GetPath();
}
CFileItem& CApplication::CurrentFileItem()
@@ -5259,7 +5259,7 @@ void CApplication::SaveCurrentFileSettings()
{
CVideoDatabase dbs;
dbs.Open();
- dbs.SetVideoSettings(m_itemCurrentFile->m_strPath, g_settings.m_currentVideoSettings);
+ dbs.SetVideoSettings(m_itemCurrentFile->GetPath(), g_settings.m_currentVideoSettings);
dbs.Close();
}
}
View
6 xbmc/ApplicationMessenger.cpp
@@ -364,7 +364,7 @@ case TMSG_POWERDOWN:
{
pSlideShow->Add(items[i].get());
}
- pSlideShow->Select(items[0]->m_strPath);
+ pSlideShow->Select(items[0]->GetPath());
}
}
else
@@ -798,9 +798,7 @@ void CApplicationMessenger::ExecBuiltIn(const CStdString &command, bool wait)
void CApplicationMessenger::MediaPlay(string filename)
{
- CFileItem item;
- item.m_strPath = filename;
- item.m_bIsFolder = false;
+ CFileItem item(filename, false);
if (item.IsAudio())
item.SetMusicThumb();
else
View
22 xbmc/Autorun.cpp
@@ -172,10 +172,10 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
CFileItemPtr pItem = vecItems[i];
// is the current item a (non system) folder?
- if (pItem->m_bIsFolder && pItem->m_strPath != "." && pItem->m_strPath != "..")
+ if (pItem->m_bIsFolder && pItem->GetPath() != "." && pItem->GetPath() != "..")
{
// Check if the current foldername indicates a DVD structure (name is "VIDEO_TS")
- if (pItem->m_strPath.Find( "VIDEO_TS" ) != -1 && bAllowVideo
+ if (pItem->GetPath().Find( "VIDEO_TS" ) != -1 && bAllowVideo
&& (bypassSettings || g_guiSettings.GetBool("dvds.autorun")))
{
CUtil::PlayDVD("dvd", restart);
@@ -186,7 +186,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
// Check if the current foldername indicates a Blu-Ray structure (default is "BDMV").
// A BR should also include an "AACS" folder for encryption, Sony-BRs can also include update folders for PS3 (PS3_UPDATE / PS3_VPRM).
// ToDo: for the time beeing, the DVD autorun settings are used to determine if the BR should be started automatically.
- if (pItem->m_strPath.Find( "BDMV" ) != -1 && bAllowVideo
+ if (pItem->GetPath().Find( "BDMV" ) != -1 && bAllowVideo
&& (bypassSettings || g_guiSettings.GetBool("dvds.autorun")))
{
CUtil::PlayDVD("bd", restart);
@@ -196,17 +196,17 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
// Video CDs can have multiple file formats. First we need to determine which one is used on the CD
CStdString strExt;
- if (pItem->m_strPath.Find("MPEGAV") != -1)
+ if (pItem->GetPath().Find("MPEGAV") != -1)
strExt = ".dat";
- if (pItem->m_strPath.Find("MPEG2") != -1)
+ if (pItem->GetPath().Find("MPEG2") != -1)
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
&& (bypassSettings || g_guiSettings.GetBool("dvds.autorun")))
{
CFileItemList items;
- CDirectory::GetDirectory(pItem->m_strPath, items, strExt);
+ CDirectory::GetDirectory(pItem->GetPath(), items, strExt);
if (items.Size())
{
items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC);
@@ -219,12 +219,12 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
}
}
/* Probably want this if/when we add some automedia action dialog...
- else if (pItem->m_strPath.Find("PICTURES") != -1 && bAllowPictures
+ else if (pItem->GetPath().Find("PICTURES") != -1 && bAllowPictures
&& (bypassSettings))
{
bPlaying = true;
CStdString strExec;
- strExec.Format("XBMC.RecursiveSlideShow(%s)", pItem->m_strPath.c_str());
+ strExec.Format("XBMC.RecursiveSlideShow(%s)", pItem->GetPath().c_str());
CBuiltins::Execute(strExec);
return true;
}
@@ -254,7 +254,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
// TODO: remove this once the app/player is capable of handling stacks immediately
CStackDirectory dir;
CFileItemList items;
- dir.GetDirectory(pItem->m_strPath, items);
+ dir.GetDirectory(pItem->GetPath(), items);
itemlist.Append(items);
}
else
@@ -318,9 +318,9 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
CFileItemPtr pItem = vecItems[i];
if (pItem->m_bIsFolder)
{
- if (pItem->m_strPath != "." && pItem->m_strPath != ".." )
+ if (pItem->GetPath() != "." && pItem->GetPath() != ".." )
{
- if (RunDisc(pDir, pItem->m_strPath, nAddedToPlaylist, false, bypassSettings, restart))
+ if (RunDisc(pDir, pItem->GetPath(), nAddedToPlaylist, false, bypassSettings, restart))
{
bPlaying = true;
break;
View
2 xbmc/BackgroundInfoLoader.cpp
@@ -91,7 +91,7 @@ void CBackgroundInfoLoader::Run()
}
catch (...)
{
- CLog::Log(LOGERROR, "%s::LoadItem - Unhandled exception for item %s", __FUNCTION__, pItem->m_strPath.c_str());
+ CLog::Log(LOGERROR, "%s::LoadItem - Unhandled exception for item %s", __FUNCTION__, pItem->GetPath().c_str());
}
}
}
View
4 xbmc/CueDocument.cpp
@@ -376,9 +376,9 @@ bool CCueDocument::ResolvePath(CStdString &strPath, const CStdString &strBase)
CDirectory::GetDirectory(strDirectory,items);
for (int i=0;i<items.Size();++i)
{
- if (items[i]->m_strPath.Equals(strPath))
+ if (items[i]->GetPath().Equals(strPath))
{
- strPath = items[i]->m_strPath;
+ strPath = items[i]->GetPath();
return true;
}
}
View
16 xbmc/Favourites.cpp
@@ -79,7 +79,7 @@ bool CFavourites::LoadFavourites(CStdString& strPath, CFileItemList& items)
if(!items.Contains(favourite->FirstChild()->Value()))
{
CFileItemPtr item(new CFileItem(name));
- item->m_strPath = favourite->FirstChild()->Value();
+ item->SetPath(favourite->FirstChild()->Value());
if (thumb) item->SetThumbnailImage(thumb);
items.Add(item);
}
@@ -104,7 +104,7 @@ bool CFavourites::Save(const CFileItemList &items)
favNode.SetAttribute("name", item->GetLabel().c_str());
if (item->HasThumbnail())
favNode.SetAttribute("thumb", item->GetThumbnailImage().c_str());
- TiXmlText execute(item->m_strPath);
+ TiXmlText execute(item->GetPath());
favNode.InsertEndChild(execute);
rootNode->InsertEndChild(favNode);
}
@@ -132,9 +132,9 @@ bool CFavourites::AddOrRemove(CFileItem *item, int contextWindow)
{ // create our new favourite item
CFileItemPtr favourite(new CFileItem(item->GetLabel()));
if (item->GetLabel().IsEmpty())
- favourite->SetLabel(CUtil::GetTitleFromPath(item->m_strPath, item->m_bIsFolder));
+ favourite->SetLabel(CUtil::GetTitleFromPath(item->GetPath(), item->m_bIsFolder));
favourite->SetThumbnailImage(item->GetThumbnailImage());
- favourite->m_strPath = executePath;
+ favourite->SetPath(executePath);
items.Add(favourite);
}
@@ -172,17 +172,17 @@ CStdString CFavourites::GetExecutePath(const CFileItem *item, int contextWindow)
CStdString execute;
if (item->m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item->IsSmartPlayList() || item->IsPlayList())))
- execute.Format("ActivateWindow(%i,%s)", contextWindow, Paramify(item->m_strPath));
+ execute.Format("ActivateWindow(%i,%s)", contextWindow, Paramify(item->GetPath()));
else if (item->IsScript())
- execute.Format("RunScript(%s)", Paramify(item->m_strPath.Mid(9)));
+ execute.Format("RunScript(%s)", Paramify(item->GetPath().Mid(9)));
else if (contextWindow == WINDOW_PROGRAMS)
- execute.Format("RunXBE(%s)", Paramify(item->m_strPath));
+ execute.Format("RunXBE(%s)", Paramify(item->GetPath()));
else // assume a media file
{
if (item->IsVideoDb() && item->HasVideoInfoTag())
execute.Format("PlayMedia(%s)", Paramify(item->GetVideoInfoTag()->m_strFileNameAndPath));
else
- execute.Format("PlayMedia(%s)", Paramify(item->m_strPath));
+ execute.Format("PlayMedia(%s)", Paramify(item->GetPath()));
}
return execute;
}
View
84 xbmc/FileItem.cpp
@@ -241,7 +241,7 @@ const CFileItem& CFileItem::operator=(const CFileItem& item)
CGUIListItem::operator=(item);
m_bLabelPreformated=item.m_bLabelPreformated;
FreeMemory();
- m_strPath = item.m_strPath;
+ m_strPath = item.GetPath();
m_bIsParentFolder = item.m_bIsParentFolder;
m_iDriveType = item.m_iDriveType;
m_bIsShareOrDrive = item.m_bIsShareOrDrive;
@@ -1113,7 +1113,7 @@ bool CFileItem::IsSamePath(const CFileItem *item) const
if (!item)
return false;
- if (item->m_strPath == m_strPath && item->m_lStartOffset == m_lStartOffset) return true;
+ if (item->GetPath() == m_strPath && item->m_lStartOffset == m_lStartOffset) return true;
if (IsMusicDb() && HasMusicInfoTag())
{
CFileItem dbItem(m_musicInfoTag->GetURL(), false);
@@ -1139,7 +1139,7 @@ bool CFileItem::IsSamePath(const CFileItem *item) const
return IsSamePath(&dbItem);
}
if (HasProperty("original_listitem_url"))
- return (GetProperty("original_listitem_url") == item->m_strPath);
+ return (GetProperty("original_listitem_url") == item->GetPath());
return false;
}
@@ -1188,11 +1188,9 @@ CFileItemList::CFileItemList()
m_replaceListing = false;
}
-CFileItemList::CFileItemList(const CStdString& strPath)
+CFileItemList::CFileItemList(const CStdString& strPath) : CFileItem(strPath, true)
{
- m_strPath=strPath;
m_fastLookup = false;
- m_bIsFolder=true;
m_cacheToDisc=CACHE_IF_SLOW;
m_sortMethod=SORT_METHOD_NONE;
m_sortOrder=SORT_ORDER_NONE;
@@ -1235,7 +1233,7 @@ void CFileItemList::SetFastLookup(bool fastLookup)
for (unsigned int i=0; i < m_items.size(); i++)
{
CFileItemPtr pItem = m_items[i];
- CStdString path(pItem->m_strPath); path.ToLower();
+ CStdString path(pItem->GetPath()); path.ToLower();
m_map.insert(MAPFILEITEMSPAIR(path, pItem));
}
}
@@ -1256,7 +1254,7 @@ bool CFileItemList::Contains(const CStdString& fileName) const
for (unsigned int i = 0; i < m_items.size(); i++)
{
const CFileItemPtr pItem = m_items[i];
- if (pItem->m_strPath.Equals(checkPath))
+ if (pItem->GetPath().Equals(checkPath))
return true;
}
return false;
@@ -1297,7 +1295,7 @@ void CFileItemList::Add(const CFileItemPtr &pItem)
m_items.push_back(pItem);
if (m_fastLookup)
{
- CStdString path(pItem->m_strPath);
+ CStdString path(pItem->GetPath());
path.ToLower();
m_map.insert(MAPFILEITEMSPAIR(path, pItem));
}
@@ -1317,7 +1315,7 @@ void CFileItemList::AddFront(const CFileItemPtr &pItem, int itemPosition)
}
if (m_fastLookup)
{
- CStdString path(pItem->m_strPath); path.ToLower();
+ CStdString path(pItem->GetPath()); path.ToLower();
m_map.insert(MAPFILEITEMSPAIR(path, pItem));
}
}
@@ -1333,7 +1331,7 @@ void CFileItemList::Remove(CFileItem* pItem)
m_items.erase(it);
if (m_fastLookup)
{
- CStdString path(pItem->m_strPath); path.ToLower();
+ CStdString path(pItem->GetPath()); path.ToLower();
m_map.erase(path);
}
break;
@@ -1350,7 +1348,7 @@ void CFileItemList::Remove(int iItem)
CFileItemPtr pItem = *(m_items.begin() + iItem);
if (m_fastLookup)
{
- CStdString path(pItem->m_strPath); path.ToLower();
+ CStdString path(pItem->GetPath()); path.ToLower();
m_map.erase(path);
}
m_items.erase(m_items.begin() + iItem);
@@ -1371,7 +1369,7 @@ void CFileItemList::Assign(const CFileItemList& itemlist, bool append)
if (!append)
Clear();
Append(itemlist);
- m_strPath = itemlist.m_strPath;
+ SetPath(itemlist.GetPath());
m_sortDetails = itemlist.m_sortDetails;
m_replaceListing = itemlist.m_replaceListing;
m_content = itemlist.m_content;
@@ -1441,7 +1439,7 @@ CFileItemPtr CFileItemList::Get(const CStdString& strPath)
for (unsigned int i = 0; i < m_items.size(); i++)
{
CFileItemPtr pItem = m_items[i];
- if (pItem->m_strPath.Equals(pathToCheck))
+ if (pItem->GetPath().Equals(pathToCheck))
return pItem;
}
@@ -1465,7 +1463,7 @@ const CFileItemPtr CFileItemList::Get(const CStdString& strPath) const
for (unsigned int i = 0; i < m_items.size(); i++)
{
CFileItemPtr pItem = m_items[i];
- if (pItem->m_strPath.Equals(pathToCheck))
+ if (pItem->GetPath().Equals(pathToCheck))
return pItem;
}
@@ -1841,7 +1839,7 @@ void CFileItemList::FilterCueItems()
if (pItem->IsCUESheet())
{
CCueDocument cuesheet;
- if (cuesheet.Parse(pItem->m_strPath))
+ if (cuesheet.Parse(pItem->GetPath()))
{
VECSONGS newitems;
cuesheet.GetSongs(newitems);
@@ -1867,7 +1865,7 @@ void CFileItemList::FilterCueItems()
else
{
// try removing the .cue extension...
- strMediaFile = pItem->m_strPath;
+ strMediaFile = pItem->GetPath();
URIUtils::RemoveExtension(strMediaFile);
CFileItem item(strMediaFile, false);
if (item.IsAudio() && Contains(strMediaFile))
@@ -1880,7 +1878,7 @@ void CFileItemList::FilterCueItems()
StringUtils::SplitString(g_settings.m_musicExtensions, "|", extensions);
for (unsigned int i = 0; i < extensions.size(); i++)
{
- strMediaFile = URIUtils::ReplaceExtension(pItem->m_strPath, extensions[i]);
+ strMediaFile = URIUtils::ReplaceExtension(pItem->GetPath(), extensions[i]);
CFileItem item(strMediaFile, false);
if (!item.IsCUESheet() && !item.IsPlayList() && Contains(strMediaFile))
{
@@ -1893,7 +1891,7 @@ void CFileItemList::FilterCueItems()
}
if (bFoundMediaFile)
{
- itemstodelete.push_back(pItem->m_strPath);
+ itemstodelete.push_back(pItem->GetPath());
itemstodelete.push_back(strMediaFile);
// get the additional stuff (year, genre etc.) from the underlying media files tag.
CMusicInfoTag tag;
@@ -1934,13 +1932,13 @@ void CFileItemList::FilterCueItems()
}
else
{ // remove the .cue sheet from the directory
- itemstodelete.push_back(pItem->m_strPath);
+ itemstodelete.push_back(pItem->GetPath());
}
}
}
else
{ // remove the .cue sheet from the directory (can't parse it - no point listing it)
- itemstodelete.push_back(pItem->m_strPath);
+ itemstodelete.push_back(pItem->GetPath());
}
}
}
@@ -1951,7 +1949,7 @@ void CFileItemList::FilterCueItems()
for (int j = 0; j < (int)m_items.size(); j++)
{
CFileItemPtr pItem = m_items[j];
- if (stricmp(pItem->m_strPath.c_str(), itemstodelete[i].c_str()) == 0)
+ if (stricmp(pItem->GetPath().c_str(), itemstodelete[i].c_str()) == 0)
{ // delete this item
m_items.erase(m_items.begin() + j);
break;
@@ -1980,7 +1978,7 @@ void CFileItemList::Stack()
CSingleLock lock(m_lock);
// not allowed here
- if (IsVirtualDirectoryRoot() || IsLiveTV() || m_strPath.Left(10).Equals("sources://"))
+ if (IsVirtualDirectoryRoot() || IsLiveTV() || GetPath().Left(10).Equals("sources://"))
return;
SetProperty("isstacked", "1");
@@ -2002,8 +2000,8 @@ void CFileItemList::Stack()
if( !item->IsRemote()
|| item->IsSmb()
|| item->IsNfs()
- || URIUtils::IsInRAR(item->m_strPath)
- || URIUtils::IsInZIP(item->m_strPath)
+ || URIUtils::IsInRAR(item->GetPath())
+ || URIUtils::IsInZIP(item->GetPath())
)
{
// stack cd# folders if contains only a single video file
@@ -2012,7 +2010,7 @@ void CFileItemList::Stack()
if (folderName.Left(2).Equals("CD") && StringUtils::IsNaturalNumber(folderName.Mid(2)))
{
CFileItemList items;
- CDirectory::GetDirectory(item->m_strPath,items,g_settings.m_videoExtensions,true);
+ CDirectory::GetDirectory(item->GetPath(),items,g_settings.m_videoExtensions,true);
// optimized to only traverse listing once by checking for filecount
// and recording last file item for later use
int nFiles = 0;
@@ -2038,12 +2036,12 @@ void CFileItemList::Stack()
{
CStdString path;
CStdString dvdPath;
- URIUtils::AddFileToFolder(item->m_strPath, "VIDEO_TS.IFO", path);
+ URIUtils::AddFileToFolder(item->GetPath(), "VIDEO_TS.IFO", path);
if (CFile::Exists(path))
dvdPath = path;
else
{
- URIUtils::AddFileToFolder(item->m_strPath, "VIDEO_TS", dvdPath);
+ URIUtils::AddFileToFolder(item->GetPath(), "VIDEO_TS", dvdPath);
URIUtils::AddFileToFolder(dvdPath, "VIDEO_TS.IFO", path);
dvdPath.Empty();
if (CFile::Exists(path))
@@ -2052,12 +2050,12 @@ void CFileItemList::Stack()
#ifdef HAVE_LIBBLURAY
if (dvdPath.IsEmpty())
{
- URIUtils::AddFileToFolder(item->m_strPath, "index.bdmv", path);
+ URIUtils::AddFileToFolder(item->GetPath(), "index.bdmv", path);
if (CFile::Exists(path))
dvdPath = path;
else
{
- URIUtils::AddFileToFolder(item->m_strPath, "BDMV", dvdPath);
+ URIUtils::AddFileToFolder(item->GetPath(), "BDMV", dvdPath);
URIUtils::AddFileToFolder(dvdPath, "index.bdmv", path);
dvdPath.Empty();
if (CFile::Exists(path))
@@ -2074,7 +2072,7 @@ void CFileItemList::Stack()
item->SetUserVideoThumb();
item->m_bIsFolder = false;
- item->m_strPath = dvdPath;
+ item->SetPath(dvdPath);
item->SetLabel2("");
item->SetLabelPreformated(true);
m_sortMethod = SORT_METHOD_NONE; /* sorting is now broken */
@@ -2139,7 +2137,7 @@ void CFileItemList::Stack()
vector<int> stack;
VECCREGEXP::iterator expr = stackRegExps.begin();
- URIUtils::Split(item1->m_strPath, filePath, file1);
+ URIUtils::Split(item1->GetPath(), filePath, file1);
int j;
while (expr != stackRegExps.end())
{
@@ -2169,7 +2167,7 @@ void CFileItemList::Stack()
}
CStdString file2, filePath2;
- URIUtils::Split(item2->m_strPath, filePath2, file2);
+ URIUtils::Split(item2->GetPath(), filePath2, file2);
if (expr->RegFind(file2, offset) != -1)
{
@@ -2242,13 +2240,13 @@ void CFileItemList::Stack()
// dont actually stack a multipart rar set, just remove all items but the first
CStdString stackPath;
if (Get(stack[0])->IsRAR())
- stackPath = Get(stack[0])->m_strPath;
+ stackPath = Get(stack[0])->GetPath();
else
{
CStackDirectory dir;
stackPath = dir.ConstructStackPath(*this, stack);
}
- item1->m_strPath = stackPath;
+ item1->SetPath(stackPath);
// clean up list
for (unsigned k = 1; k < stack.size(); k++)
Remove(i+1);
@@ -2272,10 +2270,10 @@ bool CFileItemList::Load(int windowID)
CFile file;
if (file.Open(GetDiscCacheFile(windowID)))
{
- CLog::Log(LOGDEBUG,"Loading fileitems [%s]",m_strPath.c_str());
+ CLog::Log(LOGDEBUG,"Loading fileitems [%s]",GetPath().c_str());
CArchive ar(&file, CArchive::load);
ar >> *this;
- CLog::Log(LOGDEBUG," -- items: %i, directory: %s sort method: %i, ascending: %s",Size(),m_strPath.c_str(), m_sortMethod, m_sortOrder ? "true" : "false");
+ CLog::Log(LOGDEBUG," -- items: %i, directory: %s sort method: %i, ascending: %s",Size(),GetPath().c_str(), m_sortMethod, m_sortOrder ? "true" : "false");
ar.Close();
file.Close();
return true;
@@ -2290,7 +2288,7 @@ bool CFileItemList::Save(int windowID)
if (iSize <= 0)
return false;
- CLog::Log(LOGDEBUG,"Saving fileitems [%s]",m_strPath.c_str());
+ CLog::Log(LOGDEBUG,"Saving fileitems [%s]",GetPath().c_str());
CFile file;
if (file.OpenForWrite(GetDiscCacheFile(windowID), true)) // overwrite always
@@ -2311,14 +2309,14 @@ void CFileItemList::RemoveDiscCache(int windowID) const
CStdString cacheFile(GetDiscCacheFile(windowID));
if (CFile::Exists(cacheFile))
{
- CLog::Log(LOGDEBUG,"Clearing cached fileitems [%s]",m_strPath.c_str());
+ CLog::Log(LOGDEBUG,"Clearing cached fileitems [%s]",GetPath().c_str());
CFile::Delete(cacheFile);
}
}
CStdString CFileItemList::GetDiscCacheFile(int windowID) const
{
- CStdString strPath=m_strPath;
+ CStdString strPath(GetPath());
URIUtils::RemoveSlashAtEnd(strPath);
Crc32 crc;
@@ -2342,9 +2340,9 @@ bool CFileItemList::AlwaysCache() const
{
// some database folders are always cached
if (IsMusicDb())
- return CMusicDatabaseDirectory::CanCache(m_strPath);
+ return CMusicDatabaseDirectory::CanCache(GetPath());
if (IsVideoDb())
- return CVideoDatabaseDirectory::CanCache(m_strPath);
+ return CVideoDatabaseDirectory::CanCache(GetPath());
return false;
}
@@ -2909,7 +2907,7 @@ void CFileItemList::Swap(unsigned int item1, unsigned int item2)
bool CFileItemList::UpdateItem(const CFileItem *item)
{
if (!item) return false;
- CFileItemPtr oldItem = Get(item->m_strPath);
+ CFileItemPtr oldItem = Get(item->GetPath());
if (oldItem)
*oldItem = *item;
return oldItem;
View
6 xbmc/FileItem.h
@@ -78,6 +78,9 @@ class CFileItem :
virtual ~CFileItem(void);
virtual CGUIListItem *Clone() const { return new CFileItem(*this); };
+ const CStdString &GetPath() const { return m_strPath; };
+ void SetPath(const CStdString &path) { m_strPath = path; };
+
void Reset();
const CFileItem& operator=(const CFileItem& item);
virtual void Archive(CArchive& ar);
@@ -281,7 +284,6 @@ class CFileItem :
CStdString GetPreviouslyCachedMusicThumb() const;
public:
- CStdString m_strPath; ///< complete path to item
bool m_bIsShareOrDrive; ///< is this a root share/drive
int m_iDriveType; ///< If \e m_bIsShareOrDrive is \e true, use to get the share type. Types see: CMediaSource::m_iDriveType
CDateTime m_dateTime; ///< file creation date & time
@@ -296,7 +298,9 @@ class CFileItem :
CStdString m_strLockCode;
int m_iHasLock; // 0 - no lock 1 - lock, but unlocked 2 - locked
int m_iBadPwdCount;
+
private:
+ CStdString m_strPath; ///< complete path to item
SPECIAL_SORT m_specialSort;
bool m_bIsParentFolder;
View
38 xbmc/GUIInfoManager.cpp
@@ -118,7 +118,7 @@ bool CGUIInfoManager::OnMessage(CGUIMessage &message)
if (message.GetParam1() == GUI_MSG_UPDATE_ITEM && message.GetItem())
{
CFileItemPtr item = boost::static_pointer_cast<CFileItem>(message.GetItem());
- if (item && m_currentFile->m_strPath.Equals(item->m_strPath))
+ if (item && m_currentFile->GetPath().Equals(item->GetPath()))
*m_currentFile = *item;
return true;
}
@@ -1115,7 +1115,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
else if (m_currentFile->HasVideoInfoTag())
strLabel = m_currentFile->GetVideoInfoTag()->m_strFileNameAndPath;
if (strLabel.IsEmpty())
- strLabel = m_currentFile->m_strPath;
+ strLabel = m_currentFile->GetPath();
}
if (info == PLAYER_PATH)
{
@@ -1270,7 +1270,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
if (info==CONTAINER_FOLDERNAME)
strLabel = ((CGUIMediaWindow*)window)->CurrentDirectory().GetLabel();
else
- strLabel = CURL(((CGUIMediaWindow*)window)->CurrentDirectory().m_strPath).GetWithoutUserDetails();
+ strLabel = CURL(((CGUIMediaWindow*)window)->CurrentDirectory().GetPath()).GetWithoutUserDetails();
}
break;
}
@@ -1279,7 +1279,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
CGUIWindow *window = GetWindowWithCondition(contextWindow, WINDOW_CONDITION_IS_MEDIA_WINDOW);
if (window)
{
- CURL url(((CGUIMediaWindow*)window)->CurrentDirectory().m_strPath);
+ CURL url(((CGUIMediaWindow*)window)->CurrentDirectory().GetPath());
if (url.GetProtocol().Equals("plugin"))
{
strLabel = url.GetFileName();
@@ -3112,7 +3112,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item)
return g_application.m_pPlayer->GetPlayingTitle();
if (!m_currentFile->GetLabel().IsEmpty())
return m_currentFile->GetLabel();
- return CUtil::GetTitleFromPath(m_currentFile->m_strPath);
+ return CUtil::GetTitleFromPath(m_currentFile->GetPath());
}
else if (item == VIDEOPLAYER_PLAYLISTLEN)
{
@@ -3315,14 +3315,14 @@ void CGUIInfoManager::SetCurrentAlbumThumb(const CStdString thumbFileName)
void CGUIInfoManager::SetCurrentSong(CFileItem &item)
{
- CLog::Log(LOGDEBUG,"CGUIInfoManager::SetCurrentSong(%s)",item.m_strPath.c_str());
+ CLog::Log(LOGDEBUG,"CGUIInfoManager::SetCurrentSong(%s)",item.GetPath().c_str());
*m_currentFile = item;
m_currentFile->LoadMusicTag();
if (m_currentFile->GetMusicInfoTag()->GetTitle().IsEmpty())
{
// No title in tag, show filename only
- m_currentFile->GetMusicInfoTag()->SetTitle(CUtil::GetTitleFromPath(m_currentFile->m_strPath));
+ m_currentFile->GetMusicInfoTag()->SetTitle(CUtil::GetTitleFromPath(m_currentFile->GetPath()));
}
m_currentFile->GetMusicInfoTag()->SetLoaded(true);
@@ -3353,13 +3353,13 @@ void CGUIInfoManager::SetCurrentSong(CFileItem &item)
void CGUIInfoManager::SetCurrentMovie(CFileItem &item)
{
- CLog::Log(LOGDEBUG,"CGUIInfoManager::SetCurrentMovie(%s)",item.m_strPath.c_str());
+ CLog::Log(LOGDEBUG,"CGUIInfoManager::SetCurrentMovie(%s)",item.GetPath().c_str());
*m_currentFile = item;
CVideoDatabase dbs;
if (dbs.Open())
{
- dbs.LoadVideoInfo(item.m_strPath, *m_currentFile->GetVideoInfoTag());
+ dbs.LoadVideoInfo(item.GetPath(), *m_currentFile->GetVideoInfoTag());
dbs.Close();
}
@@ -3698,7 +3698,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
else if (item->IsVideoDb() && item->HasVideoInfoTag())
strFile = URIUtils::GetFileName(item->GetVideoInfoTag()->m_strFileNameAndPath);
else
- strFile = URIUtils::GetFileName(item->m_strPath);
+ strFile = URIUtils::GetFileName(item->GetPath());
if (info==LISTITEM_FILE_EXTENSION)
{
@@ -3824,7 +3824,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
case LISTITEM_THUMB:
return item->GetThumbnailImage();
case LISTITEM_FOLDERPATH:
- return CURL(item->m_strPath).GetWithoutUserDetails();
+ return CURL(item->GetPath()).GetWithoutUserDetails();
case LISTITEM_FOLDERNAME:
case LISTITEM_PATH:
{
@@ -3839,7 +3839,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
URIUtils::GetParentPath(item->GetVideoInfoTag()->m_strFileNameAndPath, path);
}
else
- URIUtils::GetParentPath(item->m_strPath, path);
+ URIUtils::GetParentPath(item->GetPath(), path);
path = CURL(path).GetWithoutUserDetails();
if (info==LISTITEM_FOLDERNAME)
{
@@ -3857,14 +3857,14 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
else if (item->IsVideoDb() && item->HasVideoInfoTag())
path = item->GetVideoInfoTag()->m_strFileNameAndPath;
else
- path = item->m_strPath;
+ path = item->GetPath();
path = CURL(path).GetWithoutUserDetails();
CURL::Decode(path);
return path;
}
case LISTITEM_PICTURE_PATH:
if (item->IsPicture() && (!item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR()))
- return item->m_strPath;
+ return item->GetPath();
break;
case LISTITEM_PICTURE_DATETIME:
if (item->HasPictureInfoTag())
@@ -4006,12 +4006,12 @@ bool CGUIInfoManager::GetItemBool(const CGUIListItem *item, int condition) const
}
else if (condition == LISTITEM_ISPLAYING)
{
- if (item->IsFileItem() && !m_currentFile->m_strPath.IsEmpty())
+ if (item->IsFileItem() && !m_currentFile->GetPath().IsEmpty())
{
if (!g_application.m_strPlayListFile.IsEmpty())
{
//playlist file that is currently playing or the playlistitem that is currently playing.
- return g_application.m_strPlayListFile.Equals(((const CFileItem *)item)->m_strPath) || m_currentFile->IsSamePath((const CFileItem *)item);
+ return g_application.m_strPlayListFile.Equals(((const CFileItem *)item)->GetPath()) || m_currentFile->IsSamePath((const CFileItem *)item);
}
return m_currentFile->IsSamePath((const CFileItem *)item);
}
@@ -4081,7 +4081,7 @@ CStdString CGUIInfoManager::GetPictureLabel(int info) const
else if (info == SLIDE_FILE_PATH)
{
CStdString path;
- URIUtils::GetDirectory(m_currentSlide->m_strPath, path);
+ URIUtils::GetDirectory(m_currentSlide->GetPath(), path);
return CURL(path).GetWithoutUserDetails();
}
else if (info == SLIDE_FILE_SIZE)
@@ -4105,10 +4105,10 @@ CStdString CGUIInfoManager::GetPictureLabel(int info) const
void CGUIInfoManager::SetCurrentSlide(CFileItem &item)
{
- if (m_currentSlide->m_strPath != item.m_strPath)
+ if (m_currentSlide->GetPath() != item.GetPath())
{
if (!item.HasPictureInfoTag() && !item.GetPictureInfoTag()->Loaded())
- item.GetPictureInfoTag()->Load(item.m_strPath);
+ item.GetPictureInfoTag()->Load(item.GetPath());
*m_currentSlide = item;
}
}
View
2 xbmc/GUIViewControl.cpp
@@ -198,7 +198,7 @@ void CGUIViewControl::SetSelectedItem(const CStdString &itemPath)
int item = -1;
for (int i = 0; i < m_fileItems->Size(); ++i)
{
- CStdString strPath =(*m_fileItems)[i]->m_strPath;
+ CStdString strPath =(*m_fileItems)[i]->GetPath();
URIUtils::RemoveSlashAtEnd(strPath);
if (strPath.CompareNoCase(comparePath) == 0)
{
View
8 xbmc/GUIViewState.cpp
@@ -95,7 +95,7 @@ CGUIViewState* CGUIViewState::GetViewState(int windowId, const CFileItemList& it
if (url.GetProtocol() == "lastfm")
return new CGUIViewStateMusicLastFM(items);
- if (items.m_strPath == "special://musicplaylists/")
+ if (items.GetPath() == "special://musicplaylists/")
return new CGUIViewStateWindowMusicSongs(items);
if (windowId==WINDOW_MUSIC_NAV)
@@ -453,7 +453,7 @@ CGUIViewStateFromItems::CGUIViewStateFromItems(const CFileItemList &items) : CGU
SetSortOrder(SORT_ORDER_ASC);
if (items.IsPlugin())
{
- CURL url(items.m_strPath);
+ CURL url(items.GetPath());
AddonPtr addon;
if (CAddonMgr::Get().GetAddon(url.GetHostName(),addon) && addon)
{
@@ -464,12 +464,12 @@ CGUIViewStateFromItems::CGUIViewStateFromItems(const CFileItemList &items) : CGU
m_playlist = PLAYLIST_VIDEO;
}
}
- LoadViewState(items.m_strPath, g_windowManager.GetActiveWindow());
+ LoadViewState(items.GetPath(), g_windowManager.GetActiveWindow());
}
void CGUIViewStateFromItems::SaveViewState()
{
- SaveViewToDb(m_items.m_strPath, g_windowManager.GetActiveWindow());
+ SaveViewToDb(m_items.GetPath(), g_windowManager.GetActiveWindow());
}
View
2 xbmc/PartyModeManager.cpp
@@ -433,7 +433,7 @@ void CPartyModeManager::Add(CFileItemPtr &pItem)
CPlayList& playlist = g_playlistPlayer.GetPlaylist(iPlaylist);
playlist.Add(pItem);
- CLog::Log(LOGINFO,"PARTY MODE MANAGER: Adding randomly selected song at %i:[%s]", playlist.size() - 1, pItem->m_strPath.c_str());
+ CLog::Log(LOGINFO,"PARTY MODE MANAGER: Adding randomly selected song at %i:[%s]", playlist.size() - 1, pItem->GetPath().c_str());
m_iMatchingSongsPicked++;
}
View
4 xbmc/PlayListPlayer.cpp
@@ -135,7 +135,7 @@ int CPlayListPlayer::GetNextSong()
// otherwise immediately abort playback
if (m_iCurrentSong >= 0 && m_iCurrentSong < playlist.size() && playlist[m_iCurrentSong]->GetPropertyBOOL("unplayable"))
{
- CLog::Log(LOGERROR,"Playlist Player: RepeatOne stuck on unplayable item: %i, path [%s]", m_iCurrentSong, playlist[m_iCurrentSong]->m_strPath.c_str());
+ CLog::Log(LOGERROR,"Playlist Player: RepeatOne stuck on unplayable item: %i, path [%s]", m_iCurrentSong, playlist[m_iCurrentSong]->GetPath().c_str());
CGUIMessage msg(GUI_MSG_PLAYLISTPLAYER_STOPPED, 0, 0, m_iCurrentPlayList, m_iCurrentSong);
g_windowManager.SendThreadMessage(msg);
Reset();
@@ -253,7 +253,7 @@ bool CPlayListPlayer::Play(int iSong, bool bAutoPlay /* = false */, bool bPlayPr
unsigned int playAttempt = XbmcThreads::SystemClockMillis();
if (!g_application.PlayFile(*item, bAutoPlay))
{
- CLog::Log(LOGERROR,"Playlist Player: skipping unplayable item: %i, path [%s]", m_iCurrentSong, item->m_strPath.c_str());
+ CLog::Log(LOGERROR,"Playlist Player: skipping unplayable item: %i, path [%s]", m_iCurrentSong, item->GetPath().c_str());
playlist.SetUnPlayable(m_iCurrentSong);
// abort on 100 failed CONSECTUTIVE songs
View
4 xbmc/SortFileItem.cpp
@@ -121,7 +121,7 @@ void SSortFileItem::ByFile(CFileItemPtr &item)
{
if (!item) return;
- CURL url(item->m_strPath);
+ CURL url(item->GetPath());
CStdString label;
label.Format("%s %d", url.GetFileNameWithoutPath().c_str(), item->m_lStartOffset);
item->SetSortLabel(label);
@@ -132,7 +132,7 @@ void SSortFileItem::ByFullPath(CFileItemPtr &item)
if (!item) return;
CStdString label;
- label.Format("%s %d", item->m_strPath, item->m_lStartOffset);
+ label.Format("%s %d", item->GetPath(), item->m_lStartOffset);
item->SetSortLabel(label);
}
View
14 xbmc/ThumbLoader.cpp
@@ -73,7 +73,7 @@ CStdString CThumbLoader::GetCachedThumb(const CFileItem &item)
{
CTextureDatabase db;
if (db.Open())
- return db.GetTextureForPath(item.m_strPath);
+ return db.GetTextureForPath(item.GetPath());
return "";
}
@@ -95,7 +95,7 @@ CThumbExtractor::CThumbExtractor(const CFileItem& item, const CStdString& listpa
m_thumb = thumb;
m_item = item;
- m_path = item.m_strPath;
+ m_path = item.GetPath();
if (item.IsVideoDb() && item.HasVideoInfoTag())
m_path = item.GetVideoInfoTag()->m_strFileNameAndPath;
@@ -217,7 +217,7 @@ bool CVideoThumbLoader::LoadItem(CFileItem* pItem)
else if (!item.m_bIsFolder && item.IsVideo() && g_guiSettings.GetBool("myvideos.extractthumb") &&
g_guiSettings.GetBool("myvideos.extractflags"))
{
- CThumbExtractor* extract = new CThumbExtractor(item, pItem->m_strPath, true, cachedThumb);
+ CThumbExtractor* extract = new CThumbExtractor(item, pItem->GetPath(), true, cachedThumb);
AddJob(extract);
}
}
@@ -237,7 +237,7 @@ bool CVideoThumbLoader::LoadItem(CFileItem* pItem)
(!pItem->GetVideoInfoTag()->HasStreamDetails() ||
pItem->GetVideoInfoTag()->m_streamDetails.GetVideoDuration() <= 0))
{
- CThumbExtractor* extract = new CThumbExtractor(*pItem,pItem->m_strPath,false);
+ CThumbExtractor* extract = new CThumbExtractor(*pItem,pItem->GetPath(),false);
AddJob(extract);
}
return true;
@@ -248,7 +248,7 @@ void CVideoThumbLoader::OnJobComplete(unsigned int jobID, bool success, CJob* jo
if (success)
{
CThumbExtractor* loader = (CThumbExtractor*)job;
- loader->m_item.m_strPath = loader->m_listpath;
+ loader->m_item.SetPath(loader->m_listpath);
CVideoInfoTag* info = loader->m_item.GetVideoInfoTag();
if (m_pStreamDetailsObs)
m_pStreamDetailsObs->OnStreamDetails(info->m_streamDetails, info->m_strFileNameAndPath, info->m_iFileId);
@@ -293,7 +293,7 @@ bool CProgramThumbLoader::FillThumb(CFileItem &item)
{
CTextureDatabase db;
if (db.Open())
- db.SetTextureForPath(item.m_strPath, thumb);
+ db.SetTextureForPath(item.GetPath(), thumb);
thumb = CTextureCache::Get().CheckAndCacheImage(thumb);
}
item.SetThumbnailImage(thumb);
@@ -306,7 +306,7 @@ CStdString CProgramThumbLoader::GetLocalThumb(const CFileItem &item)
if (item.IsShortCut())
{
CShortcut shortcut;
- if ( shortcut.Create( item.m_strPath ) )
+ if ( shortcut.Create( item.GetPath() ) )
{
// use the shortcut's thumb
if (!shortcut.m_strThumb.IsEmpty())
View
6 xbmc/ThumbnailCache.cpp
@@ -195,15 +195,15 @@ CStdString CThumbnailCache::GetEpisodeThumb(const CVideoInfoTag* videoInfo)
CStdString CThumbnailCache::GetVideoThumb(const CFileItem &item)
{
if (item.IsStack())
- return GetThumb(CStackDirectory::GetFirstStackedFile(item.m_strPath), g_settings.GetVideoThumbFolder(), true);
+ return GetThumb(CStackDirectory::GetFirstStackedFile(item.GetPath()), g_settings.GetVideoThumbFolder(), true);
else if (item.IsVideoDb() && item.HasVideoInfoTag())
{
if (item.m_bIsFolder && !item.GetVideoInfoTag()->m_strPath.IsEmpty())
return GetThumb(item.GetVideoInfoTag()->m_strPath, g_settings.GetVideoThumbFolder(), true);
else if (!item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
return GetThumb(item.GetVideoInfoTag()->m_strFileNameAndPath, g_settings.GetVideoThumbFolder(), true);
}
- return GetThumb(item.m_strPath, g_settings.GetVideoThumbFolder(), true);
+ return GetThumb(item.GetPath(), g_settings.GetVideoThumbFolder(), true);
}
CStdString CThumbnailCache::GetFanart(const CFileItem &item)
@@ -229,7 +229,7 @@ CStdString CThumbnailCache::GetFanart(const CFileItem &item)
if (item.HasMusicInfoTag())
return GetThumb(item.GetMusicInfoTag()->GetArtist(),g_settings.GetMusicFanartFolder());
- return GetThumb(item.m_strPath,g_settings.GetVideoFanartFolder());
+ return GetThumb(item.GetPath(),g_settings.GetVideoFanartFolder());
}
CStdString CThumbnailCache::GetThumb(const CStdString &path, const CStdString &path2, bool split /* = false */)
View
6 xbmc/URL.cpp
@@ -528,9 +528,9 @@ CStdString CURL::GetWithoutUserDetails() const
vector<CStdString> newItems;
for (int i=0;i<items.Size();++i)
{
- CURL url(items[i]->m_strPath);
- items[i]->m_strPath = url.GetWithoutUserDetails();
- newItems.push_back(items[i]->m_strPath);
+ CURL url(items[i]->GetPath());
+ items[i]->SetPath(url.GetWithoutUserDetails());
+ newItems.push_back(items[i]->GetPath());
}
dir.ConstructStackPath(newItems,strURL);
return strURL;
View
30 xbmc/Util.cpp
@@ -718,7 +718,7 @@ void CUtil::RemoveTempFiles()
{
if (items[i]->m_bIsFolder)
continue;
- XFILE::CFile::Delete(items[i]->m_strPath);
+ XFILE::CFile::Delete(items[i]->GetPath());
}
}
@@ -731,10 +731,10 @@ void CUtil::ClearSubtitles()
{
if (!items[i]->m_bIsFolder)
{
- if ( items[i]->m_strPath.Find("subtitle") >= 0 || items[i]->m_strPath.Find("vobsub_queue") >= 0 )
+ if ( items[i]->GetPath().Find("subtitle") >= 0 || items[i]->GetPath().Find("vobsub_queue") >= 0 )
{
- CLog::Log(LOGDEBUG, "%s - Deleting temporary subtitle %s", __FUNCTION__, items[i]->m_strPath.c_str());
- CFile::Delete(items[i]->m_strPath);
+ CLog::Log(LOGDEBUG, "%s - Deleting temporary subtitle %s", __FUNCTION__, items[i]->GetPath().c_str());
+ CFile::Delete(items[i]->GetPath());
}
}
}
@@ -1645,9 +1645,9 @@ void CUtil::DeleteDirectoryCache(const CStdString &prefix)
{
if (items[i]->m_bIsFolder)
continue;
- CStdString fileName = URIUtils::GetFileName(items[i]->m_strPath);
+ CStdString fileName = URIUtils::GetFileName(items[i]->GetPath());
if (fileName.Left(prefix.GetLength()) == prefix)
- XFILE::CFile::Delete(items[i]->m_strPath);
+ XFILE::CFile::Delete(items[i]->GetPath());
}
}
@@ -1767,7 +1767,7 @@ void CUtil::GetRecursiveListing(const CStdString& strPath, CFileItemList& items,
for (int i=0;i<myItems.Size();++i)
{
if (myItems[i]->m_bIsFolder)
- CUtil::GetRecursiveListing(myItems[i]->m_strPath,items,strMask,bUseFileDirectories);
+ CUtil::GetRecursiveListing(myItems[i]->GetPath(),items,strMask,bUseFileDirectories);
else
items.Add(myItems[i]);
}
@@ -1779,10 +1779,10 @@ void CUtil::GetRecursiveDirsListing(const CStdString& strPath, CFileItemList& it
CDirectory::GetDirectory(strPath,myItems,"",false);
for (int i=0;i<myItems.Size();++i)
{
- if (myItems[i]->m_bIsFolder && !myItems[i]->m_strPath.Equals(".."))
+ if (myItems[i]->m_bIsFolder && !myItems[i]->GetPath().Equals(".."))
{
item.Add(myItems[i]);
- CUtil::GetRecursiveDirsListing(myItems[i]->m_strPath,item);
+ CUtil::GetRecursiveDirsListing(myItems[i]->GetPath(),item);
}
}
}
@@ -1933,7 +1933,7 @@ void CUtil::GetSkinThemes(vector<CStdString>& vecTheme)
if (!pItem->m_bIsFolder)
{
CStdString strExtension;
- URIUtils::GetExtension(pItem->m_strPath, strExtension);
+ URIUtils::GetExtension(pItem->GetPath(), strExtension);
if ((strExtension == ".xpr" && pItem->GetLabel().CompareNoCase("Textures.xpr")) ||
(strExtension == ".xbt" && pItem->GetLabel().CompareNoCase("Textures.xbt")))
{
@@ -2359,12 +2359,12 @@ void CUtil::ScanForExternalSubtitles(const CStdString& strMovie, std::vector<CSt
for (int j = 0; j < items.Size(); j++)
{
- URIUtils::Split(items[j]->m_strPath, strPath, strItem);
+ URIUtils::Split(items[j]->GetPath(), strPath, strItem);
// is this a rar or zip-file
if (URIUtils::IsRAR(strItem) || URIUtils::IsZIP(strItem))
{
- ScanArchiveForSubtitles( items[j]->m_strPath, strMovieFileNameNoExt, vecSubtitles );
+ ScanArchiveForSubtitles( items[j]->GetPath(), strMovieFileNameNoExt, vecSubtitles );
}
else // not a rar/zip file
{
@@ -2373,8 +2373,8 @@ void CUtil::ScanForExternalSubtitles(const CStdString& strMovie, std::vector<CSt
//Cache subtitle with same name as movie
if (URIUtils::GetExtension(strItem).Equals(sub_exts[i]) && strItem.Left(fnl).Equals(strMovieFileNameNoExt))
{
- vecSubtitles.push_back( items[j]->m_strPath );
- CLog::Log(LOGINFO, "%s: found subtitle file %s\n", __FUNCTION__, items[j]->m_strPath.c_str() );
+ vecSubtitles.push_back( items[j]->GetPath() );
+ CLog::Log(LOGINFO, "%s: found subtitle file %s\n", __FUNCTION__, items[j]->GetPath().c_str() );
}
}
}
@@ -2439,7 +2439,7 @@ int CUtil::ScanArchiveForSubtitles( const CStdString& strArchivePath, const CStd
}
for (int it= 0 ; it <ItemList.Size();++it)
{
- CStdString strPathInRar = ItemList[it]->m_strPath;
+ CStdString strPathInRar = ItemList[it]->GetPath();
CStdString strExt = URIUtils::GetExtension(strPathInRar);
CLog::Log(LOGDEBUG, "ScanArchiveForSubtitles:: Found file %s", strPathInRar.c_str());
View
4 xbmc/addons/AddonInstaller.cpp
@@ -231,7 +231,7 @@ bool CAddonInstaller::InstallFromZip(const CStdString &path)
}
// TODO: possibly add support for github generated zips here?
- CStdString archive = URIUtils::AddFileToFolder(items[0]->m_strPath, "addon.xml");
+ CStdString archive = URIUtils::AddFileToFolder(items[0]->GetPath(), "addon.xml");
TiXmlDocument xml;
AddonPtr addon;
@@ -379,7 +379,7 @@ bool CAddonInstallJob::DoWork()
CFile::Delete(package);
return false;
}
- installFrom = archivedFiles[0]->m_strPath;
+ installFrom = archivedFiles[0]->GetPath();
}
// run any pre-install functions
View
2 xbmc/addons/GUIDialogAddonInfo.cpp
@@ -308,7 +308,7 @@ void CGUIDialogAddonInfo::OnJobComplete(unsigned int jobID, bool success,
{
CFile file;
if (file.Open("special://temp/"+
- URIUtils::GetFileName(((CFileOperationJob*)job)->GetItems()[0]->m_strPath)))
+ URIUtils::GetFileName(((CFileOperationJob*)job)->GetItems()[0]->GetPath())))
{
char* temp = new char[(size_t)file.GetLength()+1];
file.Read(temp,file.GetLength());
View
4 xbmc/addons/GUIViewStateAddonBrowser.cpp
@@ -40,12 +40,12 @@ CGUIViewStateAddonBrowser::CGUIViewStateAddonBrowser(const CFileItemList& items)
SetViewAsControl(DEFAULT_VIEW_AUTO);
SetSortOrder(SORT_ORDER_ASC);
- LoadViewState(items.m_strPath, WINDOW_ADDON_BROWSER);
+ LoadViewState(items.GetPath(), WINDOW_ADDON_BROWSER);
}
void CGUIViewStateAddonBrowser::SaveViewState()
{
- SaveViewToDb(m_items.m_strPath, WINDOW_ADDON_BROWSER);
+ SaveViewToDb(m_items.GetPath(), WINDOW_ADDON_BROWSER);
}
CStdString CGUIViewStateAddonBrowser::GetExtensions()
View
18 xbmc/addons/GUIWindowAddonBrowser.cpp
@@ -81,8 +81,8 @@ bool CGUIWindowAddonBrowser::OnMessage(CGUIMessage& message)
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
- if (m_vecItems->m_strPath == "?" && message.GetStringParam().IsEmpty())
- m_vecItems->m_strPath = "";
+ if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
+ m_vecItems->SetPath("");
}
break;
case GUI_MSG_CLICKED:
@@ -142,7 +142,7 @@ void CGUIWindowAddonBrowser::GetContextButtons(int itemNumber,
CContextButtons& buttons)
{
CFileItemPtr pItem = m_vecItems->Get(itemNumber);
- if (pItem->m_strPath.Equals("addons://enabled/"))
+ if (pItem->GetPath().Equals("addons://enabled/"))
buttons.Add(CONTEXT_BUTTON_SCAN,24034);
AddonPtr addon;
@@ -165,7 +165,7 @@ bool CGUIWindowAddonBrowser::OnContextButton(int itemNumber,
CONTEXT_BUTTON button)
{
CFileItemPtr pItem = m_vecItems->Get(itemNumber);
- if (pItem->m_strPath.Equals("addons://enabled/"))
+ if (pItem->GetPath().Equals("addons://enabled/"))
{
if (button == CONTEXT_BUTTON_SCAN)
{
@@ -207,7 +207,7 @@ bool CGUIWindowAddonBrowser::OnContextButton(int itemNumber,
bool CGUIWindowAddonBrowser::OnClick(int iItem)
{
CFileItemPtr item = m_vecItems->Get(iItem);
- if (item->m_strPath == "addons://install/")
+ if (item->GetPath() == "addons://install/")
{
// pop up filebrowser to grab an installed folder
VECSOURCES shares = g_settings.m_fileSources;
@@ -227,7 +227,7 @@ bool CGUIWindowAddonBrowser::OnClick(int iItem)
g_localizeStrings.Get(24066),""))
{
if (CAddonInstaller::Get().Cancel(item->GetProperty("Addon.ID")))
- Update(m_vecItems->m_strPath);
+ Update(m_vecItems->GetPath());
}
return true;
}
@@ -259,12 +259,12 @@ bool CGUIWindowAddonBrowser::GetDirectory(const CStdString& strDirectory,
CAddonsDirectory::GenerateListing(url,addons,items);
result = true;
items.SetProperty("reponame",g_localizeStrings.Get(24067));
- items.m_strPath = strDirectory;
+ items.SetPath(strDirectory);
if (m_guiState.get() && !m_guiState->HideParentDirItems())
{
CFileItemPtr pItem(new CFileItem(".."));
- pItem->m_strPath = m_history.GetParentPath();
+ pItem->SetPath(m_history.GetParentPath());
pItem->m_bIsFolder = true;
pItem->m_bIsShareOrDrive = false;
items.AddFront(pItem, 0);
@@ -377,7 +377,7 @@ int CGUIWindowAddonBrowser::SelectAddonID(TYPE type, CStdString &addonID, bool s
}
if (dialog->GetSelectedLabel() >= 0)
{
- addonID = dialog->GetSelectedItem().m_strPath;
+ addonID = dialog->GetSelectedItem().GetPath();
return 1;
}
return 0;
View
2 xbmc/addons/Scraper.cpp
@@ -222,7 +222,7 @@ void CScraper::ClearCache()
{
// wipe cache
if (items[i]->m_dateTime + m_persistence <= CDateTime::GetCurrentDateTime())
- CFile::Delete(items[i]->m_strPath);
+ CFile::Delete(items[i]->GetPath());
}
}
else
View
14 xbmc/cdrip/CDDARipper.cpp
@@ -256,7 +256,7 @@ bool CCDDARipper::RipTrack(CFileItem* pItem)
{
// don't rip non cdda items
CStdString strExt;
- URIUtils::GetExtension(pItem->m_strPath, strExt);
+ URIUtils::GetExtension(pItem->GetPath(), strExt);
if (strExt.CompareNoCase(".cdda") != 0)
{
CLog::Log(LOGDEBUG, "cddaripper: file is not a cdda track");
@@ -271,7 +271,7 @@ bool CCDDARipper::RipTrack(CFileItem* pItem)
CStdString strFile = URIUtils::AddFileToFolder(strDirectory, CUtil::MakeLegalFileName(GetTrackName(pItem), legalType));
- return Rip(pItem->m_strPath, strFile.c_str(), *pItem->GetMusicInfoTag());
+ return Rip(pItem->GetPath(), strFile.c_str(), *pItem->GetMusicInfoTag());
}
bool CCDDARipper::RipCD()
@@ -294,10 +294,10 @@ bool CCDDARipper::RipCD()
{
CFileItemPtr pItem = vecItems[i];
CMusicInfoTagLoaderFactory factory;
- auto_ptr<IMusicInfoTagLoader> pLoader (factory.CreateLoader(pItem->m_strPath));
+ auto_ptr<IMusicInfoTagLoader> pLoader (factory.CreateLoader(pItem->GetPath()));
if (NULL != pLoader.get())
{
- pLoader->Load(pItem->m_strPath, *pItem->GetMusicInfoTag()); // get tag from file
+ pLoader->Load(pItem->GetPath(), *pItem->GetMusicInfoTag()); // get tag from file
if (!pItem->GetMusicInfoTag()->Loaded())
break; // No CDDB info available
}
@@ -320,11 +320,11 @@ bool CCDDARipper::RipCD()
unsigned int tick = XbmcThreads::SystemClockMillis();
// don't rip non cdda items
- if (item->m_strPath.Find(".cdda") < 0)
+ if (item->GetPath().Find(".cdda") < 0)
continue;
// return false if Rip returned false (this means an error or the user cancelled
- if (!Rip(item->m_strPath, strFile.c_str(), *item->GetMusicInfoTag()))
+ if (!Rip(item->GetPath(), strFile.c_str(), *item->GetMusicInfoTag()))
return false;
tick = XbmcThreads::SystemClockMillis() - tick;
@@ -453,7 +453,7 @@ CStdString CCDDARipper::GetAlbumDirName(const MUSIC_INFO::CMusicInfoTag& infoTag
CStdString CCDDARipper::GetTrackName(CFileItem *item)
{
// get track number from "cdda://local/01.cdda"
- int trackNumber = atoi(item->m_strPath.substr(13, item->m_strPath.size() - 13 - 5).c_str());
+ int trackNumber = atoi(item->GetPath().substr(13, item->GetPath().size() - 13 - 5).c_str());
// Format up our ripped file label
CFileItem destItem(*item);
View
2 xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
@@ -98,7 +98,7 @@ bool CExternalPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &opti
try
{
m_bIsPlaying = true;
- m_launchFilename = file.m_strPath;
+ m_launchFilename = file.GetPath();
CLog::Log(LOGNOTICE, "%s: %s", __FUNCTION__, m_launchFilename.c_str());
Create();
View
2 xbmc/cores/dvdplayer/DVDFileInfo.cpp
@@ -330,7 +330,7 @@ bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDem
for (int i = 1; i < files.Size(); i++)
{
int duration = 0;
- if (CDVDFileInfo::GetFileDuration(files[i]->m_strPath, duration))
+ if (CDVDFileInfo::GetFileDuration(files[i]->GetPath(), duration))
p->m_iDuration = p->m_iDuration + duration;
}
}
View
2 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamHTSP.cpp
@@ -248,7 +248,7 @@ bool CDVDInputStreamHTSP::UpdateItem(CFileItem& item)
CHTSPSession::ParseItem(channel, m_tag, m_event, item);
item.SetThumbnailImage(channel.icon);
item.SetCachedVideoThumb();
- return current.m_strPath != item.m_strPath
+ return current.GetPath() != item.GetPath()
|| current.m_strTitle != item.m_strTitle;
}
View
6 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp
@@ -68,9 +68,9 @@ bool CDVDInputStreamStack::Open(const char* path, const std::string& content)
{
TFile file(new CFile());
- if (!file->Open(items[index]->m_strPath, READ_TRUNCATED))
+ if (!file->Open(items[index]->GetPath(), READ_TRUNCATED))
{
- CLog::Log(LOGERROR, "CDVDInputStreamStack::Open - failed to open stack part '%s' - skipping", items[index]->m_strPath.c_str());
+ CLog::Log(LOGERROR, "CDVDInputStreamStack::Open - failed to open stack part '%s' - skipping", items[index]->GetPath().c_str());
continue;
}
TSeg segment;
@@ -79,7 +79,7 @@ bool CDVDInputStreamStack::Open(const char* path, const std::string& content)
if(segment.length <= 0)
{
- CLog::Log(LOGERROR, "CDVDInputStreamStack::Open - failed to get file length for '%s' - skipping", items[index]->m_strPath.c_str());
+ CLog::Log(LOGERROR, "CDVDInputStreamStack::Open - failed to get file length for '%s' - skipping", items[index]->GetPath().c_str());
continue;
}
View
4 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -336,7 +336,7 @@ bool CDVDPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options)
{
try
{
- CLog::Log(LOGNOTICE, "DVDPlayer: Opening: %s", file.m_strPath.c_str());
+ CLog::Log(LOGNOTICE, "DVDPlayer: Opening: %s", file.GetPath().c_str());
// if playing a file close it first
// this has to be changed so we won't have to close it.
@@ -352,7 +352,7 @@ bool CDVDPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options)
m_PlayerOptions = options;
m_item = file;
m_mimetype = file.GetMimeType();
- m_filename = file.m_strPath;
+ m_filename = file.GetPath();
m_ready.Reset();
Create();
View
6 xbmc/cores/paplayer/AudioDecoder.cpp
@@ -85,11 +85,11 @@ bool CAudioDecoder::Create(const CFileItem &file, __int64 seekOffset, unsigned i
filecache = g_guiSettings.GetInt("cacheaudio.lan");
// create our codec
- m_codec=CodecFactory::CreateCodecDemux(file.m_strPath, file.GetMimeType(), filecache * 1024);
+ m_codec=CodecFactory::CreateCodecDemux(file.GetPath(), file.GetMimeType(), filecache * 1024);
- if (!m_codec || !m_codec->Init(file.m_strPath, filecache * 1024))
+ if (!m_codec || !m_codec->Init(file.GetPath(), filecache * 1024))
{