From: <ex...@us...> - 2012-05-21 17:50:03
|
Revision: 31110 http://xbmc4xbox.svn.sourceforge.net/xbmc4xbox/?rev=31110&view=rev Author: exobuzz Date: 2012-05-21 17:49:52 +0000 (Mon, 21 May 2012) Log Message: ----------- changed: switch CFileItem::m_strPath to private, and add GetPath/SetPath for access - based on upstream 6d27f0fc Modified Paths: -------------- trunk/guilib/GUIBaseContainer.cpp trunk/guilib/GUIMultiImage.cpp trunk/xbmc/Application.cpp trunk/xbmc/ApplicationMessenger.cpp trunk/xbmc/Autorun.cpp trunk/xbmc/BackgroundInfoLoader.cpp trunk/xbmc/Favourites.cpp trunk/xbmc/FileItem.cpp trunk/xbmc/FileItem.h trunk/xbmc/FileSystem/CDDADirectory.cpp trunk/xbmc/FileSystem/DAAPDirectory.cpp trunk/xbmc/FileSystem/DAVDirectory.cpp trunk/xbmc/FileSystem/Directory.cpp trunk/xbmc/FileSystem/FTPDirectory.cpp trunk/xbmc/FileSystem/FactoryFileDirectory.cpp trunk/xbmc/FileSystem/HDDirectory.cpp trunk/xbmc/FileSystem/HDHomeRun.cpp trunk/xbmc/FileSystem/HTSPDirectory.cpp trunk/xbmc/FileSystem/HTSPSession.cpp trunk/xbmc/FileSystem/HTTPDirectory.cpp trunk/xbmc/FileSystem/ISO9660Directory.cpp trunk/xbmc/FileSystem/LastFMDirectory.cpp trunk/xbmc/FileSystem/MemUnitDirectory.cpp trunk/xbmc/FileSystem/MemoryUnits/Fat32FileSystem.cpp trunk/xbmc/FileSystem/MemoryUnits/FatXFileSystem.cpp trunk/xbmc/FileSystem/MultiPathDirectory.cpp trunk/xbmc/FileSystem/MusicDatabaseDirectory/DirectoryNode.cpp trunk/xbmc/FileSystem/MusicDatabaseDirectory/DirectoryNodeOverview.cpp trunk/xbmc/FileSystem/MusicDatabaseDirectory/DirectoryNodeTop100.cpp trunk/xbmc/FileSystem/MusicDatabaseDirectory.cpp trunk/xbmc/FileSystem/MusicFileDirectory.cpp trunk/xbmc/FileSystem/MusicSearchDirectory.cpp trunk/xbmc/FileSystem/MythSession.cpp trunk/xbmc/FileSystem/PluginDirectory.cpp trunk/xbmc/FileSystem/RTVDirectory.cpp trunk/xbmc/FileSystem/RarDirectory.cpp trunk/xbmc/FileSystem/RarManager.cpp trunk/xbmc/FileSystem/SMBDirectory.cpp trunk/xbmc/FileSystem/SmartPlaylistDirectory.cpp trunk/xbmc/FileSystem/SndtrkDirectory.cpp trunk/xbmc/FileSystem/SpecialProtocolDirectory.cpp trunk/xbmc/FileSystem/StackDirectory.cpp trunk/xbmc/FileSystem/UPnPDirectory.cpp trunk/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNode.cpp trunk/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeMoviesOverview.cpp trunk/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeMusicVideosOverview.cpp trunk/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeSeasons.cpp trunk/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeTvShowsOverview.cpp trunk/xbmc/FileSystem/VideoDatabaseDirectory.cpp trunk/xbmc/FileSystem/VirtualDirectory.cpp trunk/xbmc/FileSystem/XBMSDirectory.cpp trunk/xbmc/FileSystem/ZipDirectory.cpp trunk/xbmc/GUIDialogAudioSubtitleSettings.cpp trunk/xbmc/GUIDialogContentSettings.cpp trunk/xbmc/GUIDialogContextMenu.cpp trunk/xbmc/GUIDialogFavourites.cpp trunk/xbmc/GUIDialogFileBrowser.cpp trunk/xbmc/GUIDialogFileBrowser.h trunk/xbmc/GUIDialogMediaSource.cpp trunk/xbmc/GUIDialogPictureInfo.cpp trunk/xbmc/GUIDialogProfileSettings.cpp trunk/xbmc/GUIDialogSongInfo.cpp trunk/xbmc/GUIMediaWindow.cpp trunk/xbmc/GUIMediaWindow.h trunk/xbmc/GUIViewControl.cpp trunk/xbmc/GUIViewState.cpp trunk/xbmc/GUIViewStateGameSaves.cpp trunk/xbmc/GUIViewStateMusic.cpp trunk/xbmc/GUIViewStatePictures.cpp trunk/xbmc/GUIViewStatePrograms.cpp trunk/xbmc/GUIViewStateScripts.cpp trunk/xbmc/GUIViewStateVideo.cpp trunk/xbmc/GUIWindowFileManager.cpp trunk/xbmc/GUIWindowGameSaves.cpp trunk/xbmc/GUIWindowMusicBase.cpp trunk/xbmc/GUIWindowMusicNav.cpp trunk/xbmc/GUIWindowMusicPlaylist.cpp trunk/xbmc/GUIWindowMusicPlaylistEditor.cpp trunk/xbmc/GUIWindowMusicSongs.cpp trunk/xbmc/GUIWindowMusicTop100.cpp trunk/xbmc/GUIWindowPictures.cpp trunk/xbmc/GUIWindowPrograms.cpp trunk/xbmc/GUIWindowScripts.cpp trunk/xbmc/GUIWindowSettingsCategory.cpp trunk/xbmc/GUIWindowSettingsProfile.cpp trunk/xbmc/GUIWindowSlideShow.cpp trunk/xbmc/GUIWindowVideoBase.cpp trunk/xbmc/GUIWindowVideoFiles.cpp trunk/xbmc/GUIWindowVideoInfo.cpp trunk/xbmc/GUIWindowVideoNav.cpp trunk/xbmc/GUIWindowVideoPlaylist.cpp trunk/xbmc/LastFmManager.cpp trunk/xbmc/MusicDatabase.cpp trunk/xbmc/MusicInfoLoader.cpp trunk/xbmc/MusicInfoScanner.cpp trunk/xbmc/NfoFile.cpp trunk/xbmc/PartyModeManager.cpp trunk/xbmc/PictureInfoLoader.cpp trunk/xbmc/PictureThumbLoader.cpp trunk/xbmc/PlayList.cpp trunk/xbmc/PlayListB4S.cpp trunk/xbmc/PlayListFactory.cpp trunk/xbmc/PlayListM3U.cpp trunk/xbmc/PlayListPLS.cpp trunk/xbmc/PlayListPlayer.cpp trunk/xbmc/PlayListWPL.cpp trunk/xbmc/PlayListXML.cpp trunk/xbmc/PlaylistDirectory.cpp trunk/xbmc/ProgramDatabase.cpp trunk/xbmc/Settings.cpp trunk/xbmc/SortFileItem.cpp trunk/xbmc/UPnP.cpp trunk/xbmc/URL.cpp trunk/xbmc/Util.cpp trunk/xbmc/VideoDatabase.cpp trunk/xbmc/VideoInfoScanner.cpp trunk/xbmc/cdrip/CDDARipper.cpp trunk/xbmc/cores/ModPlayer.cpp trunk/xbmc/cores/dvdplayer/DVDFileInfo.cpp trunk/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp trunk/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamHTSP.cpp trunk/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp trunk/xbmc/cores/dvdplayer/DVDPlayer.cpp trunk/xbmc/cores/mplayer/mplayer.cpp trunk/xbmc/cores/paplayer/AudioDecoder.cpp trunk/xbmc/cores/paplayer/PAPlayer_win32.cpp trunk/xbmc/cores/paplayer/PAPlayer_xbox.cpp trunk/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp trunk/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp trunk/xbmc/lib/libGoAhead/XBMChttp.cpp trunk/xbmc/lib/libGoAhead/XBMCweb.cpp trunk/xbmc/lib/libPython/XBPyThread.cpp trunk/xbmc/lib/libPython/xbmcmodule/listitem.cpp trunk/xbmc/lib/libPython/xbmcmodule/player.cpp trunk/xbmc/lib/libPython/xbmcmodule/pyplaylist.cpp trunk/xbmc/lib/libPython/xbmcmodule/xbmcplugin.cpp trunk/xbmc/utils/GUIInfoManager.cpp trunk/xbmc/utils/LabelFormatter.cpp trunk/xbmc/utils/RssFeed.cpp trunk/xbmc/utils/ScraperParser.cpp trunk/xbmc/utils/TuxBoxUtil.cpp trunk/xbmc/utils/URIUtils.cpp Modified: trunk/guilib/GUIBaseContainer.cpp =================================================================== --- trunk/guilib/GUIBaseContainer.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/guilib/GUIBaseContainer.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -611,7 +611,7 @@ int controlID = GetID(); // save as these could go away as we send messages int parentID = GetParentID(); vector<CStdString> actions; - StringUtils::SplitString(item->m_strPath, " , ", actions); + StringUtils::SplitString(item->GetPath(), " , ", actions); for (unsigned int i = 0; i < actions.size(); i++) { CStdString action = actions[i]; @@ -943,7 +943,7 @@ TiXmlNode *click = item->FirstChild("onclick"); if (click && click->FirstChild()) { - CStdString label, label2, thumb, icon; + CStdString label, label2, thumb, icon, path; XMLUtils::GetString(item, "label", label); label = CGUIControlFactory::FilterLabel(label); XMLUtils::GetString(item, "label2", label2); label2 = CGUIControlFactory::FilterLabel(label2); XMLUtils::GetString(item, "thumb", thumb); thumb = CGUIControlFactory::FilterLabel(thumb); @@ -957,7 +957,8 @@ CGUIControlFactory::GetMultipleString(item, "onclick", actions); for (vector<CStdString>::iterator it = actions.begin(); it != actions.end(); ++it) (*it).Replace(",", ",,"); - StringUtils::JoinString(actions, " , ", newItem->m_strPath); + StringUtils::JoinString(actions, " , ", path); + newItem->SetPath(path); newItem->SetLabel2(CGUIInfoLabel::GetLabel(label2, GetParentID())); newItem->SetThumbnailImage(CGUIInfoLabel::GetLabel(thumb, GetParentID(), true)); newItem->SetIconImage(CGUIInfoLabel::GetLabel(icon, GetParentID(), true)); @@ -977,7 +978,7 @@ icon = item->Attribute("icon"); icon = CGUIControlFactory::FilterLabel(icon); const char *id = item->Attribute("id"); newItem.reset(new CFileItem(CGUIInfoLabel::GetLabel(label, GetParentID()))); - newItem->m_strPath = item->FirstChild()->Value(); + newItem->SetPath(item->FirstChild()->Value()); newItem->SetLabel2(CGUIInfoLabel::GetLabel(label2, GetParentID())); newItem->SetThumbnailImage(CGUIInfoLabel::GetLabel(thumb, GetParentID(), true)); newItem->SetIconImage(CGUIInfoLabel::GetLabel(icon, GetParentID(), true)); Modified: trunk/guilib/GUIMultiImage.cpp =================================================================== --- trunk/guilib/GUIMultiImage.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/guilib/GUIMultiImage.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -219,7 +219,7 @@ { CFileItemPtr pItem = items[i]; if (pItem->IsPicture()) - m_files.push_back(pItem->m_strPath); + m_files.push_back(pItem->GetPath()); } } Modified: trunk/xbmc/Application.cpp =================================================================== --- trunk/xbmc/Application.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/Application.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -757,7 +757,7 @@ 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_vecProfiles[0].setDirectory("special://masterprofile/"); g_stSettings.m_logFolder = "special://masterprofile/"; @@ -2547,7 +2547,7 @@ 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) @@ -3595,11 +3595,11 @@ { 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); @@ -3609,13 +3609,13 @@ { //is or could be a playlist auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(item)); - if (pPlayList.get() && pPlayList->Load(item.m_strPath)) + if (pPlayList.get() && pPlayList->Load(item.GetPath())) { 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); } @@ -3648,15 +3648,15 @@ CVideoDatabase dbs; if (dbs.Open()) { - dbs.GetVideoSettings(item.m_strPath, g_stSettings.m_currentVideoSettings); - haveTimes = dbs.GetStackTimes(item.m_strPath, times); + dbs.GetVideoSettings(item.GetPath(), g_stSettings.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++) { @@ -3665,7 +3665,7 @@ 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; @@ -3683,13 +3683,13 @@ 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; @@ -3748,15 +3748,15 @@ 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; } @@ -3770,7 +3770,7 @@ //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(); @@ -3820,13 +3820,13 @@ // open the d/b and retrieve the bookmarks for the current movie CVideoDatabase dbs; dbs.Open(); - dbs.GetVideoSettings(item.m_strPath, g_stSettings.m_currentVideoSettings); + dbs.GetVideoSettings(item.GetPath(), g_stSettings.m_currentVideoSettings); if( item.m_lStartOffset == STARTOFFSET_RESUME ) { options.starttime = 0.0f; CBookmark bookmark; - if(dbs.GetResumeBookMark(item.m_strPath, bookmark)) + if(dbs.GetResumeBookMark(item.GetPath(), bookmark)) { options.starttime = bookmark.timeInSeconds; options.state = bookmark.playerState; @@ -3917,7 +3917,7 @@ } 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; } @@ -4199,7 +4199,7 @@ void CApplication::SaveFileState() { - CStdString progressTrackingFile = m_progressTrackingItem->m_strPath; + CStdString progressTrackingFile = m_progressTrackingItem->GetPath(); if (progressTrackingFile != "") { @@ -4255,7 +4255,7 @@ CUtil::DeleteVideoDatabaseDirectoryCache(); // CFileItemPtr msgItem(new CFileItem(*m_progressTrackingItem)); // if (m_progressTrackingItem->HasProperty("original_listitem_url")) -// msgItem->m_strPath = m_progressTrackingItem->GetProperty("original_listitem_url"); +// msgItem->SetPath(m_progressTrackingItem->GetProperty("original_listitem_url")); CGUIMessage message(GUI_MSG_NOTIFY_ALL, g_windowManager.GetActiveWindow(), 0, GUI_MSG_UPDATE, 0); // CGUIMessage message(GUI_MSG_NOTIFY_ALL, g_windowManager.GetActiveWindow(), 0, GUI_MSG_UPDATE_ITEM, 1, msgItem); // 1 to update the listing as well g_windowManager.SendThreadMessage(message); @@ -4291,7 +4291,7 @@ 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(); @@ -4302,7 +4302,7 @@ { if (IsPlayingVideo() || IsPlayingAudio()) { - if (m_progressTrackingItem->m_strPath == "") + if (m_progressTrackingItem->GetPath() == "") { // Init some stuff *m_progressTrackingItem = CurrentFileItem(); @@ -4847,14 +4847,14 @@ { 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_pCdgParser->Start(m_itemCurrentFile->GetMusicInfoTag()->GetURL()); } else - m_pCdgParser->Start(m_itemCurrentFile->m_strPath); + m_pCdgParser->Start(m_itemCurrentFile->GetPath()); } #endif // Let scrobbler know about the track @@ -5015,7 +5015,7 @@ { // a python script unsigned int argc = 1; char ** argv = new char*[argc]; - argv[0] = (char*)item.m_strPath.c_str(); + argv[0] = (char*)item.GetPath().c_str(); g_pythonParser.evalFile(argv[0], argc, (const char**)argv); delete [] argv; } @@ -5025,14 +5025,14 @@ if (g_guiSettings.GetBool("myprograms.gameautoregion")) { CXBE xbe; - iRegion = xbe.ExtractGameRegion(item.m_strPath); + iRegion = xbe.ExtractGameRegion(item.GetPath()); if (iRegion < 1 || iRegion > 7) iRegion = 0; iRegion = xbe.FilterRegion(iRegion); } else iRegion = 0; - CUtil::RunXBE(item.m_strPath.c_str(),NULL,F_VIDEO(iRegion)); + CUtil::RunXBE(item.GetPath().c_str(),NULL,F_VIDEO(iRegion)); } else if (item.IsAudio() || item.IsVideo()) { // an audio or video file @@ -5257,7 +5257,7 @@ const CStdString& CApplication::CurrentFile() { - return m_itemCurrentFile->m_strPath; + return m_itemCurrentFile->GetPath(); } CFileItem& CApplication::CurrentFileItem() @@ -5722,7 +5722,7 @@ { CVideoDatabase dbs; dbs.Open(); - dbs.SetVideoSettings(m_itemCurrentFile->m_strPath, g_stSettings.m_currentVideoSettings); + dbs.SetVideoSettings(m_itemCurrentFile->GetPath(), g_stSettings.m_currentVideoSettings); dbs.Close(); } } Modified: trunk/xbmc/ApplicationMessenger.cpp =================================================================== --- trunk/xbmc/ApplicationMessenger.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/ApplicationMessenger.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -308,7 +308,7 @@ } else { - item.m_strPath = pMsg->strParam; + item.SetPath(pMsg->strParam); item.m_bIsFolder = false; if (item.IsAudio()) item.SetMusicThumb(); @@ -359,7 +359,7 @@ { pSlideShow->Add(items[i].get()); } - pSlideShow->Select(items[0]->m_strPath); + pSlideShow->Select(items[0]->GetPath()); } } else Modified: trunk/xbmc/Autorun.cpp =================================================================== --- trunk/xbmc/Autorun.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/Autorun.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -215,20 +215,20 @@ { CFileItemPtr pItem = vecItems[i]; - if (pItem->m_bIsFolder && pItem->m_strPath != "." && pItem->m_strPath != "..") + if (pItem->m_bIsFolder && pItem->GetPath() != "." && pItem->GetPath() != "..") { - if (pItem->m_strPath.Find( "VIDEO_TS" ) != -1 && bAllowVideo + if (pItem->GetPath().Find( "VIDEO_TS" ) != -1 && bAllowVideo && (bypassSettings || g_guiSettings.GetBool("autorun.dvd"))) { CUtil::PlayDVD(); bPlaying = true; return true; } - else if (pItem->m_strPath.Find("MPEGAV") != -1 && bAllowVideo + else if (pItem->GetPath().Find("MPEGAV") != -1 && bAllowVideo && (bypassSettings || g_guiSettings.GetBool("autorun.vcd"))) { CFileItemList items; - CDirectory::GetDirectory(pItem->m_strPath, items, ".dat"); + CDirectory::GetDirectory(pItem->GetPath(), items, ".dat"); if (items.Size()) { items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); @@ -240,11 +240,11 @@ return true; } } - else if (pItem->m_strPath.Find("MPEG2") != -1 && bAllowVideo + else if (pItem->GetPath().Find("MPEG2") != -1 && bAllowVideo && (bypassSettings || g_guiSettings.GetBool("autorun.vcd"))) { CFileItemList items; - CDirectory::GetDirectory(pItem->m_strPath, items, ".mpg"); + CDirectory::GetDirectory(pItem->GetPath(), items, ".mpg"); if (items.Size()) { items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); @@ -256,12 +256,12 @@ return true; } } - else if (pItem->m_strPath.Find("PICTURES") != -1 && bAllowPictures + else if (pItem->GetPath().Find("PICTURES") != -1 && bAllowPictures && (bypassSettings || g_guiSettings.GetBool("autorun.pictures"))) { bPlaying = true; CStdString strExec; - strExec.Format("XBMC.RecursiveSlideShow(%s)", pItem->m_strPath.c_str()); + strExec.Format("XBMC.RecursiveSlideShow(%s)", pItem->GetPath().c_str()); CUtil::ExecBuiltIn(strExec); return true; } @@ -290,7 +290,7 @@ // 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 @@ -352,9 +352,9 @@ 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)) + if (RunDisc(pDir, pItem->GetPath(), nAddedToPlaylist, false, bypassSettings)) { bPlaying = true; break; Modified: trunk/xbmc/BackgroundInfoLoader.cpp =================================================================== --- trunk/xbmc/BackgroundInfoLoader.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/BackgroundInfoLoader.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -94,7 +94,7 @@ } 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()); } } } Modified: trunk/xbmc/Favourites.cpp =================================================================== --- trunk/xbmc/Favourites.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/Favourites.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -78,7 +78,7 @@ 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); } @@ -103,7 +103,7 @@ 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); } @@ -131,9 +131,9 @@ { // 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); } @@ -162,19 +162,19 @@ CStdString execute; if (item->m_bIsFolder && (g_advancedSettings.m_playlistAsFolders || !(item->IsSmartPlayList() || item->IsPlayList()))) - execute.Format("ActivateWindow(%i,%s)", contextWindow, Paramify(item->m_strPath)); - else if (item->m_strPath.Left(9).Equals("plugin://")) - execute.Format("RunPlugin(%s)", Paramify(item->m_strPath)); + execute.Format("ActivateWindow(%i,%s)", contextWindow, Paramify(item->GetPath())); + else if (item->GetPath().Left(9).Equals("plugin://")) + execute.Format("RunPlugin(%s)", Paramify(item->GetPath())); else if (contextWindow == WINDOW_SCRIPTS) - execute.Format("RunScript(%s)", item->m_strPath); + execute.Format("RunScript(%s)", item->GetPath()); 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; } Modified: trunk/xbmc/FileItem.cpp =================================================================== --- trunk/xbmc/FileItem.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileItem.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -245,7 +245,7 @@ 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; @@ -1095,7 +1095,7 @@ 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); @@ -1121,7 +1121,7 @@ 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; } @@ -1141,11 +1141,9 @@ 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; @@ -1187,7 +1185,8 @@ 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)); } } @@ -1201,14 +1200,15 @@ CSingleLock lock(m_lock); // checks case insensitive - CStdString checkPath(fileName); checkPath.ToLower(); + CStdString checkPath(fileName); + checkPath.ToLower(); if (m_fastLookup) return m_map.find(checkPath) != m_map.end(); // slow method... 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; @@ -1248,7 +1248,8 @@ m_items.push_back(pItem); if (m_fastLookup) { - CStdString path(pItem->m_strPath); path.ToLower(); + CStdString path(pItem->GetPath()); + path.ToLower(); m_map.insert(MAPFILEITEMSPAIR(path, pItem)); } } @@ -1267,7 +1268,8 @@ } if (m_fastLookup) { - CStdString path(pItem->m_strPath); path.ToLower(); + CStdString path(pItem->GetPath()); + path.ToLower(); m_map.insert(MAPFILEITEMSPAIR(path, pItem)); } } @@ -1283,7 +1285,8 @@ 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; @@ -1300,7 +1303,8 @@ 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); @@ -1321,7 +1325,7 @@ 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; @@ -1377,7 +1381,8 @@ { CSingleLock lock(m_lock); - CStdString pathToCheck(strPath); pathToCheck.ToLower(); + CStdString pathToCheck(strPath); + pathToCheck.ToLower(); if (m_fastLookup) { IMAPFILEITEMS it=m_map.find(pathToCheck); @@ -1390,7 +1395,7 @@ 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; } @@ -1401,7 +1406,8 @@ { CSingleLock lock(m_lock); - CStdString pathToCheck(strPath); pathToCheck.ToLower(); + CStdString pathToCheck(strPath); + pathToCheck.ToLower(); if (m_fastLookup) { map<CStdString, CFileItemPtr>::const_iterator it=m_map.find(pathToCheck); @@ -1414,7 +1420,7 @@ 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; } @@ -1781,7 +1787,7 @@ if (pItem->IsCUESheet()) { CCueDocument cuesheet; - if (cuesheet.Parse(pItem->m_strPath)) + if (cuesheet.Parse(pItem->GetPath())) { VECSONGS newitems; cuesheet.GetSongs(newitems); @@ -1807,7 +1813,7 @@ 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)) @@ -1820,7 +1826,7 @@ StringUtils::SplitString(g_stSettings.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)) { @@ -1833,7 +1839,7 @@ } 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; @@ -1874,13 +1880,13 @@ } 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()); } } } @@ -1891,7 +1897,7 @@ 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; @@ -1939,13 +1945,13 @@ // only check known fast sources? // xbms included because it supports file existance // NOTES: - // 1. xbms would not have worked previously: item->m_strPath.Left(5).Equals("xbms", false) + // 1. xbms would not have worked previously: item->GetPath().Left(5).Equals("xbms", false) // 2. rars and zips may be on slow sources? is this supposed to be allowed? if( !item->IsRemote() || item->IsSmb() || item->IsXBMS() - || 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 @@ -1954,7 +1960,7 @@ if (folderName.Left(2).Equals("CD") && StringUtils::IsNaturalNumber(folderName.Mid(2))) { CFileItemList items; - CDirectory::GetDirectory(item->m_strPath,items,g_stSettings.m_videoExtensions,true); + CDirectory::GetDirectory(item->GetPath(),items,g_stSettings.m_videoExtensions,true); // optimized to only traverse listing once by checking for filecount // and recording last file item for later use int nFiles = 0; @@ -1980,12 +1986,12 @@ { 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)) @@ -2000,7 +2006,7 @@ 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 */ @@ -2065,7 +2071,7 @@ 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()) { @@ -2095,7 +2101,7 @@ } CStdString file2, filePath2; - URIUtils::Split(item2->m_strPath, filePath2, file2); + URIUtils::Split(item2->GetPath(), filePath2, file2); if (expr->RegFind(file2, offset) != -1) { @@ -2168,13 +2174,13 @@ // 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); @@ -2198,10 +2204,10 @@ 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; @@ -2216,7 +2222,7 @@ 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 @@ -2237,14 +2243,14 @@ 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; @@ -2268,9 +2274,9 @@ { // 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; } @@ -3094,7 +3100,7 @@ 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; Modified: trunk/xbmc/FileItem.h =================================================================== --- trunk/xbmc/FileItem.h 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileItem.h 2012-05-21 17:49:52 UTC (rev 31110) @@ -77,6 +77,9 @@ 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 Serialize(CArchive& ar); @@ -266,7 +269,6 @@ 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 @@ -281,7 +283,9 @@ 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; Modified: trunk/xbmc/FileSystem/CDDADirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/CDDADirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/CDDADirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -73,10 +73,12 @@ CFileItemPtr pItem(new CFileItem(strLabel)); pItem->m_bIsFolder = false; - pItem->m_strPath.Format("cdda://local/%02.2i.cdda", i); + CStdString path; + path.Format("cdda://local/%02.2i.cdda", i); + pItem->SetPath(path); __stat64 s64; - if (CFile::Stat(pItem->m_strPath, &s64) == 0) + if (CFile::Stat(pItem->GetPath(), &s64) == 0) pItem->m_dwSize = s64.st_size; items.Add(pItem); Modified: trunk/xbmc/FileSystem/DAAPDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/DAAPDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/DAAPDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -114,7 +114,7 @@ // Add item to directory list CLog::Log(LOGDEBUG, "DAAPDirectory: Adding item %s", strFile.c_str()); CFileItemPtr pItem(new CFileItem(strFile)); - pItem->m_strPath = strRoot + m_thisHost->dbplaylists->playlists[c].itemname + "/"; + pItem->SetPath(strRoot + m_thisHost->dbplaylists->playlists[c].itemname + "/"); pItem->m_bIsFolder = true; items.Add(pItem); } @@ -149,7 +149,7 @@ strBuffer = cur->artist; CLog::Log(LOGDEBUG, "DAAPDirectory: Adding item %s", strBuffer.c_str()); CFileItemPtr pItem(new CFileItem(strBuffer)); - pItem->m_strPath = strRoot + cur->artist + "/"; + pItem->SetPath(strRoot + cur->artist + "/"); pItem->m_bIsFolder = true; items.Add(pItem); cur = cur->next; @@ -181,10 +181,10 @@ CLog::Log(LOGDEBUG, "DAAPDirectory: Adding item %s", m_currentSongItems[idx].itemname); CFileItemPtr pItem(new CFileItem(m_currentSongItems[idx].itemname)); - + CStdString path; if( m_thisHost->version_major != 3 ) { - pItem->m_strPath.Format(REQUEST42, + path.Format(REQUEST42, m_thisHost->host, g_DaapClient.m_iDatabase, m_currentSongItems[idx].id, @@ -195,7 +195,7 @@ } else { - pItem->m_strPath.Format(REQUEST45, + path.Format(REQUEST45, m_thisHost->host, g_DaapClient.m_iDatabase, m_currentSongItems[idx].id, @@ -203,10 +203,11 @@ m_thisHost->sessionid); } + pItem->SetPath(path); pItem->m_bIsFolder = false; pItem->m_dwSize = m_currentSongItems[idx].songsize; - pItem->GetMusicInfoTag()->SetURL(pItem->m_strPath); + pItem->GetMusicInfoTag()->SetURL(pItem->GetPath()); pItem->GetMusicInfoTag()->SetTitle(m_currentSongItems[idx].itemname); pItem->GetMusicInfoTag()->SetArtist(m_currentSongItems[idx].songartist); pItem->GetMusicInfoTag()->SetAlbum(m_currentSongItems[idx].songalbum); @@ -243,7 +244,7 @@ CLog::Log(LOGDEBUG, "DAAPDirectory: Adding item %s", curAlbum->album); CFileItemPtr pItem(new CFileItem(curAlbum->album)); - pItem->m_strPath = strRoot + curAlbum->album + "/"; + pItem->SetPath(strRoot + curAlbum->album + "/"); pItem->m_bIsFolder = true; items.Add(pItem); curAlbum = curAlbum->next; @@ -268,9 +269,10 @@ CLog::Log(LOGDEBUG, "DAAPDirectory: Adding item %s", m_currentSongItems[c].itemname); CFileItemPtr pItem(new CFileItem(m_currentSongItems[c].itemname)); + CStdString path; if( m_thisHost->version_major != 3 ) { - pItem->m_strPath.Format(REQUEST42, + path.Format(REQUEST42, m_thisHost->host, g_DaapClient.m_iDatabase, m_currentSongItems[c].id, @@ -281,7 +283,7 @@ } else { - pItem->m_strPath.Format(REQUEST45, + path.Format(REQUEST45, m_thisHost->host, g_DaapClient.m_iDatabase, m_currentSongItems[c].id, @@ -289,10 +291,11 @@ m_thisHost->sessionid); } + pItem->SetPath(path); pItem->m_bIsFolder = false; pItem->m_dwSize = m_currentSongItems[c].songsize; - pItem->GetMusicInfoTag()->SetURL(pItem->m_strPath); + pItem->GetMusicInfoTag()->SetURL(pItem->GetPath()); pItem->GetMusicInfoTag()->SetTitle(m_currentSongItems[c].itemname); pItem->GetMusicInfoTag()->SetArtist(m_selectedArtist); Modified: trunk/xbmc/FileSystem/DAVDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/DAVDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/DAVDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -113,8 +113,9 @@ { if (ValueWithoutNamespace(pResponseChild, "href")) { - item.m_strPath = pResponseChild->ToElement()->GetText(); - URIUtils::RemoveSlashAtEnd(item.m_strPath); + CStdString path(pResponseChild->ToElement()->GetText()); + URIUtils::RemoveSlashAtEnd(path); + item.SetPath(path); } else if (ValueWithoutNamespace(pResponseChild, "propstat")) @@ -236,26 +237,27 @@ CFileItem item; ParseResponse(pChild->ToElement(), item); CURL url2(strPath); - CURL url3(item.m_strPath); + CURL url3(item.GetPath()); - URIUtils::AddFileToFolder(url2.GetWithoutFilename(), url3.GetFileName(), item.m_strPath); + CStdString itemPath(URIUtils::AddFileToFolder(url2.GetWithoutFilename(), url3.GetFileName())); if (item.GetLabel().IsEmpty()) { - CStdString name(item.m_strPath); + CStdString name(itemPath); URIUtils::RemoveSlashAtEnd(name); CURL::Decode(name); item.SetLabel(URIUtils::GetFileName(name)); } if (item.m_bIsFolder) - URIUtils::AddSlashAtEnd(item.m_strPath); + URIUtils::AddSlashAtEnd(itemPath); // Add back protocol options if (!url2.GetProtocolOptions().IsEmpty()) - item.m_strPath += "|" + url2.GetProtocolOptions(); + itemPath += "|" + url2.GetProtocolOptions(); + item.SetPath(itemPath); - if (!item.m_strPath.Equals(strPath)) + if (!item.GetPath().Equals(strPath)) { CFileItemPtr pItem(new CFileItem(item)); items.Add(pItem); Modified: trunk/xbmc/FileSystem/Directory.cpp =================================================================== --- trunk/xbmc/FileSystem/Directory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/Directory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -49,7 +49,7 @@ // check our cache for this path if (g_directoryCache.GetDirectory(strPath, items, cacheDirectory == DIR_CACHE_ALWAYS)) - items.m_strPath = strPath; + items.SetPath(strPath); else { // need to clear the cache (in case the directory fetch fails) @@ -62,7 +62,7 @@ pDirectory->SetUseFileDirectories(bUseFileDirectories); pDirectory->SetExtFileInfo(extFileInfo); - items.m_strPath = strPath; + items.SetPath(strPath); if (!pDirectory->GetDirectory(strPath, items)) { @@ -80,7 +80,7 @@ for (int i = 0; i < items.Size(); ++i) { CFileItemPtr item = items[i]; - if ((!item->m_bIsFolder && !pDirectory->IsAllowed(item->m_strPath)) || + if ((!item->m_bIsFolder && !pDirectory->IsAllowed(item->GetPath())) || (item->GetPropertyBOOL("file:hidden") && !g_guiSettings.GetBool("filelists.showhidden"))) { items.Remove(i); @@ -184,7 +184,7 @@ CFileItemPtr pItem=items[i]; if ((!pItem->m_bIsFolder) && (!pItem->IsInternetStream())) { - auto_ptr<IFileDirectory> pDirectory(CFactoryFileDirectory::Create(pItem->m_strPath,pItem.get(),mask)); + auto_ptr<IFileDirectory> pDirectory(CFactoryFileDirectory::Create(pItem->GetPath(),pItem.get(),mask)); if (pDirectory.get()) pItem->m_bIsFolder = true; else Modified: trunk/xbmc/FileSystem/FTPDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/FTPDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/FTPDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -78,14 +78,14 @@ CFileItemPtr pItem(new CFileItem(name)); - pItem->m_strPath = path + name; + CStdString filePath = path + name; pItem->m_bIsFolder = (bool)(lp.flagtrycwd != 0); if (pItem->m_bIsFolder) - URIUtils::AddSlashAtEnd(pItem->m_strPath); + URIUtils::AddSlashAtEnd(filePath); /* qualify the url with host and all */ - url.SetFileName(pItem->m_strPath); - pItem->m_strPath = url.Get(); + url.SetFileName(filePath); + pItem->SetPath(url.Get()); pItem->m_dwSize = lp.size; pItem->m_dateTime=lp.mtime; Modified: trunk/xbmc/FileSystem/FactoryFileDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/FactoryFileDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/FactoryFileDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -112,7 +112,7 @@ if (!g_guiSettings.GetBool("filelists.unrollarchives")) { - pItem->m_strPath = strUrl; + pItem->SetPath(strUrl); return new CZipDirectory; } @@ -127,7 +127,7 @@ } else { // compressed or more than one file -> create a zip dir - pItem->m_strPath = strUrl; + pItem->SetPath(strUrl); return new CZipDirectory; } return NULL; @@ -167,7 +167,7 @@ if (!g_guiSettings.GetBool("filelists.unrollarchives")) { - pItem->m_strPath = strUrl; + pItem->SetPath(strUrl); return new CRarDirectory; } @@ -182,7 +182,7 @@ } else { // compressed or more than one file -> create a rar dir - pItem->m_strPath = strUrl; + pItem->SetPath(strUrl); return new CRarDirectory; } return NULL; Modified: trunk/xbmc/FileSystem/HDDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/HDDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/HDDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -87,11 +87,11 @@ CStdString strLabel=wfd.cFileName; g_charsetConverter.unknownToUTF8(strLabel); CFileItemPtr pItem(new CFileItem(strLabel)); - pItem->m_strPath = strRoot; - pItem->m_strPath += wfd.cFileName; - g_charsetConverter.unknownToUTF8(pItem->m_strPath); + CStdString itemPath = strRoot + wfd.cFileName; + g_charsetConverter.unknownToUTF8(itemPath); pItem->m_bIsFolder = true; - URIUtils::AddSlashAtEnd(pItem->m_strPath); + URIUtils::AddSlashAtEnd(itemPath); + pItem->SetPath(itemPath); FileTimeToLocalFileTime(&wfd.ftLastWriteTime, &localTime); pItem->m_dateTime=localTime; @@ -103,10 +103,9 @@ CStdString strLabel=wfd.cFileName; g_charsetConverter.unknownToUTF8(strLabel); CFileItemPtr pItem(new CFileItem(strLabel)); - pItem->m_strPath = strRoot; - pItem->m_strPath += wfd.cFileName; - g_charsetConverter.unknownToUTF8(pItem->m_strPath); - + CStdString itemPath = strRoot + wfd.cFileName; + g_charsetConverter.unknownToUTF8(itemPath); + pItem->SetPath(itemPath); pItem->m_bIsFolder = false; pItem->m_dwSize = CUtil::ToInt64(wfd.nFileSizeHigh, wfd.nFileSizeLow); FileTimeToLocalFileTime(&wfd.ftLastWriteTime, &localTime); Modified: trunk/xbmc/FileSystem/HDHomeRun.cpp =================================================================== --- trunk/xbmc/FileSystem/HDHomeRun.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/HDHomeRun.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -135,8 +135,9 @@ else label.Format("Current Stream: Channel %s, SNR %d", status.channel, status.signal_to_noise_quality); - CFileItemPtr item(new CFileItem("hdhomerun://" + url.GetHostName() + "/" + url.GetFileName(), false)); - URIUtils::RemoveSlashAtEnd(item->m_strPath); + CStdString path = "hdhomerun://" + url.GetHostName() + "/" + url.GetFileName(); + URIUtils::RemoveSlashAtEnd(path); + CFileItemPtr item(new CFileItem(path, false)); item->SetLabel(label); item->SetLabelPreformated(true); items.Add(item); Modified: trunk/xbmc/FileSystem/HTSPDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/HTSPDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/HTSPDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -377,7 +377,7 @@ CFileItemPtr item(new CFileItem("", true)); url.SetFileName(""); - item->m_strPath = url.Get(); + item->SetPath(url.Get()); CHTSPSession::ParseItem(it->second, tag, event, *item); item->m_bIsFolder = false; item->SetLabel(item->m_strTitle); @@ -431,7 +431,7 @@ item.reset(new CFileItem("", true)); url.SetFileName("tags/0/"); - item->m_strPath = url.Get(); + item->SetPath(url.Get()); item->SetLabel(g_localizeStrings.Get(22018)); item->SetLabelPreformated(true); items.Add(item); @@ -445,7 +445,7 @@ item.reset(new CFileItem("", true)); url.SetFileName(filename); - item->m_strPath = url.Get(); + item->SetPath(url.Get()); item->SetLabel(label); item->SetLabelPreformated(true); item->SetThumbnailImage(it->second.icon); Modified: trunk/xbmc/FileSystem/HTSPSession.cpp =================================================================== --- trunk/xbmc/FileSystem/HTSPSession.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/HTSPSession.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -629,7 +629,7 @@ CStdString temp; - CURL url(item.m_strPath); + CURL url(item.GetPath()); temp.Format("tags/%d/%d.ts", tagid, channel.id); url.SetFileName(temp); @@ -646,7 +646,7 @@ if(tag->m_strShowTitle.length() > 0) tag->m_strTitle += " : " + tag->m_strShowTitle; - item.m_strPath = url.Get(); + item.SetPath(url.Get()); item.m_strTitle = tag->m_strTitle; item.SetThumbnailImage(channel.icon); item.SetMimeType("video/X-htsp"); Modified: trunk/xbmc/FileSystem/HTTPDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/HTTPDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/HTTPDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -77,13 +77,13 @@ URIUtils::RemoveSlashAtEnd(strName); CFileItemPtr pItem(new CFileItem(strName)); - pItem->m_strPath = strBasePath + strLink; + pItem->SetPath(strBasePath + strLink); - if(URIUtils::HasSlashAtEnd(pItem->m_strPath)) + if(URIUtils::HasSlashAtEnd(pItem->GetPath())) pItem->m_bIsFolder = true; - url.SetFileName(pItem->m_strPath); - pItem->m_strPath = url.Get(); + url.SetFileName(pItem->GetPath()); + pItem->SetPath(url.Get()); if (!pItem->m_bIsFolder && g_advancedSettings.m_bHTTPDirectoryStatFilesize) { Modified: trunk/xbmc/FileSystem/ISO9660Directory.cpp =================================================================== --- trunk/xbmc/FileSystem/ISO9660Directory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/ISO9660Directory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -82,10 +82,10 @@ if (strDir != "." && strDir != "..") { CFileItemPtr pItem(new CFileItem(wfd.cFileName)); - pItem->m_strPath = strRoot; - pItem->m_strPath += wfd.cFileName; + CStdString path = strRoot + wfd.cFileName; + URIUtils::AddSlashAtEnd(path); + pItem->SetPath(path); pItem->m_bIsFolder = true; - URIUtils::AddSlashAtEnd(pItem->m_strPath); FILETIME localTime; FileTimeToLocalFileTime(&wfd.ftLastWriteTime, &localTime); pItem->m_dateTime=localTime; @@ -95,8 +95,7 @@ else { CFileItemPtr pItem(new CFileItem(wfd.cFileName)); - pItem->m_strPath = strRoot; - pItem->m_strPath += wfd.cFileName; + pItem->SetPath(strRoot + wfd.cFileName); pItem->m_bIsFolder = false; pItem->m_dwSize = CUtil::ToInt64(wfd.nFileSizeHigh, wfd.nFileSizeLow); FILETIME localTime; Modified: trunk/xbmc/FileSystem/LastFMDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/LastFMDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/LastFMDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -123,7 +123,7 @@ CFileItemPtr pItem(new CFileItem); pItem->SetLabel(strLabel); - pItem->m_strPath = strPath; + pItem->SetPath(strPath); pItem->m_bIsFolder = bFolder; pItem->SetLabelPreformated(true); //the extra info is used in the mediawindows to determine which items are needed in the contextmenu @@ -165,7 +165,7 @@ } pItem->SetLabel(strName); - pItem->m_strPath = strPath; + pItem->SetPath(strPath); pItem->m_bIsFolder = true; pItem->SetLabelPreformated(true); Modified: trunk/xbmc/FileSystem/MemUnitDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/MemUnitDirectory.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/MemUnitDirectory.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -51,7 +51,7 @@ for (int i = 0; i < cacheItems.Size(); i++) { CFileItemPtr item = cacheItems[i]; - if (item->m_bIsFolder || IsAllowed(item->m_strPath)) + if (item->m_bIsFolder || IsAllowed(item->GetPath())) items.Add(item); } Modified: trunk/xbmc/FileSystem/MemoryUnits/Fat32FileSystem.cpp =================================================================== --- trunk/xbmc/FileSystem/MemoryUnits/Fat32FileSystem.cpp 2012-05-20 14:49:51 UTC (rev 31109) +++ trunk/xbmc/FileSystem/MemoryUnits/Fat32FileSystem.cpp 2012-05-21 17:49:52 UTC (rev 31110) @@ -119,7 +119,7 @@ { if (items[j]->GetLabel() == folders[i]) { // found :) - shortPath += "/" + items[j]->m_strPath; + shortPath += "/" + items[j]->GetPath(); found = true; isfolder = items[j]->m_bIsFolder; break; @@ -207,10 +207,12 @@ for (int i = 0; i < items.Size(); ++i) { CFileItemPtr it... [truncated message content] |