Commit 76e867f7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Implement isValid()

parent 6bca4a64
Pipeline #92540 canceled with stage
......@@ -19,4 +19,5 @@ void ScamDetectionInfoTest::shouldHaveDefaultValues()
MessageViewer::ScamDetectionInfo info;
QVERIFY(!info.enabled());
QVERIFY(info.domainOrEmail().isEmpty());
QVERIFY(!info.isValid());
}
......@@ -35,6 +35,11 @@ void ScamDetectionInfo::setEnabled(bool newEnabled)
mEnabled = newEnabled;
}
bool ScamDetectionInfo::isValid() const
{
return !mDomainOrEmail.isEmpty();
}
QDebug operator<<(QDebug d, const MessageViewer::ScamDetectionInfo &t)
{
d << "Enabled " << t.enabled();
......
......@@ -25,6 +25,8 @@ public:
Q_REQUIRED_RESULT bool enabled() const;
void setEnabled(bool newEnabled);
Q_REQUIRED_RESULT bool isValid() const;
private:
QString mDomainOrEmail;
bool mEnabled = false;
......
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