diff options
| author | Alexander Taylor <alex@vector35.com> | 2025-04-16 10:21:22 -0400 |
|---|---|---|
| committer | Alexander Taylor <alex@vector35.com> | 2025-04-16 10:21:22 -0400 |
| commit | ca696ab4a79902d0448135f6fca3769f0576e39d (patch) | |
| tree | 3aabbba81e4968c03289c5d10eea5340f15597ce /view/sharedcache | |
| parent | 77c3bf786be64267cb7f45d9d0f118fcbf6d8aea (diff) | |
Add loaded column for kernel cache view.
Required adding an API to determine if an image is loaded.
Diffstat (limited to 'view/sharedcache')
| -rw-r--r-- | view/sharedcache/ui/dsctriage.cpp | 38 | ||||
| -rw-r--r-- | view/sharedcache/ui/dsctriage.h | 17 |
2 files changed, 20 insertions, 35 deletions
diff --git a/view/sharedcache/ui/dsctriage.cpp b/view/sharedcache/ui/dsctriage.cpp index faff5161..93a01698 100644 --- a/view/sharedcache/ui/dsctriage.cpp +++ b/view/sharedcache/ui/dsctriage.cpp @@ -130,6 +130,25 @@ void DSCTriageView::loadImagesWithAddr(const std::vector<uint64_t>& addresses, b } +void DSCTriageView::setImageLoaded(const uint64_t imageHeaderAddr) +{ + // Go through the m_imageModel and find the image associated with the address + // then set the image as loaded. + for (int i = 0; i < m_imageModel->rowCount(); i++) + { + auto addrCol = m_imageModel->index(i, 0); + const auto addr = addrCol.data().toString().toULongLong(nullptr, 16); + if (addr == imageHeaderAddr) + { + auto statusCol = m_imageModel->index(i, 1); + // See the `LoadedDelegate` class, we set 1 to indicate that this image is loaded. + m_imageModel->setData(statusCol, "1", Qt::DisplayRole); + break; + } + } +} + + QWidget* DSCTriageView::initImageTable() { m_imageTable = new FilterableTableView(this); @@ -531,22 +550,3 @@ void DSCTriageView::RefreshData() m_symbolTable->populateSymbols(*m_data); } - - -void DSCTriageView::setImageLoaded(const uint64_t imageHeaderAddr) -{ - // Go through the m_loadImageModel and find the image associated with the address - // then set the image as loaded. - for (int i = 0; i < m_imageModel->rowCount(); i++) - { - auto addrCol = m_imageModel->index(i, 0); - const auto addr = addrCol.data().toString().toULongLong(nullptr, 16); - if (addr == imageHeaderAddr) - { - auto statusCol = m_imageModel->index(i, 1); - // See the `LoadedDelegate` class, we set 1 to indicate that this image is loaded. - m_imageModel->setData(statusCol, "1", Qt::DisplayRole); - break; - } - } -}
\ No newline at end of file diff --git a/view/sharedcache/ui/dsctriage.h b/view/sharedcache/ui/dsctriage.h index e847625e..f6ea8cee 100644 --- a/view/sharedcache/ui/dsctriage.h +++ b/view/sharedcache/ui/dsctriage.h @@ -170,21 +170,6 @@ public: } } -// bool eventFilter(QObject* obj, QEvent* event) override { -// if (event->type() == QEvent::KeyPress) { -// auto* keyEvent = dynamic_cast<QKeyEvent*>(event); -// if (keyEvent->key() == Qt::Key_Escape) { -// clearSelection(); -// return true; -// } -// if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) { -// emit activated(currentIndex()); -// return true; -// } -// } -// return QTableView::eventFilter(obj, event); -// } - signals: void filterTextChanged(const QString& text); }; @@ -219,10 +204,10 @@ public: void OnAfterOpenFile(UIContext* context, FileContext* file, ViewFrame* frame) override; void RefreshData(); - void setImageLoaded(uint64_t imageHeaderAddr); private: void loadImagesWithAddr(const std::vector<uint64_t>& addresses, bool includeDependencies = false); + void setImageLoaded(uint64_t imageHeaderAddr); QWidget* initImageTable(); void initSymbolTable(); void initCacheInfoTables(); |
