mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-12 17:43:41 +02:00
2016-07-26 Fred Gleason <fredg@paravelsystems.com>
* Added a sanity check in the 'RDCut::setMetadata()' method in 'lib/rdcut.cpp' to ensure that the cut 'Description' field is always populated.
This commit is contained in:
@@ -1135,6 +1135,24 @@ void RDCut::setMetadata(RDWaveData *data) const
|
||||
sprintf(" where CUT_NAME=\"%s\"",(const char *)cut_name.utf8());
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
|
||||
//
|
||||
// Sanity Check: NEVER permit the 'description' field to be empty.
|
||||
//
|
||||
sql=QString("select DESCRIPTION from CUTS where ")+
|
||||
"CUT_NAME=\""+RDEscapeString(cut_name)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
if(q->value(0).toString().isEmpty()) {
|
||||
sql=QString("update CUTS set ")+
|
||||
QString().sprintf("DESCRIPTION=\"Cut %03d\"",
|
||||
RDCut::cutNumber(cut_name))+
|
||||
" where CUT_NAME=\""+RDEscapeString(cut_name)+"\"";
|
||||
delete q;
|
||||
q=new RDSqlQuery(sql);
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user