diff options
| author | Mason Reed <mason@vector35.com> | 2025-10-07 14:30:37 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-10-07 14:30:37 -0400 |
| commit | 3e24f6ab0b373d8718e26a19ac296044cc0d19c6 (patch) | |
| tree | b87481dbe7895c2b14761193fce8a6422e452b75 /plugins/warp/ui/shared/fetcher.h | |
| parent | aafb1e7a4ce244b3f0aa25ac201dfbeeff2110e8 (diff) | |
[WARP] Improved fetch dialog UX
- Respects views fetch batch size and allowed tags
- Saves and loads from the view settings instead of qt settings
Diffstat (limited to 'plugins/warp/ui/shared/fetcher.h')
| -rw-r--r-- | plugins/warp/ui/shared/fetcher.h | 33 |
1 files changed, 1 insertions, 32 deletions
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 <unordered_set> #include <vector> #include <functional> -#include <QSettings> #include "warp.h" #include "binaryninjaapi.h" @@ -24,7 +23,6 @@ class WarpFetcher std::mutex m_requestMutex; std::vector<FunctionRef> m_pendingRequests; - // TODO: Easy way to clear this if user wants to refetch. std::unordered_set<Warp::FunctionGUID> 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<bool> m_requestInProgress = false; - // Set the allowed source tags, sources with none of these tags will not be fetched from. - void SetTags(const std::vector<Warp::SourceTag> &tags) - { - std::lock_guard<std::mutex> 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<Warp::SourceTag> GetTags() const - { - std::lock_guard<std::mutex> lock(const_cast<std::mutex &>(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<Warp::SourceTag> initialTags = {}; - for (const auto& t : tags) - initialTags.emplace_back(t.trimmed().toStdString()); - return initialTags; - } - void AddCompletionCallback(std::function<WarpFetchCompletionStatus()> cb) { std::lock_guard<std::mutex> lock(m_requestMutex); @@ -75,7 +44,7 @@ public: void AddPendingFunction(const FunctionRef &func); - void FetchPendingFunctions(); + void FetchPendingFunctions(const std::vector<Warp::SourceTag>& allowedTags); void ClearProcessed(); private: |
