common: Remove the copy assignment operator from DccConfig
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 30 Aug 2019 19:54:47 +0000 (21:54 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 30 Aug 2019 22:34:29 +0000 (00:34 +0200)
Since C++11 the standard no longer mandates the existence of an
implicit copy constructor if there is a user-supplied copy assignment
operator, and GCC 9 warns about that:

src/qtui/settingspages/dccsettingspage.cpp: In member function ‘virtual void DccSettingsPage::load()’:
src/qtui/settingspages/dccsettingspage.cpp:91:71: warning: implicitly-declared ‘DccConfig::DccConfig(const DccConfig&)’ is deprecated [-Wdeprecated-copy]

Remove the copy assignment operator altogether and rely on the
implicitly generated one, which does the same thing.

src/common/dccconfig.cpp
src/common/dccconfig.h

index 800ae88..93f6e9f 100644 (file)
@@ -37,22 +37,6 @@ DccConfig::DccConfig(QObject* parent)
     setAllowClientUpdates(true);
 }
 
-DccConfig& DccConfig::operator=(const DccConfig& other)
-{
-    if (this == &other)
-        return *this;
-
-    SyncableObject::operator=(other);
-
-    static auto propCount = staticMetaObject.propertyCount();
-    for (int i = 0; i < propCount; ++i) {
-        auto propName = staticMetaObject.property(i).name();
-        setProperty(propName, other.property(propName));
-    }
-
-    return *this;
-}
-
 bool DccConfig::operator==(const DccConfig& other)
 {
     // NOTE: We don't compare the SyncableObject attributes (isInitialized, clientUpdatesAllowed())
index 565ddf8..67fd9ef 100644 (file)
@@ -88,16 +88,6 @@ public:
      */
     DccConfig(QObject* parent = nullptr);
 
-    /**
-     * Assignment operator.
-     *
-     * @note Only assigns properties relevant for config management!
-     *
-     * @param[in] other Right-hand side instance
-     * @returns The updated instance
-     */
-    DccConfig& operator=(const DccConfig& other);
-
     /**
      * Equality operator.
      *