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. --- fileview.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'fileview.h') diff --git a/fileview.h b/fileview.h index ad2b522..2f4a51c 100644 --- a/fileview.h +++ b/fileview.h @@ -29,7 +29,6 @@ class FileView : public SmTreeView { FileView(QWidget *parent = 0); ~FileView() {} virtual void setModel(QAbstractItemModel *model); - const QVariant duration() const; signals: void upDir(); @@ -39,7 +38,7 @@ class FileView : public SmTreeView { void editorClosed(const QModelIndex &idx); void numSelected(int); void selectedSize(qint64); - void selectedDuration(QVariant); + void selectedDuration(qint64,bool); public slots: void markFiles(); @@ -49,6 +48,7 @@ class FileView : public SmTreeView { void writeConfig(); void saveSelection(); void restoreSelection(); + void selectedFilesChanged(); protected slots: virtual void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint); @@ -59,9 +59,6 @@ class FileView : public SmTreeView { virtual void resizeEvent(QResizeEvent *e); virtual bool event(QEvent *event); - private slots: - void selectedFilesChanged(); - private: enum HoverFileType { Dir, Movie, Image, None }; bool exitHover(bool exitVal = true); @@ -77,7 +74,6 @@ class FileView : public SmTreeView { QList mMd5Sums; FilesystemFileProxy *mProxy; SmDirModel *mModel; - Helper::Duration mDuration; }; #endif -- cgit v1.2.3-70-g09d2