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. --- filesystemwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'filesystemwidget.cpp') diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index 7ded048..9a4efa0 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -27,6 +27,7 @@ #include "filesystemfileproxy.h" #include "pictureviewer2.h" #include "smglobals.h" +#include "delegates.h" #include "smdirmodel.h" FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent), mClipboardMode(None) { @@ -65,6 +66,8 @@ FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent), mClipboar mFileView->setItemsExpandable(false); mFileView->setSelectionMode(QAbstractItemView::ExtendedSelection); mFileView->setSelectionBehavior(QAbstractItemView::SelectRows); + mFileView->setItemDelegateForColumn(SmDirModel::DurSize, new DurationDelegate(this)); + mFileView->setItemDelegateForColumn(SmDirModel::Bitrate, new BitrateDelegate(this)); mFileProxy->setDynamicSortFilter(true); connect(mFileView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), mFileView, SLOT(selectedFilesChanged())); -- cgit v1.2.3-70-g09d2