From 3e24f6ab0b373d8718e26a19ac296044cc0d19c6 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 7 Oct 2025 14:30:37 -0400 Subject: [WARP] Improved fetch dialog UX - Respects views fetch batch size and allowed tags - Saves and loads from the view settings instead of qt settings --- plugins/warp/ui/shared/fetcher.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'plugins/warp/ui/shared/fetcher.cpp') diff --git a/plugins/warp/ui/shared/fetcher.cpp b/plugins/warp/ui/shared/fetcher.cpp index 767932e3..299050a5 100644 --- a/plugins/warp/ui/shared/fetcher.cpp +++ b/plugins/warp/ui/shared/fetcher.cpp @@ -1,26 +1,8 @@ #include "fetcher.h" -#include - WarpFetcher::WarpFetcher() { m_logger = new BinaryNinja::Logger("WARP Fetcher"); - QSettings qtSettings; - const QString key = "warp/allowedTags"; - - QStringList tags = qtSettings.value(key).toStringList(); - if (tags.isEmpty()) { - tags = QStringList{ "official", "trusted" }; - qtSettings.setValue(key, tags); - qtSettings.sync(); - } - - std::vector initialTags; - initialTags.reserve(tags.size()); - for (const auto& t : tags) - initialTags.emplace_back(t.trimmed().toStdString()); - - SetTags(initialTags); } void WarpFetcher::AddPendingFunction(const FunctionRef &func) @@ -47,7 +29,7 @@ void WarpFetcher::ExecuteCompletionCallback() std::lock_guard lock(m_requestMutex); m_completionCallbacks.erase( std::ranges::remove_if(m_completionCallbacks, - [](const auto &cb) { return cb() != RemoveCallback; }).begin(), + [](const auto &cb) { return cb() == RemoveCallback; }).begin(), m_completionCallbacks.end()); }); } @@ -58,7 +40,7 @@ std::shared_ptr WarpFetcher::Global() return global; } -void WarpFetcher::FetchPendingFunctions() +void WarpFetcher::FetchPendingFunctions(const std::vector& allowedTags) { m_requestInProgress = true; const auto requests = FlushPendingFunctions(); @@ -82,13 +64,12 @@ void WarpFetcher::FetchPendingFunctions() platformMappedGuids[platform].push_back(guid.value()); } - const auto tags = GetTags(); for (const auto &[platform, guids] : platformMappedGuids) { m_logger->LogDebugF("Fetching {} functions for platform {}", guids.size(), platform->GetName()); auto target = Warp::Target::FromPlatform(*platform); for (const auto &container: Warp::Container::All()) - container->FetchFunctions(*target, guids, tags); + container->FetchFunctions(*target, guids, allowedTags); std::lock_guard lock(m_requestMutex); for (const auto &guid: guids) -- cgit v1.3.1