common: Make SyncableObject non-copyable
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 27 May 2020 21:21:20 +0000 (23:21 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 30 May 2020 12:12:02 +0000 (14:12 +0200)
commit673ded0d543cbdc2cf6e746b6bee7c1d21af8f90
tree08d46819879d588b4576c7e616e87021766f8ed7
parentd48c2331b38ae46732ac1ab9f35a3a0b85100f92
common: Make SyncableObject non-copyable

QObjects are non-copyable for good reasons. SyncableObject, although
deriving from QObject, was made sort-of copyable by adding custom copy
ctor and copy assignment operator that did not make a full copy of the
underlying QObject, but just copied (most) properties. Several classes
deriving from SyncableObject then implemented their own versions of
those special member functions on top of that. This was not only
rather unexpected and intransparent behavior due to the incomplete
copy functionality, but also a most fragile hack since one had to
remember to update those functions when adding or modifying
properties.

In addition, newer compilers apply a somewhat stricter interpretation
of the C++ standard, basically enforcing the Rule of Three by omitting
implicit generation of copy ctor and/or copy assignment operating
in case certain user-defined special member functions exist. In
particular, Clang 10 started to emit several warnings (and we already
worked around a similar warning from GCC 9+ in cc21148).

Instead of adding more workarounds further obfuscating matters, remove
the relevant special member functions altogether and thus make
SyncableObject and its derivatives non-copyable as they should be.
Modify affected code to cope with this cleanly, and without abusing
unexpected behavior.
14 files changed:
src/common/aliasmanager.cpp
src/common/aliasmanager.h
src/common/highlightrulemanager.cpp
src/common/highlightrulemanager.h
src/common/ignorelistmanager.cpp
src/common/ignorelistmanager.h
src/common/syncableobject.cpp
src/common/syncableobject.h
src/qtui/settingspages/aliasesmodel.cpp
src/qtui/settingspages/aliasesmodel.h
src/qtui/settingspages/corehighlightsettingspage.cpp
src/qtui/settingspages/dccsettingspage.cpp
src/qtui/settingspages/ignorelistmodel.cpp
src/qtui/settingspages/ignorelistmodel.h