[KWayland] Port away from deprecated API in Qt 5.14
Test Plan: Builds Reviewers: davidedmundson, zzag Reviewed By: zzag Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24014
This commit is contained in:
parent
baa1363558
commit
31e2f9c5d7
4 changed files with 15 additions and 9 deletions
|
@ -393,9 +393,13 @@ void TestWaylandSurface::testAttachBuffer()
|
|||
QImage blue(24, 24, QImage::Format_ARGB32_Premultiplied);
|
||||
blue.fill(QColor(0, 0, 255, 128));
|
||||
|
||||
wl_buffer *blackBuffer = *(m_shm->createBuffer(black).data());
|
||||
auto redBuffer = m_shm->createBuffer(red);
|
||||
auto blueBuffer = m_shm->createBuffer(blue).toStrongRef();
|
||||
QSharedPointer<KWayland::Client::Buffer> blackBufferPtr = m_shm->createBuffer(black).toStrongRef();
|
||||
QVERIFY(blackBufferPtr);
|
||||
wl_buffer *blackBuffer = *(blackBufferPtr.data());
|
||||
QSharedPointer<KWayland::Client::Buffer> redBuffer = m_shm->createBuffer(red).toStrongRef();
|
||||
QVERIFY(redBuffer);
|
||||
QSharedPointer<KWayland::Client::Buffer> blueBuffer = m_shm->createBuffer(blue).toStrongRef();
|
||||
QVERIFY(blueBuffer);
|
||||
|
||||
QCOMPARE(blueBuffer->format(), KWayland::Client::Buffer::Format::ARGB32);
|
||||
QCOMPARE(blueBuffer->size(), blue.size());
|
||||
|
@ -776,7 +780,8 @@ void TestWaylandSurface::testScale()
|
|||
//attach a buffer of 100x100, our scale is 4, so this should be a size of 25x25
|
||||
QImage red(100, 100, QImage::Format_ARGB32_Premultiplied);
|
||||
red.fill(QColor(255, 0, 0, 128));
|
||||
auto redBuffer = m_shm->createBuffer(red);
|
||||
QSharedPointer<Buffer> redBuffer = m_shm->createBuffer(red).toStrongRef();
|
||||
QVERIFY(redBuffer);
|
||||
s->attachBuffer(redBuffer.data());
|
||||
s->damage(QRect(0,0, 25,25));
|
||||
s->commit(Surface::CommitFlag::None);
|
||||
|
@ -800,7 +805,8 @@ void TestWaylandSurface::testScale()
|
|||
//set scale and size in one commit, buffer is 50x50 at scale 2 so size should be 25x25
|
||||
QImage blue(50, 50, QImage::Format_ARGB32_Premultiplied);
|
||||
red.fill(QColor(255, 0, 0, 128));
|
||||
auto blueBuffer = m_shm->createBuffer(blue);
|
||||
QSharedPointer<Buffer> blueBuffer = m_shm->createBuffer(blue).toStrongRef();
|
||||
QVERIFY(blueBuffer);
|
||||
s->attachBuffer(blueBuffer.data());
|
||||
s->setScale(2);
|
||||
s->commit(Surface::CommitFlag::None);
|
||||
|
|
|
@ -23,6 +23,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "surface_interface.h"
|
||||
#include "resource_p.h"
|
||||
// Qt
|
||||
#include <QHash>
|
||||
#include <QVector>
|
||||
// Wayland
|
||||
#include <wayland-server.h>
|
||||
|
|
|
@ -500,7 +500,7 @@ void Generator::startAuthorNameProcess()
|
|||
QStringLiteral("user.name")
|
||||
});
|
||||
git->setProgram(QStringLiteral("git"));
|
||||
connect(git, static_cast<void (QProcess::*)(int)>(&QProcess::finished), this,
|
||||
connect(git, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this,
|
||||
[this, git] {
|
||||
QMutexLocker locker(&m_mutex);
|
||||
m_authorName = QString::fromLocal8Bit(git->readAllStandardOutput()).trimmed();
|
||||
|
@ -520,7 +520,7 @@ void Generator::startAuthorEmailProcess()
|
|||
QStringLiteral("user.email")
|
||||
});
|
||||
git->setProgram(QStringLiteral("git"));
|
||||
connect(git, static_cast<void (QProcess::*)(int)>(&QProcess::finished), this,
|
||||
connect(git, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this,
|
||||
[this, git] {
|
||||
QMutexLocker locker(&m_mutex);
|
||||
m_authorEmail = QString::fromLocal8Bit(git->readAllStandardOutput()).trimmed();
|
||||
|
|
|
@ -183,8 +183,7 @@ void TestServer::startTestApp(const QString &app, const QStringList &arguments)
|
|||
p->setProcessEnvironment(environment);
|
||||
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
|
||||
connect(p, finishedSignal, QCoreApplication::instance(), &QCoreApplication::exit);
|
||||
auto errorSignal = static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error);
|
||||
connect(p, errorSignal, this,
|
||||
connect(p, &QProcess::errorOccurred, this,
|
||||
[] {
|
||||
QCoreApplication::instance()->exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue