Permalink
Browse files

Merge pull request #4277 from xhaggi/fix-recordings-parent-dir

[pvr] fix: duplicate parent dir item for recordings
  • Loading branch information...
2 parents f109a31 + 7ee7e18 commit 960df5399f13688e7594c6322ed89923f38652dc @jmarshallnz jmarshallnz committed Mar 4, 2014
@@ -224,16 +224,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)
@@ -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/");
+}
@@ -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);
};
}
@@ -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();
}

0 comments on commit 960df53

Please sign in to comment.