settings dlg: Clean errors during apply
Errors are re-added on each OptionPage::apply()
This commit is contained in:
parent
e31c2df570
commit
900e43c7d1
|
@ -10,8 +10,12 @@
|
|||
|
||||
namespace Dialogs {
|
||||
|
||||
class SettingsDialog;
|
||||
|
||||
class QT_UTILITIES_EXPORT OptionPage
|
||||
{
|
||||
friend class SettingsDialog;
|
||||
|
||||
public:
|
||||
explicit OptionPage(QWidget *parentWindow = nullptr);
|
||||
virtual ~OptionPage();
|
||||
|
|
|
@ -225,7 +225,8 @@ bool SettingsDialog::apply()
|
|||
if(errorMessage.isEmpty()) {
|
||||
errorMessage = tr("<p><b>Errors occured when applying changes:</b></p><ul>");
|
||||
}
|
||||
if(const_cast<const OptionPage *>(page)->errors().isEmpty()) {
|
||||
QStringList &errors = const_cast<OptionPage *>(page)->errors();
|
||||
if(errors.isEmpty()) {
|
||||
errorMessage.append(QStringLiteral("<li><i>")
|
||||
% category->displayName()
|
||||
% QLatin1Char('/')
|
||||
|
@ -234,7 +235,7 @@ bool SettingsDialog::apply()
|
|||
% tr("unknonw error")
|
||||
% QStringLiteral("</li>"));
|
||||
} else {
|
||||
for(const QString &error : const_cast<const OptionPage *>(page)->errors()) {
|
||||
for(const QString &error : errors) {
|
||||
errorMessage.append(QStringLiteral("<li><i>")
|
||||
% category->displayName()
|
||||
% QLatin1Char('/')
|
||||
|
@ -243,6 +244,7 @@ bool SettingsDialog::apply()
|
|||
% error
|
||||
% QStringLiteral("</li>"));
|
||||
}
|
||||
errors.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue