summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2018-03-24 11:58:00 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2018-03-24 11:58:00 +0100
commite1a71ce7cc2bd828df5409faa3ad59ff6cf830bf (patch)
treec7ea04f3cd2b9e5e3e9bfa09a9e6534267ea15c2 /menu.c
parent53aea17949a184d264bfd98c8e669b94997bfc79 (diff)
downloadvdr-e1a71ce7cc2bd828df5409faa3ad59ff6cf830bf.tar.gz
vdr-e1a71ce7cc2bd828df5409faa3ad59ff6cf830bf.tar.bz2
Fixed setting the initial offset of the cursor in a list menu
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/menu.c b/menu.c
index d5300153..22d27014 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.69 2018/03/18 12:01:09 kls Exp $
+ * $Id: menu.c 4.70 2018/03/24 11:43:40 kls Exp $
*/
#include "menu.h"
@@ -3010,6 +3010,7 @@ void cMenuRecordings::Set(bool Refresh)
Clear();
GetRecordingsSortMode(DirectoryName());
Recordings->Sort();
+ cMenuRecordingItem *CurrentItem = NULL;
cMenuRecordingItem *LastItem = NULL;
for (const cRecording *Recording = Recordings->First(); Recording; Recording = Recordings->Next(Recording)) {
if ((!filter || filter->Filter(Recording)) && (!base || (strstr(Recording->Name(), base) == Recording->Name() && Recording->Name()[strlen(base)] == FOLDERDELIMCHAR))) {
@@ -3035,15 +3036,16 @@ void cMenuRecordings::Set(bool Refresh)
if (LastItem || LastDir) {
if (*path) {
if (strcmp(path, Recording->Folder()) == 0)
- SetCurrent(LastDir ? LastDir : LastItem);
+ CurrentItem = LastDir ? LastDir : LastItem;
}
else if (CurrentRecording && strcmp(CurrentRecording, Recording->FileName()) == 0)
- SetCurrent(LastDir ? LastDir : LastItem);
+ CurrentItem = LastDir ? LastDir : LastItem;
}
if (LastDir)
LastDir->IncrementCounter(Recording->IsNew());
}
}
+ SetCurrent(CurrentItem);
if (Current() < 0)
SetCurrent(Get(current)); // last resort, in case the recording was deleted
SetMenuSortMode(RecordingsSortMode == rsmName ? msmName : msmTime);