summaryrefslogtreecommitdiff
path: root/menuitem.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-09-08 16:18:40 +0200
committerlouis <louis.braun@gmx.de>2013-09-08 16:18:40 +0200
commit1fba49cea7121c1942cef0bcccc0ba752f6b52e3 (patch)
treeb9fce8d9707e261558504f39f5db1d2a2605c965 /menuitem.c
parenta40698a2bacbe59c0c562c84eefebd1650214bc1 (diff)
downloadskin-nopacity-1fba49cea7121c1942cef0bcccc0ba752f6b52e3.tar.gz
skin-nopacity-1fba49cea7121c1942cef0bcccc0ba752f6b52e3.tar.bz2
Display correct recording date even if recording info is empty (closes Bug 1448)
Diffstat (limited to 'menuitem.c')
-rw-r--r--menuitem.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/menuitem.c b/menuitem.c
index 74faba2..d72be9d 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -1159,9 +1159,14 @@ void cNopacityRecordingMenuItem::DrawRecDateTime(void) {
cString strDateTime("");
cString strDuration("");
if (Event) {
- cString strDate = Event->GetDateString();
+ std::string strDate = *(Event->GetDateString());
cString strTime = Event->GetTimeString();
- strDateTime = cString::sprintf("%s - %s", *strDate, *strTime);
+ if (strDate.find("1970") != std::string::npos) {
+ time_t start = Recording->Start();
+ strDateTime = cString::sprintf("%s %s", *DateString(start),*TimeString(start));
+ } else {
+ strDateTime = cString::sprintf("%s - %s", strDate.c_str(), *strTime);
+ }
int duration = Event->Duration() / 60;
int recDuration = Recording->LengthInSeconds();
recDuration = (recDuration>0)?(recDuration / 60):0;