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. --- archiveview.h | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'archiveview.h') diff --git a/archiveview.h b/archiveview.h index 6627508..48517da 100644 --- a/archiveview.h +++ b/archiveview.h @@ -236,41 +236,4 @@ class PartEditor : public QDialog { QPushButton *mAccept; }; -class FileNoDelegate : public QStyledItemDelegate { - Q_OBJECT - public: - explicit FileNoDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {} - virtual QString displayText(const QVariant &value, const QLocale &locale) const; - virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; -}; - -class DvdNoDelegate : public QStyledItemDelegate { - Q_OBJECT - public: - explicit DvdNoDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {} - virtual QString displayText(const QVariant &value, const QLocale &locale) const; -}; - -class SizeDelegate : public QStyledItemDelegate { - Q_OBJECT - public: - explicit SizeDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {} - virtual QString displayText(const QVariant &value, const QLocale &locale) const; -}; - -class DurationDelegate : public QStyledItemDelegate { - Q_OBJECT - public: - explicit DurationDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {} - virtual QString displayText(const QVariant &value, const QLocale &locale) const; -}; - -class EmptyDelegate : public QStyledItemDelegate { - Q_OBJECT - public: - explicit EmptyDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {} - virtual QString displayText(const QVariant &value, const QLocale &locale) const; -}; - - #endif // ARCHIVEVIEW_H -- cgit v1.2.3-70-g09d2