Commit ef19948c authored by Méven Car's avatar Méven Car Committed by adrien faveraux
Browse files

Reflect changes in kwayland-server changes

kwayland-server!180
parent 00fcc3a4
......@@ -83,9 +83,9 @@ AbstractOutput::~AbstractOutput()
{
}
QByteArray AbstractOutput::uuid() const
QString AbstractOutput::uuid() const
{
return QByteArray();
return QString();
}
bool AbstractOutput::isEnabled() const
......
......@@ -102,7 +102,7 @@ public:
*
* Default implementation returns an empty byte array.
*/
virtual QByteArray uuid() const;
virtual QString uuid() const;
/**
* Returns @c true if the output is enabled; otherwise returns @c false.
......
......@@ -51,7 +51,7 @@ QString AbstractWaylandOutput::name() const
return m_name;
}
QByteArray AbstractWaylandOutput::uuid() const
QString AbstractWaylandOutput::uuid() const
{
return m_waylandOutputDevice->uuid();
}
......@@ -259,7 +259,7 @@ void AbstractWaylandOutput::setWaylandMode(const QSize &size, int refreshRate)
}
void AbstractWaylandOutput::initInterfaces(const QString &model, const QString &manufacturer,
const QByteArray &uuid, const QSize &physicalSize,
const QString &uuid, const QSize &physicalSize,
const QVector<DeviceInterface::Mode> &modes,
const QByteArray &edid)
{
......@@ -294,8 +294,6 @@ void AbstractWaylandOutput::initInterfaces(const QString &model, const QString &
m_waylandOutput->addMode(mode.size, flags, mode.refreshRate);
}
m_waylandOutputDevice->create();
// start off enabled
m_waylandOutput->create();
......
......@@ -57,7 +57,7 @@ public:
~AbstractWaylandOutput() override;
QString name() const override;
QByteArray uuid() const override;
QString uuid() const override;
QSize modeSize() const;
......@@ -132,7 +132,7 @@ Q_SIGNALS:
protected:
void initInterfaces(const QString &model, const QString &manufacturer,
const QByteArray &uuid, const QSize &physicalSize,
const QString &uuid, const QSize &physicalSize,
const QVector<KWaylandServer::OutputDeviceInterface::Mode> &modes,
const QByteArray &edid);
......
......@@ -169,7 +169,7 @@ AbstractOutput *Platform::findOutput(int screenId)
return enabledOutputs().value(screenId);
}
AbstractOutput *Platform::findOutput(const QByteArray &uuid)
AbstractOutput *Platform::findOutput(const QString &uuid)
{
const auto outs = outputs();
auto it = std::find_if(outs.constBegin(), outs.constEnd(),
......
......@@ -427,7 +427,7 @@ public:
return Outputs();
}
AbstractOutput *findOutput(int screenId);
AbstractOutput *findOutput(const QByteArray &uuid);
AbstractOutput *findOutput(const QString &uuid);
/**
* A string of information to include in kwin debug output
......
......@@ -420,7 +420,7 @@ void DrmBackend::readOutputsConfiguration()
if (m_outputs.isEmpty()) {
return;
}
const QByteArray uuid = generateOutputConfigurationUuid();
const QString uuid = generateOutputConfigurationUuid();
const auto outputGroup = kwinApp()->config()->group("DrmOutputs");
const auto configGroup = outputGroup.group(uuid);
// default position goes from left to right
......@@ -454,7 +454,7 @@ void DrmBackend::writeOutputsConfiguration()
if (m_outputs.isEmpty()) {
return;
}
const QByteArray uuid = generateOutputConfigurationUuid();
const QString uuid = generateOutputConfigurationUuid();
auto configGroup = KSharedConfig::openConfig()->group("DrmOutputs").group(uuid);
// default position goes from left to right
for (auto it = m_outputs.cbegin(); it != m_outputs.cend(); ++it) {
......@@ -472,7 +472,7 @@ void DrmBackend::writeOutputsConfiguration()
}
}
QByteArray DrmBackend::generateOutputConfigurationUuid() const
QString DrmBackend::generateOutputConfigurationUuid() const
{
auto it = m_outputs.constBegin();
if (m_outputs.size() == 1) {
......@@ -480,10 +480,10 @@ QByteArray DrmBackend::generateOutputConfigurationUuid() const
return (*it)->uuid();
}
QCryptographicHash hash(QCryptographicHash::Md5);
for (; it != m_outputs.constEnd(); ++it) {
hash.addData((*it)->uuid());
for (const DrmOutput *output: qAsConst(m_outputs)) {
hash.addData(output->uuid().toLocal8Bit());
}
return hash.result().toHex().left(10);
return QString::fromLocal8Bit(hash.result().toHex().left(10));
}
void DrmBackend::enableOutput(DrmOutput *output, bool enable)
......
......@@ -104,7 +104,7 @@ private:
void initCursor();
void readOutputsConfiguration();
void writeOutputsConfiguration();
QByteArray generateOutputConfigurationUuid() const;
QString generateOutputConfigurationUuid() const;
DrmOutput *findOutput(quint32 connector);
void updateOutputsEnabled();
QScopedPointer<Udev> m_udev;
......
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