mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-02-13 15:22:42 +08:00
Attempt to workaround #137
This commit is contained in:
parent
4bb759780f
commit
c4567dcffc
@ -95,7 +95,7 @@ public:
|
||||
UINT8 replace(const QModelIndex & index, const QByteArray & object, const UINT8 mode);
|
||||
UINT8 remove(const QModelIndex & index);
|
||||
UINT8 rebuild(const QModelIndex & index);
|
||||
UINT8 doNotRebuild(const QModelIndex & index);
|
||||
UINT8 doNotRebuild(const QModelIndex & index);
|
||||
UINT8 dump(const QModelIndex & index, const QString & path, const QString & filter = QString());
|
||||
UINT8 patch(const QModelIndex & index, const QVector<PatchData> & patches);
|
||||
|
||||
|
19
treeitem.cpp
19
treeitem.cpp
@ -209,7 +209,22 @@ void TreeItem::setAction(const UINT8 action)
|
||||
|
||||
// Set rebuild action for parent, if it has no action now
|
||||
if (parentItem && parentItem->type() != Types::Root
|
||||
&& parentItem->action() == Actions::NoAction)
|
||||
&& parentItem->action() == Actions::NoAction) {
|
||||
parentItem->setAction(Actions::Rebuild);
|
||||
}
|
||||
|
||||
// Set rebuild action for subsequent items after parent.
|
||||
// This is a little ugly, but fixes UEFIReplace image corruption,
|
||||
// where one cannot manually choose the targets for rebuild.
|
||||
// See: https://github.com/LongSoft/UEFITool/issues/137
|
||||
TreeItem *grandParent = parentItem->parentItem;
|
||||
if (grandParent) {
|
||||
QList<TreeItem *> &parentCousins = grandParent->childItems;
|
||||
int count = parentCousins.count();
|
||||
for (int i = parentCousins.indexOf(parentItem) + 1; i < count; i++) {
|
||||
TreeItem *parentCousin = parentCousins.value(i, NULL);
|
||||
if (parentCousin && parentCousin->action() == Actions::NoAction)
|
||||
parentCousin->setAction(Actions::Rebuild);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user