summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/triage/fileinfo.cpp11
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);