diff options
author | xhaggi <sascha.woo@gmail.com> | 2014-02-25 19:54:32 +0100 |
---|---|---|
committer | xhaggi <sascha.woo@gmail.com> | 2014-03-03 19:43:09 +0100 |
commit | 3758dd2fe50077b014a9e4913df0bf11d6b1fc1f (patch) | |
tree | f5a1e2e82b101bf0ff98ed47a1012418d1ebc964 | |
parent | f6f539a7c933b37f3efd08cea765f1f0f59a30c5 (diff) |
[pvr] fix: duplicate parent dir item for recordings
The current integration of the parent dir item for recordings results
in a duplicate parent dir item if you add pvr://recordings as
video source. This implements a more safer way for handling the parent
dir item.
-rw-r--r-- | xbmc/pvr/recordings/PVRRecordings.cpp | 10 | ||||
-rw-r--r-- | xbmc/pvr/windows/GUIViewStatePVR.cpp | 5 | ||||
-rw-r--r-- | xbmc/pvr/windows/GUIViewStatePVR.h | 2 | ||||
-rw-r--r-- | xbmc/pvr/windows/GUIWindowPVR.cpp | 1 | ||||
-rw-r--r-- | xbmc/pvr/windows/GUIWindowPVRRecordings.cpp | 3 |
5 files changed, 10 insertions, 11 deletions
diff --git a/xbmc/pvr/recordings/PVRRecordings.cpp b/xbmc/pvr/recordings/PVRRecordings.cpp index ecf7eead54..4b7d4f8d41 100644 --- a/xbmc/pvr/recordings/PVRRecordings.cpp +++ b/xbmc/pvr/recordings/PVRRecordings.cpp @@ -223,16 +223,6 @@ void CPVRRecordings::GetSubDirectories(const CStdString &strBase, CFileItemList } results->AddFront(pItem, 0); } - - // Add parent directory item - if (!strUseBase.empty() && (subDirectories > 0 || files.Size() > 0) && CSettings::Get().GetBool("filelists.showparentdiritems")) - { - CStdString strLabel(".."); - CFileItemPtr pItem(new CFileItem(strLabel)); - pItem->SetPath("pvr://recordings"); - pItem->m_bIsShareOrDrive = false; - results->AddFront(pItem, 0); - } } bool CPVRRecordings::HasAllRecordingsPathExtension(const CStdString &strDirectory) diff --git a/xbmc/pvr/windows/GUIViewStatePVR.cpp b/xbmc/pvr/windows/GUIViewStatePVR.cpp index 4ffca74880..8fed994df9 100644 --- a/xbmc/pvr/windows/GUIViewStatePVR.cpp +++ b/xbmc/pvr/windows/GUIViewStatePVR.cpp @@ -65,3 +65,8 @@ void CGUIViewStatePVR::SaveViewState(void) PVRWindow ActiveView = GetActiveView(); SaveViewToDb(m_items.GetPath(), ActiveView == PVR_WINDOW_UNKNOWN ? WINDOW_PVR : WINDOW_PVR + 100 - ActiveView, NULL); } + +bool CGUIViewStatePVR::HideParentDirItems(void) +{ + return (CGUIViewState::HideParentDirItems() || PVR_WINDOW_RECORDINGS != GetActiveView() || m_items.GetPath() == "pvr://recordings/"); +} diff --git a/xbmc/pvr/windows/GUIViewStatePVR.h b/xbmc/pvr/windows/GUIViewStatePVR.h index 8b09b7b094..04060ef2ee 100644 --- a/xbmc/pvr/windows/GUIViewStatePVR.h +++ b/xbmc/pvr/windows/GUIViewStatePVR.h @@ -33,7 +33,7 @@ namespace PVR PVRWindow GetActiveView(void); protected: bool AutoPlayNextItem(void) { return false; }; - bool HideParentDirItems(void) { return true; } + bool HideParentDirItems(void); void SaveViewState(void); }; } diff --git a/xbmc/pvr/windows/GUIWindowPVR.cpp b/xbmc/pvr/windows/GUIWindowPVR.cpp index 5639cac28a..abf39aff7c 100644 --- a/xbmc/pvr/windows/GUIWindowPVR.cpp +++ b/xbmc/pvr/windows/GUIWindowPVR.cpp @@ -34,6 +34,7 @@ #include "dialogs/GUIDialogBusy.h" #include "dialogs/GUIDialogKaiToast.h" #include "threads/SingleLock.h" +#include "utils/StringUtils.h" using namespace PVR; diff --git a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp index 1c7a69739f..feb39008de 100644 --- a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp +++ b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp @@ -402,6 +402,9 @@ bool CGUIWindowPVRRecordings::OnContextButtonMarkWatched(const CFileItemPtr &ite void CGUIWindowPVRRecordings::BeforeUpdate(const CStdString &strDirectory) { + // set items path to current directory + m_parent->m_vecItems->SetPath(strDirectory); + if (m_thumbLoader.IsLoading()) m_thumbLoader.StopThread(); } |