summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-03-04 14:11:47 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2013-03-04 14:11:47 +0100
commitdb8cf38b5b39a611ca35bebb8d657167a4573b20 (patch)
tree00851db76e2c2d26b18d206aa7ff74aa78350251 /recording.c
parentf3eb300bb017c18c15cc0d08752edf0fba3a96c5 (diff)
downloadvdr-db8cf38b5b39a611ca35bebb8d657167a4573b20.tar.gz
vdr-db8cf38b5b39a611ca35bebb8d657167a4573b20.tar.bz2
Implemented the setup option "OSD/Always sort folders first"
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/recording.c b/recording.c
index ede7c1b9..032175dd 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 2.89 2013/03/03 10:54:05 kls Exp $
+ * $Id: recording.c 2.90 2013/03/04 14:02:40 kls Exp $
*/
#include "recording.h"
@@ -943,7 +943,9 @@ char *cRecording::SortName(void) const
{
char **sb = (RecordingsSortMode == rsmName) ? &sortBufferName : &sortBufferTime;
if (!*sb) {
- char *s = StripEpisodeName(strdup(FileName() + strlen(VideoDirectory)), RecordingsSortMode != rsmName);
+ char *s = strdup(FileName() + strlen(VideoDirectory));
+ if (RecordingsSortMode != rsmName || Setup.AlwaysSortFoldersFirst)
+ s = StripEpisodeName(s, RecordingsSortMode != rsmName);
strreplace(s, '/', '0'); // some locales ignore '/' when sorting
int l = strxfrm(NULL, s, 0) + 1;
*sb = MALLOC(char, l);
@@ -953,6 +955,12 @@ char *cRecording::SortName(void) const
return *sb;
}
+void cRecording::ClearSortName(void)
+{
+ DELETENULL(sortBufferName);
+ DELETENULL(sortBufferTime);
+}
+
int cRecording::GetResume(void) const
{
if (resume == RESUME_NOT_INITIALIZED) {
@@ -1422,6 +1430,13 @@ void cRecordings::ResetResume(const char *ResumeFileName)
ChangeState();
}
+void cRecordings::ClearSortNames(void)
+{
+ LOCK_THREAD;
+ for (cRecording *recording = First(); recording; recording = Next(recording))
+ recording->ClearSortName();
+}
+
// --- cMark -----------------------------------------------------------------
double MarkFramesPerSecond = DEFAULTFRAMESPERSECOND;