1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed positioning to the current item when changing the sort mode in the Recordings menu, in case there is a LastReplayed recording

This commit is contained in:
Klaus Schmidinger 2017-12-04 14:55:13 +01:00
parent b96277e28a
commit 0224fc5210
2 changed files with 9 additions and 5 deletions

View File

@ -9215,3 +9215,5 @@ Video Disk Recorder Revision History
- Added a note to PLUGINS.html about writing log messages in English.
- Fixed a deadlock when moving a folder containing several recordings between
different volumes (reported by Matthias Senzel).
- Fixed positioning to the current item when changing the sort mode in the Recordings
menu, in case there is a LastReplayed recording.

12
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 4.46 2017/11/27 15:19:07 kls Exp $
* $Id: menu.c 4.47 2017/12/04 14:50:59 kls Exp $
*/
#include "menu.h"
@ -2858,10 +2858,10 @@ public:
cMenuRecordingItem(const cRecording *Recording, int Level);
~cMenuRecordingItem();
void IncrementCounter(bool New);
const char *Name(void) { return name; }
int Level(void) { return level; }
const cRecording *Recording(void) { return recording; }
bool IsDirectory(void) { return name != NULL; }
const char *Name(void) const { return name; }
int Level(void) const { return level; }
const cRecording *Recording(void) const { return recording; }
bool IsDirectory(void) const { return name != NULL; }
void SetRecording(const cRecording *Recording) { recording = Recording; }
virtual void SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable);
};
@ -3167,6 +3167,8 @@ eOSState cMenuRecordings::Sort(void)
{
if (HasSubMenu())
return osContinue;
if (const cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current()))
SetRecording(ri->Recording()->FileName()); // makes sure the Recordings menu will reposition to the current recording
IncRecordingsSortMode(DirectoryName());
recordingsStateKey.Reset();
Set(true);