Hide start/end time of chapters when not set

This commit is contained in:
Martchus 2016-07-11 21:12:02 +02:00
parent dc7b4844bf
commit 229e24cbe0
3 changed files with 10 additions and 6 deletions

View File

@ -750,10 +750,10 @@ void displayFileInfo(const ArgumentOccurance &, const Argument &filesArg, const
if(!chapter->names().empty()) {
printProperty("Name", static_cast<string>(chapter->names().front()));
}
if(!chapter->startTime().isNull()) {
if(!chapter->startTime().isNegative()) {
printProperty("Start time", chapter->startTime().toString());
}
if(!chapter->endTime().isNull()) {
if(!chapter->endTime().isNegative()) {
printProperty("End time", chapter->endTime().toString());
}
cout << endl;

View File

@ -476,8 +476,12 @@ void FileInfoModel::updateCache()
const string locale = joinStrings(initializer_list<string>{joinStrings(name.languages(), delim, true), joinStrings(name.countries(), delim, true)}, delim, true);
chapterHelper.appendRow(tr("Name (%1)").arg(QString::fromLocal8Bit(locale.data())), name);
}
chapterHelper.appendRow(tr("Start time"), chapter->startTime());
chapterHelper.appendRow(tr("End time"), chapter->endTime());
if(!chapter->startTime().isNegative()) {
chapterHelper.appendRow(tr("Start time"), chapter->startTime());
}
if(!chapter->endTime().isNegative()) {
chapterHelper.appendRow(tr("End time"), chapter->endTime());
}
QStringList labels;
if(chapter->isHidden()) {
labels << tr("hidden");

View File

@ -664,10 +664,10 @@ public:
const string locale = joinStrings(initializer_list<string>{joinStrings(name.languages(), delim, true), joinStrings(name.countries(), delim, true)}, delim, true);
rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Name (%1)").arg(qstr(locale)), qstr(name));
}
if(!chapter.startTime().isNull()) {
if(!chapter.startTime().isNegative()) {
rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Start time"), qstr(chapter.startTime().toString(TimeSpanOutputFormat::WithMeasures)));
}
if(!chapter.endTime().isNull()) {
if(!chapter.endTime().isNegative()) {
rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "End time"), qstr(chapter.endTime().toString(TimeSpanOutputFormat::WithMeasures)));
}
QStringList labels;