From bd74eb2df37dd84ecf0279971c64c23ac5de8bce Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 27 May 2011 18:55:18 +0200 Subject: Turned dvd size constant into a global Moved constant dvd size in bytes to SmGlobals. It spread to several source files, so it seemed to be a candidate. --- filestreemodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'filestreemodel.cpp') diff --git a/filestreemodel.cpp b/filestreemodel.cpp index e6bfde5..80c6b96 100644 --- a/filestreemodel.cpp +++ b/filestreemodel.cpp @@ -62,6 +62,7 @@ FilesTreeModel::FilesTreeModel(QStringList &headers, QObject *parent) : SmTreeMo mEditableColumns.insert(tr("Set quality"), Quality); mEditableColumns.insert(tr("Set file type"), FileType); mEditableColumns.insert(tr("Set dvd no."), DvdNo); + mDvdSize = SmGlobals::instance()->dvdSize(); } FilesTreeModel::~FilesTreeModel(){ @@ -165,7 +166,7 @@ QVariant FilesTreeModel::data(const QModelIndex &index, int role) const{ } if(role == Qt::ForegroundRole){ if(index.column() == SizeDisplay){ - if(item->data(Size).toLongLong() > Q_INT64_C(2147483648)){ + if(item->data(Size).toLongLong() > mDvdSize){ return QColor(Qt::red); } return QColor(Qt::green); @@ -422,7 +423,7 @@ bool FilesTreeModel::addFile(const QString &fullPath, int type, int quality, int QString md5Sum = Helper::md5Sum(fullPath); if(!fi.exists()){ //should be a dvd - size = Q_INT64_C(4707319808); + size = mDvdSize; md5Sum = QString(32, '0'); } -- cgit v1.2.3-70-g09d2