Forbid usage of context-less connections
Some checks failed
CI - Python / Check (push) Has been cancelled
CI - Ubuntu / Build (push) Has been cancelled
CI - File health / Check (push) Has been cancelled
CI - macOS / Build (push) Has been cancelled
CI - WebUI / Check (push) Has been cancelled
CI - Windows / Build (push) Has been cancelled

PR #23032.
This commit is contained in:
Vladimir Golovnev 2025-08-06 16:28:31 +03:00 committed by GitHub
commit de7d9c960d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 5 deletions

View file

@ -24,6 +24,7 @@ target_compile_definitions(qbt_common_cfg INTERFACE
QT_NO_CAST_FROM_ASCII QT_NO_CAST_FROM_ASCII
QT_NO_CAST_TO_ASCII QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY QT_NO_CAST_FROM_BYTEARRAY
QT_NO_CONTEXTLESS_CONNECT
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
QT_USE_QSTRINGBUILDER QT_USE_QSTRINGBUILDER
QT_STRICT_ITERATORS QT_STRICT_ITERATORS

View file

@ -1649,7 +1649,7 @@ void SessionImpl::endStartup(ResumeSessionContext *context)
if (context->currentStorageType == ResumeDataStorageType::Legacy) if (context->currentStorageType == ResumeDataStorageType::Legacy)
{ {
connect(context->startupStorage, &QObject::destroyed, [dbPath] connect(context->startupStorage, &QObject::destroyed, this, [dbPath]
{ {
Utils::Fs::removeFile(dbPath); Utils::Fs::removeFile(dbPath);
}); });

View file

@ -118,7 +118,7 @@ AutoDownloader::AutoDownloader(IApplication *app)
m_fileStorage->moveToThread(m_ioThread.get()); m_fileStorage->moveToThread(m_ioThread.get());
connect(m_ioThread.get(), &QThread::finished, m_fileStorage, &AsyncFileStorage::deleteLater); connect(m_ioThread.get(), &QThread::finished, m_fileStorage, &AsyncFileStorage::deleteLater);
connect(m_fileStorage, &AsyncFileStorage::failed, [](const Path &fileName, const QString &errorString) connect(m_fileStorage, &AsyncFileStorage::failed, this, [](const Path &fileName, const QString &errorString)
{ {
LogMsg(tr("Couldn't save RSS AutoDownloader data in %1. Error: %2") LogMsg(tr("Couldn't save RSS AutoDownloader data in %1. Error: %2")
.arg(fileName.toString(), errorString), Log::CRITICAL); .arg(fileName.toString(), errorString), Log::CRITICAL);

View file

@ -74,7 +74,7 @@ Session::Session()
m_confFileStorage = new AsyncFileStorage(specialFolderLocation(SpecialFolder::Config) / Path(CONF_FOLDER_NAME)); m_confFileStorage = new AsyncFileStorage(specialFolderLocation(SpecialFolder::Config) / Path(CONF_FOLDER_NAME));
m_confFileStorage->moveToThread(m_workingThread.get()); m_confFileStorage->moveToThread(m_workingThread.get());
connect(m_workingThread.get(), &QThread::finished, m_confFileStorage, &AsyncFileStorage::deleteLater); connect(m_workingThread.get(), &QThread::finished, m_confFileStorage, &AsyncFileStorage::deleteLater);
connect(m_confFileStorage, &AsyncFileStorage::failed, [](const Path &fileName, const QString &errorString) connect(m_confFileStorage, &AsyncFileStorage::failed, this, [](const Path &fileName, const QString &errorString)
{ {
LogMsg(tr("Couldn't save RSS session configuration. File: \"%1\". Error: \"%2\"") LogMsg(tr("Couldn't save RSS session configuration. File: \"%1\". Error: \"%2\"")
.arg(fileName.toString(), errorString), Log::WARNING); .arg(fileName.toString(), errorString), Log::WARNING);
@ -83,7 +83,7 @@ Session::Session()
m_dataFileStorage = new AsyncFileStorage(specialFolderLocation(SpecialFolder::Data) / Path(DATA_FOLDER_NAME)); m_dataFileStorage = new AsyncFileStorage(specialFolderLocation(SpecialFolder::Data) / Path(DATA_FOLDER_NAME));
m_dataFileStorage->moveToThread(m_workingThread.get()); m_dataFileStorage->moveToThread(m_workingThread.get());
connect(m_workingThread.get(), &QThread::finished, m_dataFileStorage, &AsyncFileStorage::deleteLater); connect(m_workingThread.get(), &QThread::finished, m_dataFileStorage, &AsyncFileStorage::deleteLater);
connect(m_dataFileStorage, &AsyncFileStorage::failed, [](const Path &fileName, const QString &errorString) connect(m_dataFileStorage, &AsyncFileStorage::failed, this, [](const Path &fileName, const QString &errorString)
{ {
LogMsg(tr("Couldn't save RSS session data. File: \"%1\". Error: \"%2\"") LogMsg(tr("Couldn't save RSS session data. File: \"%1\". Error: \"%2\"")
.arg(fileName.toString(), errorString), Log::WARNING); .arg(fileName.toString(), errorString), Log::WARNING);

View file

@ -376,7 +376,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::TorrentDescriptor &to
connect(m_filterLine, &LineEdit::textChanged, this, &AddNewTorrentDialog::setContentFilterPattern); connect(m_filterLine, &LineEdit::textChanged, this, &AddNewTorrentDialog::setContentFilterPattern);
connect(m_ui->buttonSelectAll, &QPushButton::clicked, m_ui->contentTreeView, &TorrentContentWidget::checkAll); connect(m_ui->buttonSelectAll, &QPushButton::clicked, m_ui->contentTreeView, &TorrentContentWidget::checkAll);
connect(m_ui->buttonSelectNone, &QPushButton::clicked, m_ui->contentTreeView, &TorrentContentWidget::checkNone); connect(m_ui->buttonSelectNone, &QPushButton::clicked, m_ui->contentTreeView, &TorrentContentWidget::checkNone);
connect(Preferences::instance(), &Preferences::changed, [] connect(Preferences::instance(), &Preferences::changed, this, []
{ {
const int length = Preferences::instance()->addNewTorrentDialogSavePathHistoryLength(); const int length = Preferences::instance()->addNewTorrentDialogSavePathHistoryLength();
settings()->storeValue(KEY_SAVEPATHHISTORY, settings()->loadValue<QStringList>(KEY_SAVEPATHHISTORY).mid(0, length)); settings()->storeValue(KEY_SAVEPATHHISTORY, settings()->loadValue<QStringList>(KEY_SAVEPATHHISTORY).mid(0, length));