mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-01-07 19:45:58 -05:00
Resolve REF:P@I during healthCheck
This commit is contained in:
parent
10bd651355
commit
eeed657a75
3 changed files with 21 additions and 1 deletions
|
|
@ -20,10 +20,12 @@
|
|||
#include "ui_PasswordWidget.h"
|
||||
|
||||
#include "core/Config.h"
|
||||
#include "core/Entry.h"
|
||||
#include "core/PasswordHealth.h"
|
||||
#include "gui/Font.h"
|
||||
#include "gui/Icons.h"
|
||||
#include "gui/PasswordGeneratorWidget.h"
|
||||
#include "gui/entry/EditEntryWidget.h"
|
||||
#include "gui/osutils/OSUtils.h"
|
||||
#include "gui/styles/StateColorPalette.h"
|
||||
|
||||
|
|
@ -109,6 +111,11 @@ void PasswordWidget::setQualityVisible(bool state)
|
|||
m_ui->qualityProgressBar->setVisible(state);
|
||||
}
|
||||
|
||||
void PasswordWidget::setEntry(Entry* entry)
|
||||
{
|
||||
m_entry = entry;
|
||||
}
|
||||
|
||||
QString PasswordWidget::text()
|
||||
{
|
||||
return m_ui->passwordEdit->text();
|
||||
|
|
@ -270,7 +277,14 @@ void PasswordWidget::updatePasswordStrength(const QString& password)
|
|||
return;
|
||||
}
|
||||
|
||||
PasswordHealth health(password);
|
||||
QString passwordToCheck = password;
|
||||
if (m_entry) {
|
||||
QString resolvedPwd = m_entry->resolvePlaceholder(passwordToCheck);
|
||||
if (!resolvedPwd.isEmpty()) {
|
||||
passwordToCheck = resolvedPwd;
|
||||
}
|
||||
}
|
||||
PasswordHealth health(passwordToCheck);
|
||||
|
||||
m_ui->qualityProgressBar->setValue(std::min(int(health.entropy()), m_ui->qualityProgressBar->maximum()));
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
class Entry;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class PasswordWidget;
|
||||
|
|
@ -40,6 +42,7 @@ public:
|
|||
void enablePasswordGenerator();
|
||||
void setRepeatPartner(PasswordWidget* repeatPartner);
|
||||
void setQualityVisible(bool state);
|
||||
void setEntry(Entry* entry);
|
||||
|
||||
bool isPasswordVisible() const;
|
||||
QString text();
|
||||
|
|
@ -77,6 +80,7 @@ private:
|
|||
QPointer<QAction> m_capslockAction;
|
||||
QPointer<PasswordWidget> m_repeatPasswordWidget;
|
||||
QPointer<PasswordWidget> m_parentPasswordWidget;
|
||||
QPointer<Entry> m_entry;
|
||||
|
||||
bool m_capslockState = false;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1005,6 +1005,7 @@ void EditEntryWidget::setForms(Entry* entry, bool restore)
|
|||
|
||||
m_mainUi->titleEdit->setText(entry->title());
|
||||
m_mainUi->usernameComboBox->lineEdit()->setText(entry->username());
|
||||
m_mainUi->passwordEdit->setEntry(entry);
|
||||
m_mainUi->urlEdit->setText(entry->url());
|
||||
m_mainUi->passwordEdit->setText(entry->password());
|
||||
m_mainUi->passwordEdit->setShowPassword(!config()->get(Config::Security_PasswordsHidden).toBool());
|
||||
|
|
@ -1252,6 +1253,7 @@ bool EditEntryWidget::commitEntry()
|
|||
setPageHidden(m_historyWidget, m_history || m_entry->historyItems().count() < 1);
|
||||
m_advancedUi->attachmentsWidget->linkAttachments(m_entry->attachments());
|
||||
|
||||
m_mainUi->passwordEdit->setEntry(m_entry);
|
||||
showMessage(tr("Entry updated successfully."), MessageWidget::Positive);
|
||||
setModified(false);
|
||||
// Prevent a reload due to entry modified signals
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue