diff --git a/autotests/mentiontest.cpp b/autotests/mentiontest.cpp index 52cbe32c..24633183 100644 --- a/autotests/mentiontest.cpp +++ b/autotests/mentiontest.cpp @@ -1,35 +1,37 @@ /* Copyright (c) 2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mentiontest.h" #include "mention.h" #include QTEST_GUILESS_MAIN(MentionTest) MentionTest::MentionTest(QObject *parent) : QObject(parent) { } void MentionTest::shouldHaveDefaultValue() { + //Mention is a Message. NEed to create an autotest ? + Mention m; - QVERIFY(m.message().isEmpty()); + QVERIFY(m.text().isEmpty()); QVERIFY(m.messageId().isEmpty()); } diff --git a/src/ruqolacore/mention.cpp b/src/ruqolacore/mention.cpp index 57d4dd77..6cc0eb06 100644 --- a/src/ruqolacore/mention.cpp +++ b/src/ruqolacore/mention.cpp @@ -1,56 +1,25 @@ /* Copyright (c) 2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mention.h" Mention::Mention() { } -QDebug operator <<(QDebug d, const Mention &t) -{ - d << "Message: " << t.message(); - //TODO - return d; -} - -bool Mention::operator ==(const Mention &other) const -{ - return (mMessage == other.message()); -} - -QString Mention::message() const -{ - return mMessage; -} - -void Mention::setMessage(const QString &message) -{ - mMessage = message; -} - -QString Mention::messageId() const -{ - return mMessageId; -} - -void Mention::setMessageId(const QString &messageId) -{ - mMessageId = messageId; -} diff --git a/src/ruqolacore/mention.h b/src/ruqolacore/mention.h index 9ea04bf3..5242ad47 100644 --- a/src/ruqolacore/mention.h +++ b/src/ruqolacore/mention.h @@ -1,47 +1,35 @@ /* Copyright (c) 2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MENTION_H #define MENTION_H #include "libruqola_private_export.h" +#include "message.h" #include -class LIBRUQOLACORE_TESTS_EXPORT Mention +class LIBRUQOLACORE_TESTS_EXPORT Mention : public Message { Q_GADGET public: Mention(); - - Q_REQUIRED_RESULT bool operator ==(const Mention &other) const; - - Q_REQUIRED_RESULT QString message() const; - void setMessage(const QString &message); - - Q_REQUIRED_RESULT QString messageId() const; - void setMessageId(const QString &messageId); - -private: - QString mMessage; - QString mMessageId; }; Q_DECLARE_METATYPE(Mention) Q_DECLARE_TYPEINFO(Mention, Q_MOVABLE_TYPE); -LIBRUQOLACORE_EXPORT QDebug operator <<(QDebug d, const Mention &t); #endif // MENTION_H