Commit 227ab071 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Run .clang-format

parent 14ae6e31
......@@ -60,7 +60,8 @@ public:
/**
* Structure containing DBus service name and path
*/
struct InterfaceAddress {
struct InterfaceAddress
{
/** Service name of host with the AppMenu object*/
QString serviceName;
/** Object path of the AppMenu interface*/
......
......@@ -109,9 +109,9 @@ void TestDragAndDrop::init()
m_registry->setup();
QVERIFY(interfacesAnnouncedSpy.wait());
#define CREATE(variable, factory, iface) \
variable = \
m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \
#define CREATE(variable, factory, iface) \
variable = \
m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \
QVERIFY(variable);
CREATE(m_compositor, Compositor, Compositor)
......@@ -137,10 +137,10 @@ void TestDragAndDrop::init()
void TestDragAndDrop::cleanup()
{
#define DELETE(name) \
if (name) { \
delete name; \
name = nullptr; \
#define DELETE(name) \
if (name) { \
delete name; \
name = nullptr; \
}
DELETE(m_dataSource)
DELETE(m_dataDevice)
......
......@@ -93,10 +93,10 @@ void ErrorTest::init()
void ErrorTest::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_plasmaShell)
CLEANUP(m_compositor)
......
......@@ -101,10 +101,10 @@ void FakeInputTest::init()
void FakeInputTest::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_fakeInput)
CLEANUP(m_queue)
......
......@@ -90,10 +90,10 @@ void IdleTest::init()
void IdleTest::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_idle)
CLEANUP(m_seat)
......
......@@ -120,10 +120,10 @@ void TestActivities::init()
void TestActivities::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_windowInterface)
......
......@@ -144,10 +144,10 @@ void TestVirtualDesktop::init()
void TestVirtualDesktop::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_plasmaVirtualDesktopManagement)
......
......@@ -96,9 +96,9 @@ void TestPlasmaShell::init()
m_registry->setup();
QVERIFY(interfacesAnnouncedSpy.wait());
#define CREATE(variable, factory, iface) \
variable = \
m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \
#define CREATE(variable, factory, iface) \
variable = \
m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \
QVERIFY(variable);
CREATE(m_compositor, Compositor, Compositor)
......@@ -109,10 +109,10 @@ void TestPlasmaShell::init()
void TestPlasmaShell::cleanup()
{
#define DELETE(name) \
if (name) { \
delete name; \
name = nullptr; \
#define DELETE(name) \
if (name) { \
delete name; \
name = nullptr; \
}
DELETE(m_plasmaShell)
DELETE(m_compositor)
......
......@@ -122,10 +122,10 @@ void TestPointerConstraints::init()
void TestPointerConstraints::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_pointerConstraints)
......
......@@ -39,7 +39,8 @@ private:
SeatInterface *m_seatInterface = nullptr;
DataDeviceManagerInterface *m_ddmInterface = nullptr;
struct Connection {
struct Connection
{
ConnectionThread *connection = nullptr;
QThread *thread = nullptr;
EventQueue *queue = nullptr;
......@@ -153,8 +154,8 @@ void SelectionTest::cleanup()
{
cleanupConnection(&m_client1);
cleanupConnection(&m_client2);
#define CLEANUP(variable) \
delete variable; \
#define CLEANUP(variable) \
delete variable; \
variable = nullptr;
CLEANUP(m_display)
......
......@@ -109,10 +109,10 @@ void TestServerSideDecorationPalette::init()
void TestServerSideDecorationPalette::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_paletteManager)
......
......@@ -96,10 +96,10 @@ void ShadowTest::init()
void ShadowTest::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_shm)
CLEANUP(m_compositor)
......
......@@ -127,10 +127,10 @@ void TextInputTest::init()
void TextInputTest::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_textInputManagerV2)
CLEANUP(m_keyboard)
......
......@@ -111,10 +111,10 @@ void TestAppmenu::init()
void TestAppmenu::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_appmenuManager)
......
......@@ -107,10 +107,10 @@ void TestBlur::init()
void TestBlur::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_blurManager)
......
......@@ -110,10 +110,10 @@ void TestContrast::init()
void TestContrast::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_contrastManager)
......
......@@ -1092,15 +1092,15 @@ class PointerHoldGesture : public QObject, public QtWayland::zwp_pointer_gesture
Q_OBJECT
void zwp_pointer_gesture_hold_v1_begin(uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers) override
{
Q_EMIT started(serial, time, surface, fingers);
Q_EMIT started(serial, time, surface, fingers);
}
void zwp_pointer_gesture_hold_v1_end(uint32_t serial, uint32_t time, int32_t cancelled) override
{
cancelled ? Q_EMIT this->cancelled(serial, time) : Q_EMIT ended(serial, time);
cancelled ? Q_EMIT this->cancelled(serial, time) : Q_EMIT ended(serial, time);
}
Q_SIGNALS:
void started(quint32 serial , quint32 time, void *surface, quint32 fingers);
void started(quint32 serial, quint32 time, void *surface, quint32 fingers);
void ended(quint32 serial, quint32 time);
void cancelled(quint32 serial, quint32 time);
};
......@@ -1126,7 +1126,6 @@ void TestWaylandSeat::testPointerHoldGesture()
PointerHoldGesture gesture(gestures.get_hold_gesture(*pointer));
QVERIFY(gesture.isInitialized());
QSignalSpy startSpy(&gesture, &PointerHoldGesture::started);
QVERIFY(startSpy.isValid());
QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended);
......@@ -1139,7 +1138,7 @@ void TestWaylandSeat::testPointerHoldGesture()
QVERIFY(surfaceCreatedSpy.isValid());
QScopedPointer<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface*>();
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface);
QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied);
......@@ -1162,7 +1161,7 @@ void TestWaylandSeat::testPointerHoldGesture()
QCOMPARE(startSpy.count(), 1);
QCOMPARE(startSpy.first().at(0).value<quint32>(), m_display->serial());
QCOMPARE(startSpy.first().at(1).value<quint32>(), 1u);
QCOMPARE(startSpy.first().at(2).value<void*>(), *surface.get());
QCOMPARE(startSpy.first().at(2).value<void *>(), *surface.get());
QCOMPARE(startSpy.first().at(3).value<quint32>(), 3);
// another start should not be possible
......
......@@ -107,10 +107,10 @@ void TestSlide::init()
void TestSlide::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
CLEANUP(m_slideManager)
......
......@@ -140,10 +140,10 @@ void TestForeign::init()
void TestForeign::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_compositor)
......
......@@ -75,14 +75,14 @@ private:
Seat *m_seat = nullptr;
};
#define SURFACE \
QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); \
QVERIFY(xdgSurfaceCreatedSpy.isValid()); \
QScopedPointer<Surface> surface(m_compositor->createSurface()); \
QScopedPointer<XdgShellSurface> xdgSurface(m_xdgShell->createSurface(surface.data())); \
QCOMPARE(xdgSurface->size(), QSize()); \
QVERIFY(xdgSurfaceCreatedSpy.wait()); \
auto serverXdgToplevel = xdgSurfaceCreatedSpy.first().first().value<XdgToplevelInterface *>(); \
#define SURFACE \
QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); \
QVERIFY(xdgSurfaceCreatedSpy.isValid()); \
QScopedPointer<Surface> surface(m_compositor->createSurface()); \
QScopedPointer<XdgShellSurface> xdgSurface(m_xdgShell->createSurface(surface.data())); \
QCOMPARE(xdgSurface->size(), QSize()); \
QVERIFY(xdgSurfaceCreatedSpy.wait()); \
auto serverXdgToplevel = xdgSurfaceCreatedSpy.first().first().value<XdgToplevelInterface *>(); \
QVERIFY(serverXdgToplevel);
void XdgShellTest::init()
......@@ -164,10 +164,10 @@ void XdgShellTest::init()
void XdgShellTest::cleanup()
{
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
#define CLEANUP(variable) \
if (variable) { \
delete variable; \
variable = nullptr; \
}
CLEANUP(m_xdgShell)
CLEANUP(m_compositor)
......
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