Commit e6d796d1 authored by Eugene Popov's avatar Eugene Popov 🇺🇦 Committed by Aleix Pol Gonzalez
Browse files

Fix saving file dialog view options

Currently, the view options are only saved when the user clicks OK or Cancel button. This MR makes the file dialog to write view options even if the user closes the window in any other way.


(cherry picked from commit 9d217b4f)
parent bcfb57a6
Pipeline #159317 passed with stage
in 52 seconds
......@@ -142,12 +142,16 @@ FileDialog::FileDialog(QDialog *parent, Qt::WindowFlags flags)
m_buttons = new QDialogButtonBox(this);
m_buttons->addButton(m_fileWidget->okButton(), QDialogButtonBox::AcceptRole);
m_buttons->addButton(m_fileWidget->cancelButton(), QDialogButtonBox::RejectRole);
connect(m_buttons, &QDialogButtonBox::rejected, m_fileWidget, &KFileWidget::slotCancel);
connect(m_fileWidget->okButton(), &QAbstractButton::clicked, m_fileWidget, &KFileWidget::slotOk);
layout()->addWidget(m_buttons);
// accept
connect(m_buttons, &QDialogButtonBox::accepted, m_fileWidget, &KFileWidget::slotOk);
connect(m_fileWidget, &KFileWidget::accepted, m_fileWidget, &KFileWidget::accept);
connect(m_fileWidget, &KFileWidget::accepted, this, &QDialog::accept);
connect(m_fileWidget->cancelButton(), &QAbstractButton::clicked, this, &QDialog::reject);
layout()->addWidget(m_buttons);
// reject
connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(this, &QDialog::rejected, m_fileWidget, &KFileWidget::slotCancel);
// restore window size
if (m_configGroup.exists()) {
......
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