Clear quick unlock secrets when database tab is closed
This commit is contained in:
committed by
Jonathan White
parent
7eb7172635
commit
5c45cf2d76
@@ -529,8 +529,16 @@ bool DatabaseOpenWidget::isOnQuickUnlockScreen()
|
|||||||
return m_ui->centralStack->currentIndex() == 1;
|
return m_ui->centralStack->currentIndex() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset installed quick unlock secrets.
|
||||||
|
*
|
||||||
|
* It's safe to call this method even if quick unlock is unavailable.
|
||||||
|
*/
|
||||||
void DatabaseOpenWidget::resetQuickUnlock()
|
void DatabaseOpenWidget::resetQuickUnlock()
|
||||||
{
|
{
|
||||||
|
if (!isQuickUnlockAvailable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
#if defined(Q_CC_MSVC)
|
#if defined(Q_CC_MSVC)
|
||||||
getWindowsHello()->reset(m_filename);
|
getWindowsHello()->reset(m_filename);
|
||||||
#elif defined(Q_OS_MACOS)
|
#elif defined(Q_OS_MACOS)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public:
|
|||||||
void clearForms();
|
void clearForms();
|
||||||
void enterKey(const QString& pw, const QString& keyFile);
|
void enterKey(const QString& pw, const QString& keyFile);
|
||||||
QSharedPointer<Database> database();
|
QSharedPointer<Database> database();
|
||||||
|
void resetQuickUnlock();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dialogFinished(bool accepted);
|
void dialogFinished(bool accepted);
|
||||||
@@ -56,7 +57,6 @@ protected:
|
|||||||
void setUserInteractionLock(bool state);
|
void setUserInteractionLock(bool state);
|
||||||
// Quick Unlock helper functions
|
// Quick Unlock helper functions
|
||||||
bool isOnQuickUnlockScreen();
|
bool isOnQuickUnlockScreen();
|
||||||
void resetQuickUnlock();
|
|
||||||
|
|
||||||
const QScopedPointer<Ui::DatabaseOpenWidget> m_ui;
|
const QScopedPointer<Ui::DatabaseOpenWidget> m_ui;
|
||||||
QSharedPointer<Database> m_db;
|
QSharedPointer<Database> m_db;
|
||||||
|
|||||||
@@ -1569,6 +1569,7 @@ void DatabaseWidget::closeEvent(QCloseEvent* event)
|
|||||||
event->ignore();
|
event->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
m_databaseOpenWidget->resetQuickUnlock();
|
||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user