Propagate error messages from search engine

This will be useful for development and debugging issues. The messages will be outputted to both console and qbt logger.
Note that having stderr messages does not always mean the operation failed but there might be some (non-fatal) issues.

PR #23293.
Closes #6553. Closes #22381. Closes #23052.
This commit is contained in:
Chocobo1
2025-09-27 15:42:51 +08:00
committed by GitHub
parent 3de2a9f486
commit 10b879bdaf
8 changed files with 85 additions and 27 deletions

View File

@@ -114,8 +114,8 @@ void SearchController::startAction()
const auto id = generateSearchId();
const std::shared_ptr<SearchHandler> searchHandler {SearchPluginManager::instance()->startSearch(pattern, category, pluginsToUse)};
QObject::connect(searchHandler.get(), &SearchHandler::searchFinished, this, [id, this]() { m_activeSearches.remove(id); });
QObject::connect(searchHandler.get(), &SearchHandler::searchFailed, this, [id, this]() { m_activeSearches.remove(id); });
connect(searchHandler.get(), &SearchHandler::searchFinished, this, [this, id] { m_activeSearches.remove(id); });
connect(searchHandler.get(), &SearchHandler::searchFailed, this, [this, id]([[maybe_unused]] const QString &errorMessage) { m_activeSearches.remove(id); });
m_searchHandlers.insert(id, searchHandler);
@@ -235,8 +235,8 @@ void SearchController::downloadTorrentAction()
else
{
SearchDownloadHandler *downloadHandler = SearchPluginManager::instance()->downloadTorrent(pluginName, torrentUrl);
connect(downloadHandler, &SearchDownloadHandler::downloadFinished
, this, [this, downloadHandler](const QString &source)
connect(downloadHandler, &SearchDownloadHandler::downloadFinished, this
, [this, downloadHandler](const QString &source, [[maybe_unused]] const QString &errorMessage)
{
app()->addTorrentManager()->addTorrent(source);
downloadHandler->deleteLater();