diff options
| author | Alexander Khosrowshahi <alexk@vector35.com> | 2025-06-30 14:56:41 -0400 |
|---|---|---|
| committer | Alexander Khosrowshahi <alexk@vector35.com> | 2025-07-03 13:47:57 -0400 |
| commit | 2be7b54b7bc7a0e46408b228ee55bbb4fe342e6c (patch) | |
| tree | 8c55b55ccaef570f6388411d7f990dbcc6a710ab /examples | |
| parent | 2cd19b867772f15d87eaee9560b94a9fd9ba13e4 (diff) | |
Add GetPathInProject() to core API
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/triage/fileinfo.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/triage/fileinfo.cpp b/examples/triage/fileinfo.cpp index 3250feae..b521b892 100644 --- a/examples/triage/fileinfo.cpp +++ b/examples/triage/fileinfo.cpp @@ -72,9 +72,18 @@ FileInfoWidget::FileInfoWidget(QWidget* parent, BinaryViewRef bv) this->m_layout->setVerticalSpacing(1); const auto view = bv->GetParentView() ? bv->GetParentView() : bv; - const auto filePath = bv->GetFile()->GetOriginalFilename(); + + const auto file = bv->GetFile(); + const auto filePath = file->GetOriginalFilename(); this->addCopyableField("Path: ", filePath.c_str()); + // If triage view is opened from a project, show both actual filepath and path relative to project + if (const auto fileProjectRef = file->GetProjectFile()) + { + const auto projectFilePath = file->GetProjectFile()->GetPathInProject(); + this->addCopyableField("Path in project: ", projectFilePath.c_str()); + } + const auto fileSize = QString::number(view->GetLength(), 16).prepend("0x"); this->addCopyableField("Size: ", fileSize); |
