summaryrefslogtreecommitdiff
path: root/menuitem.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-01-06 17:32:17 +0100
committerlouis <louis.braun@gmx.de>2013-01-06 17:32:17 +0100
commit610d5843f59680670c7651781660cdd4ac75fdea (patch)
treeafdedf3133b70a6c2a50778481d3e69dbbfae027 /menuitem.c
parent6afcc7d33240bbee646e4d6933902df90e3da63a (diff)
downloadskin-nopacity-610d5843f59680670c7651781660cdd4ac75fdea.tar.gz
skin-nopacity-610d5843f59680670c7651781660cdd4ac75fdea.tar.bz2
Fixed displaying Recording Names and Recording Folder Names correctly
Diffstat (limited to 'menuitem.c')
-rw-r--r--menuitem.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/menuitem.c b/menuitem.c
index ce66983..dc05670 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -2,6 +2,8 @@
#include <string>
#include <sstream>
#include <algorithm>
+#include <iostream>
+#include <vector>
// cNopacityMenuItem -------------
@@ -577,9 +579,10 @@ void cNopacityChannelMenuItem::Render() {
// cNopacityRecordingMenuItem -------------
-cNopacityRecordingMenuItem::cNopacityRecordingMenuItem(cOsd *osd, const cRecording *Recording, bool sel, bool isFolder, int Total, int New) : cNopacityMenuItem (osd, "", sel) {
+cNopacityRecordingMenuItem::cNopacityRecordingMenuItem(cOsd *osd, const cRecording *Recording, bool sel, bool isFolder, int Level, int Total, int New) : cNopacityMenuItem (osd, "", sel) {
this->Recording = Recording;
this->isFolder = isFolder;
+ this->Level = Level;
this->Total = Total;
this->New = New;
}
@@ -605,23 +608,19 @@ void cNopacityRecordingMenuItem::CreatePixmapTextScroller(int totalWidth) {
}
void cNopacityRecordingMenuItem::CreateText() {
- if (isFolder) {
- const cRecordingInfo *recInfo = Recording->Info();
- strRecName = recInfo->Title();
- } else {
- std::string recName = Recording->Name();
- if (Recording->IsEdited()) {
- try {
- if (recName.at(0) == '%') {
- recName = recName.substr(1);
- }
- } catch (...) {}
+ std::string recName = Recording->Name();
+ try {
+ std::vector<std::string> tokens;
+ std::istringstream f(recName.c_str());
+ std::string s;
+ while (std::getline(f, s, FOLDERDELIMCHAR)) {
+ tokens.push_back(s);
}
- try {
- if (recName.find(FOLDERDELIMCHAR) != std::string::npos) {
- recName = recName.substr(recName.find(FOLDERDELIMCHAR) + 1);
- }
- } catch (...) {}
+ strRecName = tokens.at(Level);
+ if (!isFolder && Recording->IsEdited()) {
+ strRecName = strRecName.substr(1);
+ }
+ } catch (...) {
strRecName = recName.c_str();
}
}