From d47427a2d51fcc7f8e1f8926a706e04ff01603ed Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 20 Aug 2016 08:31:29 +0200 Subject: Present torrent files as a tree A torrent info dictionary has two modes: single and multi files. When in multi-mode, the name-entry is the directory containing the files. Represent it as a tree. During testing I discovered a fatal bug in the torrent parser: If we encounter an invalid string, we have to move mPos forward, else we will loop indefinitely until we're OOM. I also added some icons for folders, files and trackers. --- torrentdisplay.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'torrentdisplay.h') diff --git a/torrentdisplay.h b/torrentdisplay.h index 6305335..4aa01bf 100644 --- a/torrentdisplay.h +++ b/torrentdisplay.h @@ -2,6 +2,7 @@ #define TORRENTDISPLAY_H #include +#include class QLineEdit; class QStandardItemModel; @@ -11,7 +12,11 @@ class TorrentDisplay : public QDialog { Q_OBJECT public: explicit TorrentDisplay(QWidget *parent = 0, Qt::WindowFlags f = 0); - void setData(const QList data); + void setData(const QList data, const QString &filename); + + private slots: + void setMulti(const QVariantHash &data, const QString &filename); + void setSingle(const QVariantHash &data, const QString &filename); private: QLineEdit *mCreated; -- cgit v1.2.3-70-g09d2