]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/filelistmodel.h
Replace QtGui includes with QtWidgets, add QT += widgets for qmake
[virtualjaguar] / src / gui / filelistmodel.h
index b2006a84b107f0aecec757162968af8a1139e810..83666f40a3e4d7d445a1a446453986bbb43ae513 100644 (file)
@@ -1,15 +1,16 @@
 //
 // filelistmodel.h: Class definition
 //
-// by James L. Hammons
+// by James Hammons
 // (C) 2010 Underground Software
 //
 
 #ifndef __FILELISTMODEL_H__
 #define __FILELISTMODEL_H__
 
-#include <QtGui>
+#include <QtWidgets>
 #include <vector>
+#include <stdint.h>
 
 struct FileListData
 {
@@ -17,10 +18,23 @@ struct FileListData
 //     FileListData(unsigned long ul=0, QString str, QImage img): dbIndex(ul), filename(str), label(img) {}
 
        unsigned long dbIndex;
+       unsigned long fileSize;
        QString filename;
        QImage label;
+       bool hasUniversalHeader;
+       uint32_t fileType;
+       uint32_t crc;
 };
 
+//hm.
+#define FLM_INDEX                      (Qt::UserRole + 1)
+#define FLM_FILESIZE           (Qt::UserRole + 2)
+#define FLM_FILENAME           (Qt::UserRole + 3)
+#define FLM_LABEL                      (Qt::UserRole + 4)
+#define FLM_UNIVERSALHDR       (Qt::UserRole + 5)
+#define FLM_FILETYPE           (Qt::UserRole + 6)
+#define FLM_CRC                                (Qt::UserRole + 7)
+
 class FileListModel: public QAbstractListModel
 {
        public:
@@ -30,15 +44,15 @@ class FileListModel: public QAbstractListModel
                QVariant data(const QModelIndex & index, int role) const;
                QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
 
-               void AddData(QIcon pix);
-               void AddData(unsigned long);
-               void AddData(unsigned long, QString, QImage);
+//             void AddData(QIcon pix);
+//             void AddData(unsigned long);
+               void AddData(unsigned long, QString, QImage, unsigned long);
+               void AddData(unsigned long, QString, QImage, unsigned long, bool, uint32_t, uint32_t);
+               void ClearData(void);
 
 //             FileListData GetData(const QModelIndex & index) const;
 
        private:
-               std::vector<QIcon> pixList;
-               std::vector<unsigned long> dbIndex;
                std::vector<FileListData> list;
 };