[platforms/virtual] Make VirtualOutput non-copyable
Summary: Qt objects are treated as identities so remove the copy constructor and an assignment operator. See, http://doc.qt.io/qt-5/object.html#identity-vs-value IIRC some Qt objects(like QImage) have copy constructor for implicit data sharing, but VirtualOutput doesn't have anything to share. Also, it [this patch] fixes a compiler warning: ``` /home/vlad/KDE/src/kde/workspace/kwin/plugins/platforms/virtual/virtual_output.cpp: In copy constructor ‘KWin::VirtualOutput::VirtualOutput(const KWin::VirtualOutput&)’: /home/vlad/KDE/src/kde/workspace/kwin/plugins/platforms/virtual/virtual_output.cpp:30:1: warning: base class ‘class QObject’ should be explicitly initialized in the copy constructor [-Wextra] VirtualOutput::VirtualOutput(const VirtualOutput &o) ^~~~~~~~~~~~~ ``` Reviewers: #kwin, romangg Reviewed By: #kwin, romangg Subscribers: michaelh, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D12214
This commit is contained in:
parent
d3f8b979a0
commit
c44788889c
2 changed files with 1 additions and 9 deletions
|
@ -27,14 +27,6 @@ VirtualOutput::VirtualOutput(QObject *parent)
|
|||
{
|
||||
}
|
||||
|
||||
VirtualOutput::VirtualOutput(const VirtualOutput &o)
|
||||
: m_geo(o.m_geo),
|
||||
m_outputScale(o.m_outputScale),
|
||||
m_gammaSize(o.m_gammaSize),
|
||||
m_gammaResult(o.m_gammaResult)
|
||||
{
|
||||
}
|
||||
|
||||
VirtualOutput::~VirtualOutput()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ class VirtualOutput : public QObject
|
|||
|
||||
public:
|
||||
VirtualOutput(QObject *parent = nullptr);
|
||||
VirtualOutput(const VirtualOutput &o);
|
||||
virtual ~VirtualOutput();
|
||||
|
||||
QRect geometry() const {
|
||||
|
@ -41,6 +40,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(VirtualOutput);
|
||||
friend class VirtualBackend;
|
||||
|
||||
QRect m_geo;
|
||||
|
|
Loading…
Reference in a new issue