summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-12-04 14:55:13 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2017-12-04 14:55:13 +0100
commit0224fc5210b61ec323f05957e626edad9d123001 (patch)
tree53d646e1462b29dc247c9165363c5af72831da40 /menu.c
parentb96277e28a583b4dfe84823d49e8133de78daed8 (diff)
downloadvdr-0224fc5210b61ec323f05957e626edad9d123001.tar.gz
vdr-0224fc5210b61ec323f05957e626edad9d123001.tar.bz2
Fixed positioning to the current item when changing the sort mode in the Recordings menu, in case there is a LastReplayed recording
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/menu.c b/menu.c
index 20e7189d..af904102 100644
--- a/menu.c
+++ b/menu.c
@@ -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);