[pvr] go to parent folder after deleting the last item in a subfolder

Currently when the last recording is deleted you're left in an empty ghost directory that is gone once you go back to the parent folder. This changes that so that you can't end up in an empty folder.

I also changed the call to `TriggerRecordingsUpdate` to a simple `Refresh`. If the recording was reported as deleted by the backend there's no need to fetch the recordings again, something which can take time.

@xhaggi @opdenkamp for review
Okay, would be nice if a method got added in that case that does 
`IsEmpty()` while considering parents, so we break out of the loop 
instead of counting everything. Especially if it considers parents :)


On 17-11-14 08:11, Sascha Woo wrote:
>
> In xbmc/pvr/windows/GUIWindowPVRRecordings.cpp:
>
> > +
> > +  /* delete the recording */
> > +  if (g_PVRRecordings->Delete(*item))
> > +  {
> > +    g_PVRManager.TriggerRecordingsUpdate();
> > +    bReturn = true;
> > +
> > +    /* remove the item from the list immediately, otherwise the
> > +       item count further down may be wrong */
> > +    m_vecItems->Remove(item);
> > +
> > +    /* go to the parent folder if we're in a subdirectory and just deleted the last item */
> > +    std::string directory = item->GetPVRRecordingInfoTag()->m_strDirectory;
> > +    URIUtils::RemoveSlashAtEnd(directory);
> > +
> > +    if (!directory.empty() && m_vecItems->GetObjectCount() == 0)
>
> ;)
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/xbmc/xbmc/pull/5725/files#r20420524>.
>