Cleanup compiler warnings on all platforms (#10847)

Fixes #10730.

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
This commit is contained in:
Carlo Teubner 2024-06-13 02:25:15 +01:00 committed by GitHub
parent af3b4074e2
commit c3df16147d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 15 deletions

View File

@ -515,20 +515,23 @@ void BrowserService::showPasswordGenerator(const KeyPairMessage& keyPairMessage)
if (!m_passwordGenerator) {
m_passwordGenerator = PasswordGeneratorWidget::popupGenerator();
connect(m_passwordGenerator.data(), &PasswordGeneratorWidget::closed, m_passwordGenerator.data(), [=] {
if (!m_passwordGenerator->isPasswordGenerated()) {
auto errorMessage = browserMessageBuilder()->getErrorReply("generate-password",
ERROR_KEEPASS_ACTION_CANCELLED_OR_DENIED);
m_browserHost->sendClientMessage(keyPairMessage.socket, errorMessage);
}
connect(m_passwordGenerator.data(),
&PasswordGeneratorWidget::closed,
m_passwordGenerator.data(),
[this, keyPairMessage] {
if (!m_passwordGenerator->isPasswordGenerated()) {
auto errorMessage = browserMessageBuilder()->getErrorReply(
"generate-password", ERROR_KEEPASS_ACTION_CANCELLED_OR_DENIED);
m_browserHost->sendClientMessage(keyPairMessage.socket, errorMessage);
}
QTimer::singleShot(50, this, [&] { hideWindow(); });
});
QTimer::singleShot(50, this, [&] { hideWindow(); });
});
connect(m_passwordGenerator.data(),
&PasswordGeneratorWidget::appliedPassword,
m_passwordGenerator.data(),
[=](const QString& password) {
[this, keyPairMessage](const QString& password) {
const Parameters params{{"password", password}};
m_browserHost->sendClientMessage(keyPairMessage.socket,
browserMessageBuilder()->buildResponse("generate-password",

View File

@ -116,9 +116,9 @@ void FileWatcher::checkFileChanged()
// Prevent reentrance
m_ignoreFileChange = true;
AsyncTask::runThenCallback([=] { return calculateChecksum(); },
AsyncTask::runThenCallback([this] { return calculateChecksum(); },
this,
[=](QByteArray checksum) {
[this](QByteArray checksum) {
if (checksum != m_fileChecksum) {
m_fileChecksum = checksum;
m_fileChangeDelayTimer.start(0);

View File

@ -101,7 +101,7 @@ AccessControlDialog::AccessControlDialog(QWindow* parent,
connect(cancelButton, &QPushButton::clicked, this, [this]() { done(DenyAll); });
connect(allowButton, &QPushButton::clicked, this, [this]() { done(AllowSelected); });
connect(allowAllButton, &QPushButton::clicked, this, [this]() { done(AllowAll); });
connect(detailsButton, &QPushButton::clicked, this, [=](bool checked) {
connect(detailsButton, &QPushButton::clicked, this, [this, detailsButton, detailsButtonText](bool checked) {
m_ui->detailsContainer->setVisible(checked);
if (checked) {
detailsButton->setText(detailsButtonText + QStringLiteral(" <<"));

View File

@ -83,7 +83,7 @@ DatabaseOpenDialog::DatabaseOpenDialog(QWidget* parent)
void DatabaseOpenDialog::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
QTimer::singleShot(100, this, [=] {
QTimer::singleShot(100, this, [this] {
if (m_view->isOnQuickUnlockScreen() && !m_view->unlockingDatabase()) {
m_view->triggerQuickUnlock();
}

View File

@ -124,10 +124,10 @@ void TestDatabase::testSaveAs()
QCOMPARE(spyFilePathChanged.count(), 1);
QVERIFY(QFile::exists(newDbFileName));
#ifdef Q_OS_WIN
QVERIFY(!QFileInfo::QFileInfo(newDbFileName).isHidden());
QVERIFY(!QFileInfo(newDbFileName).isHidden());
SetFileAttributes(newDbFileName.toStdString().c_str(), FILE_ATTRIBUTE_HIDDEN);
QVERIFY2(db->saveAs(newDbFileName, Database::Atomic, QString(), &error), error.toLatin1());
QVERIFY(QFileInfo::QFileInfo(newDbFileName).isHidden());
QVERIFY(QFileInfo(newDbFileName).isHidden());
#endif
QFile::remove(newDbFileName);
QVERIFY(!QFile::exists(newDbFileName));