diff --git a/src/core/toxid.cpp b/src/core/toxid.cpp index 58a4cbe5f1..7f18afd975 100644 --- a/src/core/toxid.cpp +++ b/src/core/toxid.cpp @@ -45,8 +45,8 @@ ToxId::ToxId() * @brief The copy constructor. * @param other ToxId to copy */ -ToxId::ToxId(const ToxId& other) - : toxId(other.toxId) +ToxId::ToxId(ToxId&& other) + : toxId(std::move(other.toxId)) { } diff --git a/src/core/toxid.h b/src/core/toxid.h index 1879931bdb..21d4766e82 100644 --- a/src/core/toxid.h +++ b/src/core/toxid.h @@ -23,7 +23,7 @@ class ToxId static constexpr int numHexChars = size * 2; ToxId(); - ToxId(const ToxId& other); + ToxId(ToxId&& other); explicit ToxId(const QString& id); explicit ToxId(const QByteArray& rawId); explicit ToxId(const uint8_t* rawId, int len); @@ -39,7 +39,6 @@ class ToxId static bool isValidToxId(const QString& id); static bool isToxId(const QString& id); const uint8_t* getBytes() const; - QByteArray getToxId() const; ToxPk getPublicKey() const; QString getNoSpamString() const; diff --git a/src/widget/form/addfriendform.cpp b/src/widget/form/addfriendform.cpp index d64ab9fc56..52f4b47ee2 100644 --- a/src/widget/form/addfriendform.cpp +++ b/src/widget/form/addfriendform.cpp @@ -48,7 +48,7 @@ bool checkIsValidId(const QString& id) AddFriendForm::AddFriendForm(ToxId ownId_, Settings& settings_, Style& style_, IMessageBoxManager& messageBoxManager_, Core& core_) - : ownId{ownId_} + : ownId{std::move(ownId_)} , settings{settings_} , style{style_} , messageBoxManager{messageBoxManager_} diff --git a/test/core/toxid_test.cpp b/test/core/toxid_test.cpp index fc58e75a37..60efe64034 100644 --- a/test/core/toxid_test.cpp +++ b/test/core/toxid_test.cpp @@ -26,7 +26,6 @@ private slots: void equalTest(); void notEqualTest(); void clearTest(); - void copyTest(); void validationTest(); }; @@ -60,13 +59,6 @@ void TestToxId::clearTest() QVERIFY(empty == test); } -void TestToxId::copyTest() -{ - ToxId src(testToxId); - ToxId copy = src; - QVERIFY(copy == src); -} - void TestToxId::validationTest() { QVERIFY(ToxId(testToxId).isValid());