From 3c88b11e5df33116580ac008e36092775df66135 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 13 Mar 2026 12:24:18 -0700 Subject: [WARP] Improved UX and API - Exposes WARP type objects directly - Adds processor API (for generating warp files directly) - Adds file and chunk API - Misc cleanup - Simplified the amount of commands - Replaced the "Create" commands with a purpose built processor dialog - Added a native QT viewer for WARP files - Simplified committing to a remote with a purpose built commit dialog --- plugins/warp/ui/shared/search.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'plugins/warp/ui/shared/search.cpp') diff --git a/plugins/warp/ui/shared/search.cpp b/plugins/warp/ui/shared/search.cpp index a852605e..801aa23d 100644 --- a/plugins/warp/ui/shared/search.cpp +++ b/plugins/warp/ui/shared/search.cpp @@ -1,6 +1,6 @@ #include "search.h" #include "misc.h" -#include "../../../../../ui/mainwindow.h" +#include "viewframe.h" QVariant WarpSearchModel::data(const QModelIndex& index, int role) const { @@ -12,8 +12,8 @@ QVariant WarpSearchModel::data(const QModelIndex& index, int role) const if (role == Qt::UserRole && index.column() == DisplayCol) { if (it && it->GetKind() == WARPContainerSearchItemKindFunction) - if (auto itemType = it->GetType(nullptr)) - return QVariant::fromValue(TokenData(*itemType, it->GetName())); + if (auto itemType = it->GetType()) + return QVariant::fromValue(TokenData(*itemType->GetAnalysisType(), it->GetName())); return {}; } @@ -246,21 +246,16 @@ WarpSearchWidget::WarpSearchWidget(Warp::Ref container, QWidget return; // TODO: Getting the current view here is really awful, but i dont care right now. - auto ctx = MainWindow::activeContext(); + auto ctx = UIContext::activeContext(); auto view = ctx->getCurrentView(); auto binaryView = view->getData(); auto viewFrame = ctx->getCurrentViewFrame(); auto viewLocation = viewFrame->getViewLocation(); auto func = viewLocation.getFunction(); - // Retrieve the current architecture from the current function or try the current view. - auto arch = binaryView->GetDefaultArchitecture(); - if (func) - arch = func->GetArchitecture(); - const int row = idx.row(); const auto item = m_model->itemAt(row); - const auto itemType = item->GetType(arch); + const auto itemType = item->GetType(); const auto itemFunc = item->GetFunction(); QMenu menu(this); @@ -272,7 +267,7 @@ WarpSearchWidget::WarpSearchWidget(Warp::Ref container, QWidget // We let users apply the type for types and functions (assuming the function has one) // if the user applies a function, we actually will set the user type for the current view location function. // For types, we will just throw it in the user types. - applyType->setEnabled(itemType != nullptr); + applyType->setEnabled(itemType->m_object != nullptr); applyType->setVisible(applyType->isEnabled()); applyFunction->setEnabled(func != nullptr && itemFunc); @@ -294,11 +289,12 @@ WarpSearchWidget::WarpSearchWidget(Warp::Ref container, QWidget { if (func && item->GetKind() == WARPContainerSearchItemKindFunction) { - func->SetUserType(itemType); + func->SetUserType(itemType->GetAnalysisType(func->GetArchitecture())); binaryView->UpdateAnalysis(); } else - binaryView->DefineUserType(item->GetName(), itemType); + binaryView->DefineUserType( + item->GetName(), itemType->GetAnalysisType(binaryView->GetDefaultArchitecture())); } else if (chosen == applyFunction) { -- cgit v1.3.1