Version 0.3.0

Refactor code to separate GUI from FFS ttraversal
This commit is contained in:
Nikolaj Schlej 2013-10-15 17:19:15 +02:00
parent 1827c94977
commit 3ffbc01a3f
17 changed files with 1570 additions and 1081 deletions

View file

@ -20,7 +20,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <QVariant>
#include "basetypes.h"
#include "treeitemtypes.h"
class TreeItem;
@ -29,7 +28,7 @@ class TreeModel : public QAbstractItemModel
Q_OBJECT
public:
TreeModel(QObject *parent = 0);
TreeModel(TreeItem *root, QObject *parent = 0);
~TreeModel();
QVariant data(const QModelIndex &index, int role) const;
@ -42,18 +41,14 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QModelIndex addItem(UINT8 type, UINT8 subtype = 0, const QByteArray &header = QByteArray(), const QByteArray &body = QByteArray(), const QModelIndex &parent = QModelIndex());
bool removeItem(const QModelIndex &index);
QByteArray header(const QModelIndex& index);
bool hasEmptyHeader(const QModelIndex& index);
QByteArray body(const QModelIndex& index);
bool hasEmptyBody(const QModelIndex& index);
private:
QModelIndex findParentOfType(UINT8 type, const QModelIndex& index);
bool setItemName(const QString &data, const QModelIndex &index);
bool setItemText(const QString &data, const QModelIndex &index);
QModelIndex addItem(const UINT8 type, const UINT8 subtype = 0, const UINT32 offset = 0, const QString & name = QString(),
const QString & typeName = QString(), const QString & subtypeName = QString(), const QString & text = QString(),
const QString & info = QString(), const QByteArray & header = QByteArray(), const QByteArray & body = QByteArray(), const QModelIndex & parent = QModelIndex());
private:
TreeItem *rootItem;
};