Big update 0.20.0

- major refactoring round done
- added replace actions for volumes
- added better Intel signature handling
- added support for unsigned Aptio capsules
- more GUIDs added to known-GUIDs database
- more information about PE and TE sections
- shown information about item full size
- hexadecimal numbers format changed from 0xAB to ABh
- AppleCRC renamed to ZVCRC because it seems not Apple-specific feature
after all
This commit is contained in:
Nikolaj Schlej 2015-01-31 15:00:00 +01:00
parent fb7e1c4c89
commit 831603dbc9
23 changed files with 1229 additions and 1157 deletions

View file

@ -1,6 +1,6 @@
/* treemodel.cpp
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
Copyright (c) 2015, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -138,12 +138,12 @@ UINT8 TreeModel::type(const QModelIndex &index) const
return item->type();
}
UINT8 TreeModel::subtype(const QModelIndex &index) const
UINT32 TreeModel::attributes(const QModelIndex &index) const
{
if (!index.isValid())
return 0;
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->subtype();
return item->attributes();
}
QByteArray TreeModel::header(const QModelIndex &index) const
@ -178,20 +178,20 @@ bool TreeModel::hasEmptyBody(const QModelIndex &index) const
return item->hasEmptyBody();
}
QByteArray TreeModel::tail(const QModelIndex &index) const
QString TreeModel::name(const QModelIndex &index) const
{
if (!index.isValid())
return QByteArray();
return QString();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->tail();
return item->name();
}
bool TreeModel::hasEmptyTail(const QModelIndex &index) const
QString TreeModel::text(const QModelIndex &index) const
{
if (!index.isValid())
return true;
return QString();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->hasEmptyTail();
return item->text();
}
QString TreeModel::info(const QModelIndex &index) const
@ -218,17 +218,17 @@ UINT8 TreeModel::compression(const QModelIndex &index) const
return item->compression();
}
void TreeModel::setSubtype(const QModelIndex & index, UINT8 subtype)
void TreeModel::setAttributes(const QModelIndex & index, const UINT32 attributes)
{
if (!index.isValid())
return;
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
item->setSubtype(subtype);
item->setAttributes(attributes);
emit dataChanged(index, index);
}
void TreeModel::setNameString(const QModelIndex &index, const QString &data)
void TreeModel::setName(const QModelIndex &index, const QString &data)
{
if (!index.isValid())
return;
@ -238,27 +238,17 @@ void TreeModel::setNameString(const QModelIndex &index, const QString &data)
emit dataChanged(index, index);
}
void TreeModel::setTypeString(const QModelIndex &index, const QString &data)
void TreeModel::setType(const QModelIndex &index, const UINT8 data)
{
if (!index.isValid())
return;
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
item->setTypeName(data);
item->setType(data);
emit dataChanged(index, index);
}
void TreeModel::setSubtypeString(const QModelIndex &index, const QString &data)
{
if (!index.isValid())
return;
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
item->setSubtypeName(data);
emit dataChanged(index, index);
}
void TreeModel::setTextString(const QModelIndex &index, const QString &data)
void TreeModel::setText(const QModelIndex &index, const QString &data)
{
if (!index.isValid())
return;
@ -268,50 +258,14 @@ void TreeModel::setTextString(const QModelIndex &index, const QString &data)
emit dataChanged(index, index);
}
QString TreeModel::nameString(const QModelIndex &index) const
/*QString TreeModel::name(const QModelIndex &index) const
{
if (!index.isValid())
return QString();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->data(0).toString();
}
QString TreeModel::actionString(const QModelIndex &index) const
{
if (!index.isValid())
return QString();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->data(1).toString();
}
QString TreeModel::typeString(const QModelIndex &index) const
{
if (!index.isValid())
return QString();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->data(2).toString();
}
QString TreeModel::subtypeString(const QModelIndex &index) const
{
if (!index.isValid())
return QString();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->data(3).toString();
}
QString TreeModel::textString(const QModelIndex &index) const
{
if (!index.isValid())
return QString();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->data(4).toString();
}
return item->name();
}*/
void TreeModel::setAction(const QModelIndex &index, const UINT8 action)
{
@ -323,9 +277,9 @@ void TreeModel::setAction(const QModelIndex &index, const UINT8 action)
emit dataChanged(this->index(0, 0), index);
}
QModelIndex TreeModel::addItem(const UINT8 type, const UINT8 subtype, const UINT8 compression,
QModelIndex TreeModel::addItem(const UINT8 type, const UINT32 attributes, const UINT8 compression,
const QString & name, const QString & text, const QString & info,
const QByteArray & header, const QByteArray & body, const QByteArray & tail,
const QByteArray & header, const QByteArray & body,
const QModelIndex & parent, const UINT8 mode)
{
TreeItem *item = 0;
@ -347,7 +301,7 @@ QModelIndex TreeModel::addItem(const UINT8 type, const UINT8 subtype, const UINT
}
}
TreeItem *newItem = new TreeItem(type, subtype, compression, name, text, info, header, body, tail, parentItem);
TreeItem *newItem = new TreeItem(type, attributes, compression, name, text, info, header, body, parentItem);
if (mode == CREATE_MODE_APPEND) {
emit layoutAboutToBeChanged();
parentItem->appendChild(newItem);