mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Cleanup compiler warnings on all platforms (#10847)
Fixes #10730. Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
This commit is contained in:
parent
af3b4074e2
commit
c3df16147d
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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(" <<"));
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user