mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-12 07:35:55 +01:00
2021-08-13 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdlibrary(1) that caused misaligned columns when generating a Cut Report. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -119,7 +119,7 @@ bool RDReport::ExportCutLog(const QString &filename,const QDate &startdate,
|
||||
if(desc.isEmpty()) {
|
||||
desc=" ";
|
||||
}
|
||||
*strm << rda->timeString(q->value(2).toTime(),true)+" ";
|
||||
*strm << rda->timeString(q->value(2).toTime()," ")+" ";
|
||||
*strm << cart_num+" ";
|
||||
*strm << RDReport::leftJustify(q->value(8).toString(),23)+" ";
|
||||
*strm << cut+" ";
|
||||
|
||||
@@ -109,7 +109,7 @@ bool RDReport::ExportMusicPlayout(const QString &filename,
|
||||
}
|
||||
}
|
||||
cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt());
|
||||
*strm << rda->timeString(q->value(2).toDateTime().time(),true)+" ";
|
||||
*strm << rda->timeString(q->value(2).toDateTime().time()," ")+" ";
|
||||
*strm << cart_num+" ";
|
||||
*strm << cut+" ";
|
||||
*strm << RDGetTimeLength(q->value(0).toInt(),true,false).right(5)+" ";
|
||||
|
||||
@@ -124,7 +124,7 @@ bool RDReport::ExportTechnical(const QString &filename,const QDate &startdate,
|
||||
}
|
||||
}
|
||||
cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt());
|
||||
*strm << rda->timeString(q->value(2).toTime(),true)+" ";
|
||||
*strm << rda->timeString(q->value(2).toTime()," ")+" ";
|
||||
*strm << cart_num+" ";
|
||||
*strm << cut+" ";
|
||||
*strm << RDReport::leftJustify(q->value(8).toString(),23)+" ";
|
||||
|
||||
@@ -112,7 +112,7 @@ bool RDReport::ExportTextLog(const QString &filename,const QDate &startdate,
|
||||
}
|
||||
}
|
||||
cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt());
|
||||
*strm << rda->timeString(q->value(2).toTime(),true)+" ";
|
||||
*strm << rda->timeString(q->value(2).toTime()," ")+" ";
|
||||
*strm << RDReport::rightJustify(cart_num,6)+" ";
|
||||
*strm << cut+" ";
|
||||
*strm << RDReport::leftJustify(q->value(8).toString(),23)+" ";
|
||||
|
||||
@@ -360,27 +360,46 @@ QString RDCoreApplication::shortDateTimeString(const QDateTime &dt) const
|
||||
}
|
||||
|
||||
|
||||
QString RDCoreApplication::timeString(const QTime &time,bool padded) const
|
||||
QString RDCoreApplication::timeString(const QTime &time,
|
||||
const QString &padding) const
|
||||
{
|
||||
if(app_show_twelve_hour_time) {
|
||||
if(padded) {
|
||||
return time.toString(RD_TWELVE_HOUR_PADDED_FORMAT);
|
||||
QString time_str=time.toString(RD_TWELVE_HOUR_FORMAT);
|
||||
if(!padding.isEmpty()) {
|
||||
if((time.hour()==0)||((time.hour()>=10)&&(time.hour()<13))||
|
||||
(time.hour()>=22)) {
|
||||
return time_str.left(8)+" "+time_str.right(2);
|
||||
}
|
||||
return padding+time_str.left(7)+" "+time_str.right(2);
|
||||
}
|
||||
return time.toString(RD_TWELVE_HOUR_FORMAT);
|
||||
if((time.hour()==0)||((time.hour()>=10)&&(time.hour()<13))||
|
||||
(time.hour()>=22)) {
|
||||
return time_str.left(8)+" "+time_str.right(2);
|
||||
}
|
||||
return time_str.left(7)+" "+time_str.right(2);
|
||||
}
|
||||
return time.toString(RD_TWENTYFOUR_HOUR_FORMAT);
|
||||
return time.toString(RD_TWENTYFOUR_HOUR_FORMAT).left(10);
|
||||
}
|
||||
|
||||
|
||||
QString RDCoreApplication::tenthsTimeString(const QTime &time,bool padded) const
|
||||
QString RDCoreApplication::tenthsTimeString(const QTime &time,
|
||||
const QString &padding) const
|
||||
{
|
||||
if(app_show_twelve_hour_time) {
|
||||
if(padded) {
|
||||
return time.toString(RD_TWELVE_HOUR_TENTHS_PADDED_FORMAT);
|
||||
QString time_str=time.toString(RD_TWELVE_HOUR_TENTHS_FORMAT);
|
||||
if(!padding.isEmpty()) {
|
||||
if((time.hour()==0)||((time.hour()>=10)&&(time.hour()<13))||
|
||||
(time.hour()>=22)) {
|
||||
return time_str.left(10)+" "+time_str.right(2);
|
||||
}
|
||||
return padding+time_str.left(9)+" "+time_str.right(2);
|
||||
}
|
||||
return time.toString(RD_TWELVE_HOUR_TENTHS_FORMAT);
|
||||
if(((time.hour()>=10)&&(time.hour()<13))||(time.hour()>=22)) {
|
||||
return time_str.left(10)+" "+time_str.right(2);
|
||||
}
|
||||
return time_str.left(9)+" "+time_str.right(2);
|
||||
}
|
||||
return time.toString(RD_TWENTYFOUR_HOUR_TENTHS_FORMAT);
|
||||
return time.toString(RD_TWENTYFOUR_HOUR_TENTHS_FORMAT).left(10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ class RDCoreApplication : public QObject
|
||||
QString shortDateFormat() const;
|
||||
QString shortDateString(const QDate &date) const;
|
||||
QString shortDateTimeString(const QDateTime &dt) const;
|
||||
QString timeString(const QTime &time,bool padded=false) const;
|
||||
QString tenthsTimeString(const QTime &time,bool padded=false) const;
|
||||
QString timeString(const QTime &time,const QString &padding="") const;
|
||||
QString tenthsTimeString(const QTime &time,const QString &padding="") const;
|
||||
bool dropTable(const QString &tbl_name);
|
||||
void addTempFile(const QString &pathname);
|
||||
void syslog(int priority,const char *fmt,...) const;
|
||||
|
||||
@@ -381,7 +381,7 @@ int RDLogModel::validate(QString *report,const QDate &date)
|
||||
rda->shortDateString(now.date())+" - "+
|
||||
rda->timeString(now.time())+"\n";
|
||||
*report+=QString("Log: ")+d_log_name+"\n";
|
||||
*report+=QString("Effective Airdate: ")+date.toString("MM/dd/yyyy")+"\n";
|
||||
*report+=QString("Effective Airdate: ")+rda->shortDateString(date)+"\n";
|
||||
*report+="\n";
|
||||
|
||||
//
|
||||
@@ -397,7 +397,7 @@ int RDLogModel::validate(QString *report,const QDate &date)
|
||||
q=new RDSqlQuery(sql);
|
||||
if(!q->first()) {
|
||||
*report+=QString(" ")+
|
||||
logLine(i)->startTime(RDLogLine::Logged).toString("hh:mm:ss")+
|
||||
rda->timeString(logLine(i)->startTime(RDLogLine::Logged))+
|
||||
QString().sprintf(" - missing cart %06d",logLine(i)->cartNumber())+
|
||||
"\n";
|
||||
errs++;
|
||||
@@ -1028,18 +1028,17 @@ QString RDLogModel::StartTimeString(int line) const
|
||||
if(ll!=NULL) {
|
||||
switch(ll->timeType()) {
|
||||
case RDLogLine::Hard:
|
||||
return QString("T")+ll->startTime(RDLogLine::Logged).
|
||||
toString("hh:mm:ss.zzz").left(10);
|
||||
return QString("T")+
|
||||
rda->tenthsTimeString(ll->startTime(RDLogLine::Logged));
|
||||
break;
|
||||
|
||||
default:
|
||||
if(d_start_time_style==RDLogModel::Estimated) {
|
||||
if(ll->startTime(RDLogLine::Predicted).isNull()) {
|
||||
return blockStartTime(line).toString("hh:mm:ss.zzz").left(10);
|
||||
return rda->tenthsTimeString(blockStartTime(line));
|
||||
}
|
||||
else {
|
||||
return ll->startTime(RDLogLine::Predicted).
|
||||
toString("hh:mm:ss.zzz").left(10);
|
||||
return rda->tenthsTimeString(ll->startTime(RDLogLine::Predicted));
|
||||
}
|
||||
}
|
||||
else { // Scheduled
|
||||
@@ -1047,8 +1046,7 @@ QString RDLogModel::StartTimeString(int line) const
|
||||
return QString("");
|
||||
}
|
||||
else {
|
||||
return ll->startTime(RDLogLine::Logged).
|
||||
toString("hh:mm:ss.zzz").left(10);
|
||||
return rda->tenthsTimeString(ll->startTime(RDLogLine::Logged));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user