Commit 8b8df797 authored by Stefano Crocco's avatar Stefano Crocco Committed by David Faure
Browse files

Hide the details widget and delete its contents when the password bar is closed

parent 95aca8aa
......@@ -43,3 +43,7 @@ void CredentialsDetailsWidget::setForms(const WebEngineWallet::WebFormList& form
m_model->setForms(forms);
}
void CredentialsDetailsWidget::clear()
{
m_model->clearForms();
}
......@@ -40,6 +40,7 @@ public:
~CredentialsDetailsWidget() override;
void setForms(const WebEngineWallet::WebFormList &forms);
void clear();
private:
QScopedPointer<Ui::CredentialsDetailsWidget> m_ui;
......
......@@ -110,6 +110,10 @@ void PasswordBar::clear()
{
m_requestKey.clear();
m_url.clear();
if (m_detailsWidget) {
m_detailsWidget->clear();
m_detailsWidget->hide();
}
}
void PasswordBar::resizeEvent(QResizeEvent* event)
......
......@@ -87,6 +87,7 @@ WebFieldsDataModel::~WebFieldsDataModel()
void WebFieldsDataModel::setForms(const WebEngineWallet::WebFormList &forms)
{
m_forms = forms;
removeRows(0, rowCount());
for (int i = 0; i < m_forms.size(); ++i) {
const WebForm &form = m_forms.at(i);
for (int j = 0; j < form.fields.size(); ++j) {
......@@ -96,6 +97,12 @@ void WebFieldsDataModel::setForms(const WebEngineWallet::WebFormList &forms)
}
}
void WebFieldsDataModel::clearForms()
{
m_forms.clear();
removeRows(0, rowCount());
}
WebEngineWallet::WebFormList WebFieldsDataModel::checkedFields() const
{
if (!m_checkableItems) {
......
......@@ -161,6 +161,11 @@ public:
*/
bool areItemsCheckable() const {return m_checkableItems;}
/**
* @brief Remove the contents from the model
*/
void clearForms();
private:
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment