From 987ad7e45b032bfeae83df338dd156a5cb28df71 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Fri, 30 Sep 2022 11:17:17 -0400 Subject: [PATCH] 2022-09-30 Fred Gleason * Updated the 'Rip Disc' dialog in rdlibrary(1) to use new 'pretty text' styling for cart and cut objects. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ lib/rddiscmodel.cpp | 20 ++++---------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index e066f2dc..7df9ee65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23445,3 +23445,6 @@ 2022-09-30 Fred Gleason * Fixed a bug in 'RDCartFilter' that caused 'RDLibraryModel' to fail to be initialized properly. +2022-09-30 Fred Gleason + * Updated the 'Rip Disc' dialog in rdlibrary(1) to use new + 'pretty text' styling for cart and cut objects. diff --git a/lib/rddiscmodel.cpp b/lib/rddiscmodel.cpp index ca629a3b..7a65bb0e 100644 --- a/lib/rddiscmodel.cpp +++ b/lib/rddiscmodel.cpp @@ -112,7 +112,9 @@ QVariant RDDiscModel::data(const QModelIndex &index,int role) const return d_texts.at(row).at(col); case Qt::DecorationRole: - // Nothing to do! + if((col==5)&&(!d_texts.at(row).at(5).toString().isEmpty())) { + return rda->iconEngine()->catchIcon(RDRecording::Playout); + } break; case Qt::TextAlignmentRole: @@ -181,21 +183,7 @@ void RDDiscModel::setCutName(const QModelIndex &row,const QString &cutname) d_texts[row.row()][5]=QString(); } else { - QString sql=QString("select ")+ - "`CART`.`TITLE`,"+ // 00 - "`CUTS`.`DESCRIPTION` "+ // 01 - "from `CART` left join `CUTS` "+ - "on `CART`.`NUMBER`=`CUTS`.`CART_NUMBER` "+ - "where `CUTS`.`CUT_NAME`='"+RDEscapeString(cutname)+"'"; - RDSqlQuery *q=new RDSqlQuery(sql); - if(q->first()) { - d_texts[row.row()][5]=q->value(0).toString()+"->"+q->value(1).toString(); - } - else { - d_texts[row.row()][5]="["+tr("New cart")+ - QString::asprintf(" %06u]",RDCut::cartNumber(cutname)); - } - delete q; + d_texts[row.row()][5]=RDCut::prettyText(cutname); } emit dataChanged(createIndex(row.row(),5),createIndex(row.row(),5)); }