Commit c4478888 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[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
parent d3f8b979
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment