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.cpp | |
| 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.cpp')
| -rw-r--r-- | plugins/warp/ui/shared/fetcher.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
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 <QSettings> - 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<Warp::SourceTag> 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<std::mutex> 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> WarpFetcher::Global() return global; } -void WarpFetcher::FetchPendingFunctions() +void WarpFetcher::FetchPendingFunctions(const std::vector<Warp::SourceTag>& 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<std::mutex> lock(m_requestMutex); for (const auto &guid: guids) |
