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.h | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'plugins/warp/ui/shared/fetcher.h') diff --git a/plugins/warp/ui/shared/fetcher.h b/plugins/warp/ui/shared/fetcher.h index a7195ac4..917ac912 100644 --- a/plugins/warp/ui/shared/fetcher.h +++ b/plugins/warp/ui/shared/fetcher.h @@ -5,7 +5,6 @@ #include #include #include -#include #include "warp.h" #include "binaryninjaapi.h" @@ -24,7 +23,6 @@ class WarpFetcher std::mutex m_requestMutex; std::vector m_pendingRequests; - // TODO: Easy way to clear this if user wants to refetch. std::unordered_set m_processedGuids; // List of callbacks to call when done fetching data, assume that others are using this as well. @@ -38,35 +36,6 @@ public: std::atomic m_requestInProgress = false; - // Set the allowed source tags, sources with none of these tags will not be fetched from. - void SetTags(const std::vector &tags) - { - std::lock_guard lock(m_requestMutex); - // TODO: This is kinda a hack, the fetcher instance should not sync through qt settings! - QStringList qtTags = {}; - for (const auto& t : tags) - qtTags.append(QString::fromStdString(t)); - QSettings().setValue("warp/allowedTags", qtTags); - } - - std::vector GetTags() const - { - std::lock_guard lock(const_cast(m_requestMutex)); - // TODO: This is kinda a hack, the fetcher instance should not sync through qt settings! - QSettings qtSettings; - QStringList tags = qtSettings.value("warp/allowedTags").toStringList(); - if (tags.isEmpty()) { - // The default tags to allow. - tags = QStringList{ "official", "trusted" }; - qtSettings.setValue("warp/allowedTags", tags); - qtSettings.sync(); - } - std::vector initialTags = {}; - for (const auto& t : tags) - initialTags.emplace_back(t.trimmed().toStdString()); - return initialTags; - } - void AddCompletionCallback(std::function cb) { std::lock_guard lock(m_requestMutex); @@ -75,7 +44,7 @@ public: void AddPendingFunction(const FunctionRef &func); - void FetchPendingFunctions(); + void FetchPendingFunctions(const std::vector& allowedTags); void ClearProcessed(); private: -- cgit v1.3.1