Commit 5ca701a5 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Simplify interface of SelfTestDialog

Remove unused method addSelfTest. Replace separate methods clear and
addSelfTests with single method setTests.

GnuPG-bug-id: 6101
parent 5cf3c582
......@@ -144,8 +144,7 @@ private:
ensureDialogCreated();
dialog->clear();
dialog->addSelfTests(tests);
dialog->setTests(tests);
ensureDialogShown();
}
......
......@@ -452,19 +452,9 @@ SelfTestDialog::SelfTestDialog(QWidget *p, Qt::WindowFlags f)
SelfTestDialog::~SelfTestDialog() = default;
void SelfTestDialog::clear()
void SelfTestDialog::setTests(const std::vector<std::shared_ptr<SelfTest>> &tests)
{
d->model.clear();
}
void SelfTestDialog::addSelfTest(const std::shared_ptr<SelfTest> &test)
{
d->model.append(std::vector<std::shared_ptr<SelfTest>>(1, test));
d->updateColumnSizes();
}
void SelfTestDialog::addSelfTests(const std::vector<std::shared_ptr<SelfTest>> &tests)
{
d->model.append(tests);
d->updateColumnSizes();
}
......
......@@ -34,15 +34,11 @@ public:
void setAutomaticMode(bool automatic);
void addSelfTest(const std::shared_ptr<SelfTest> &test);
void addSelfTests(const std::vector<std::shared_ptr<SelfTest>> &tests);
void setTests(const std::vector<std::shared_ptr<SelfTest>> &tests);
void setRunAtStartUp(bool run);
bool runAtStartUp() const;
public Q_SLOTS:
void clear();
Q_SIGNALS:
void updateRequested();
......
Supports Markdown
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