Constructing Insight settings from project settings json

This commit is contained in:
Nav
2022-01-22 16:10:55 +00:00
parent cf04c2ebcd
commit c063b69490
4 changed files with 284 additions and 15 deletions

View File

@@ -25,7 +25,6 @@ namespace Bloom
class MemoryRegion
{
public:
std::size_t id = MemoryRegion::lastId++;
QString name;
QDateTime createdDate = DateTime::currentDateTime();
MemoryRegionType type;
@@ -63,19 +62,8 @@ namespace Bloom
MemoryRegion& operator = (const MemoryRegion& other) = default;
MemoryRegion& operator = (MemoryRegion&& other) = default;
bool operator == (const MemoryRegion& other) const {
return this->id == other.id;
}
bool operator != (const MemoryRegion& other) const {
return !(*this == other);
}
[[nodiscard]] bool intersectsWith(const MemoryRegion& other) const {
return this->addressRange.intersectsWith(other.addressRange);
}
private:
static inline std::atomic<std::size_t> lastId = 0;
};
}

View File

@@ -175,7 +175,7 @@ void MemoryRegionManagerWindow::sortRegionItems() {
* layout, and then re-inserting them in the correct order.
*/
auto regionItemCompare = [] (RegionItem* itemA, RegionItem* itemB) {
return itemA->getMemoryRegion().id < itemB->getMemoryRegion().id;
return itemA->getMemoryRegion().createdDate < itemB->getMemoryRegion().createdDate;
};
auto sortedRegionItems = std::set<RegionItem*, decltype(regionItemCompare)>(regionItemCompare);