x11: Pass the output name to X11Output constructor

The output name is static, i.e. it cannot change, so there's no point
for having a setter.
This commit is contained in:
Vlad Zahorodnii 2021-08-26 09:34:39 +03:00
parent a8810e0c33
commit bd6d04b417
3 changed files with 4 additions and 11 deletions

View file

@ -12,8 +12,9 @@
namespace KWin namespace KWin
{ {
X11Output::X11Output(QObject *parent) X11Output::X11Output(const QString &name, QObject *parent)
: AbstractOutput(parent) : AbstractOutput(parent)
, m_name(name)
{ {
} }
@ -22,11 +23,6 @@ QString X11Output::name() const
return m_name; return m_name;
} }
void X11Output::setName(QString set)
{
m_name = set;
}
QRect X11Output::geometry() const QRect X11Output::geometry() const
{ {
if (m_geometry.isValid()) { if (m_geometry.isValid()) {

View file

@ -28,11 +28,9 @@ class KWIN_EXPORT X11Output : public AbstractOutput
Q_OBJECT Q_OBJECT
public: public:
explicit X11Output(QObject *parent = nullptr); explicit X11Output(const QString &name, QObject *parent = nullptr);
~X11Output() override = default;
QString name() const override; QString name() const override;
void setName(QString set);
QRect geometry() const override; QRect geometry() const override;
void setGeometry(QRect set); void setGeometry(QRect set);

View file

@ -520,8 +520,7 @@ void X11StandalonePlatform::doUpdateOutputs()
changed.append(output); changed.append(output);
removed.removeOne(output); removed.removeOne(output);
} else { } else {
output = new X11Output(); output = new X11Output(outputInfo.name());
output->setName(outputInfo.name());
added.append(output); added.append(output);
} }