From 0afebd0e3cb3da831cd5ffba1eefbe9e61e408a1 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 27 Jul 2013 03:59:47 +0200 Subject: Read JSON from ffprobe Use JSON output from ffprobe instead of string parsing to get some kind of type safety. For doing that, some changes were needed in FileView: Use delegates for displaying Duration and Bitrate instead of mangling output in Qt::Displayrole. To reuse code, move all delegates from the new Archive to a separate file. And, of course, the initial objective: Show the accumulated size and duration of selected files in the status bar from the experimental archive. --- smdirmodel.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'smdirmodel.cpp') diff --git a/smdirmodel.cpp b/smdirmodel.cpp index f967cf1..16caf02 100644 --- a/smdirmodel.cpp +++ b/smdirmodel.cpp @@ -71,23 +71,6 @@ QVariant SmDirModel::data(const QModelIndex &index, int role) const{ return QVariant(QColor(Qt::darkGreen)); } return SmTreeModel::data(index, role); - case Qt::DisplayRole: { - if(index.column() == DurSize){ - QVariant d = i->data(DurSize); - if(d.canConvert()){ - Helper::Duration dur = d.value(); - return dur.toString(); - } - if(d.canConvert()){ - QSize size = d.value(); - QString retval = QString(tr("%1x%2 px").arg(QString::number(size.width())).arg(QString::number(size.height()))); - return retval; - } - return QVariant(); - } - } - - default: return SmTreeModel::data(index, role); } -- cgit v1.2.3-70-g09d2