Remove unneeded destructor/copy constructor/copy assignment operator

We don't have a custom destructor and the copy ctor/assignment operator don't do anything special, so the default one will do the right thing.

This is in accordance with the rule of zero (https://cpppatterns.com/patterns/rule-of-zero.html)
This commit is contained in:
Nicolas Fella 2020-07-28 21:03:01 +02:00
parent 1bd59787e2
commit 8f41be36dc
3 changed files with 1 additions and 49 deletions

View file

@ -61,35 +61,6 @@ ConversationMessage::ConversationMessage (const qint32& eventField, const QStrin
{
}
ConversationMessage::ConversationMessage(const ConversationMessage& other)
: m_eventField(other.m_eventField)
, m_body(other.m_body)
, m_addresses(other.m_addresses)
, m_date(other.m_date)
, m_type(other.m_type)
, m_read(other.m_read)
, m_threadID(other.m_threadID)
, m_uID(other.m_uID)
, m_subID(other.m_subID)
{
}
ConversationMessage::~ConversationMessage() { }
ConversationMessage& ConversationMessage::operator=(const ConversationMessage& other)
{
this->m_eventField = other.m_eventField;
this->m_body = other.m_body;
this->m_addresses = other.m_addresses;
this->m_date = other.m_date;
this->m_type = other.m_type;
this->m_read = other.m_read;
this->m_threadID = other.m_threadID;
this->m_uID = other.m_uID;
this->m_subID = other.m_subID;
return *this;
}
ConversationMessage ConversationMessage::fromDBus(const QDBusVariant& var)
{
QDBusArgument data = var.variant().value<QDBusArgument>();
@ -122,19 +93,6 @@ ConversationAddress::ConversationAddress(QString address)
: m_address(address)
{}
ConversationAddress::ConversationAddress(const ConversationAddress& other)
: m_address(other.address())
{}
ConversationAddress::~ConversationAddress()
{}
ConversationAddress& ConversationAddress::operator=(const ConversationAddress& other)
{
this->m_address = other.m_address;
return *this;
}
QVariantMap ConversationAddress::toVariant() const
{
return {

View file

@ -63,9 +63,6 @@ public:
const qint64& date, const qint32& type, const qint32& read,
const qint64& threadID, const qint32& uID, const qint64& subID);
ConversationMessage(const ConversationMessage& other);
~ConversationMessage();
ConversationMessage& operator=(const ConversationMessage& other);
static ConversationMessage fromDBus(const QDBusVariant&);
static void registerDbusType();
@ -146,9 +143,6 @@ class KDECONNECTINTERFACES_EXPORT ConversationAddress
{
public:
ConversationAddress(QString address = QStringLiteral());
ConversationAddress(const ConversationAddress& other);
~ConversationAddress();
ConversationAddress& operator=(const ConversationAddress& other);
QString address() const { return m_address; }

View file

@ -198,7 +198,7 @@ void ConversationsDbusInterface::replyToConversation(const qint64& conversationI
QVariantList addresses;
for (const auto& address : addressList) {
addresses << QVariant::fromValue(addresse);
addresses << QVariant::fromValue(address);
}
m_smsInterface.sendSms(addresses, message, messagesList.first().subID());