Changeset View
Changeset View
Standalone View
Standalone View
autotests/client/test_plasma_window_model.cpp
Show All 40 Lines | |||||
41 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowBoolSetter)(bool); | 41 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowBoolSetter)(bool); | ||
42 | Q_DECLARE_METATYPE(ServerWindowBoolSetter) | 42 | Q_DECLARE_METATYPE(ServerWindowBoolSetter) | ||
43 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowStringSetter)(const QString&); | 43 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowStringSetter)(const QString&); | ||
44 | Q_DECLARE_METATYPE(ServerWindowStringSetter) | 44 | Q_DECLARE_METATYPE(ServerWindowStringSetter) | ||
45 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowQuint32Setter)(quint32); | 45 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowQuint32Setter)(quint32); | ||
46 | Q_DECLARE_METATYPE(ServerWindowQuint32Setter) | 46 | Q_DECLARE_METATYPE(ServerWindowQuint32Setter) | ||
47 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowVoidSetter)(); | 47 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowVoidSetter)(); | ||
48 | Q_DECLARE_METATYPE(ServerWindowVoidSetter) | 48 | Q_DECLARE_METATYPE(ServerWindowVoidSetter) | ||
49 | typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowIconSetter)(const QIcon&); | ||||
50 | Q_DECLARE_METATYPE(ServerWindowIconSetter) | ||||
49 | 51 | | |||
50 | class PlasmaWindowModelTest : public QObject | 52 | class PlasmaWindowModelTest : public QObject | ||
51 | { | 53 | { | ||
52 | Q_OBJECT | 54 | Q_OBJECT | ||
53 | private Q_SLOTS: | 55 | private Q_SLOTS: | ||
54 | void init(); | 56 | void init(); | ||
55 | void cleanup(); | 57 | void cleanup(); | ||
56 | 58 | | |||
▲ Show 20 Lines • Show All 819 Lines • ▼ Show 20 Line(s) | 861 | { | |||
876 | QTest::newRow("shadeable") << &PlasmaWindow::shadeableChanged << QVariant::fromValue(&PlasmaWindowInterface::setShadeable) << QVariant(true); | 878 | QTest::newRow("shadeable") << &PlasmaWindow::shadeableChanged << QVariant::fromValue(&PlasmaWindowInterface::setShadeable) << QVariant(true); | ||
877 | QTest::newRow("shaded") << &PlasmaWindow::shadedChanged << QVariant::fromValue(&PlasmaWindowInterface::setShaded) << QVariant(true); | 879 | QTest::newRow("shaded") << &PlasmaWindow::shadedChanged << QVariant::fromValue(&PlasmaWindowInterface::setShaded) << QVariant(true); | ||
878 | QTest::newRow("movable") << &PlasmaWindow::movableChanged << QVariant::fromValue(&PlasmaWindowInterface::setMovable) << QVariant(true); | 880 | QTest::newRow("movable") << &PlasmaWindow::movableChanged << QVariant::fromValue(&PlasmaWindowInterface::setMovable) << QVariant(true); | ||
879 | QTest::newRow("resizable") << &PlasmaWindow::resizableChanged << QVariant::fromValue(&PlasmaWindowInterface::setResizable) << QVariant(true); | 881 | QTest::newRow("resizable") << &PlasmaWindow::resizableChanged << QVariant::fromValue(&PlasmaWindowInterface::setResizable) << QVariant(true); | ||
880 | QTest::newRow("vdChangeable") << &PlasmaWindow::virtualDesktopChangeableChanged << QVariant::fromValue(&PlasmaWindowInterface::setVirtualDesktopChangeable) << QVariant(true); | 882 | QTest::newRow("vdChangeable") << &PlasmaWindow::virtualDesktopChangeableChanged << QVariant::fromValue(&PlasmaWindowInterface::setVirtualDesktopChangeable) << QVariant(true); | ||
881 | QTest::newRow("onallDesktop") << &PlasmaWindow::onAllDesktopsChanged << QVariant::fromValue(&PlasmaWindowInterface::setOnAllDesktops) << QVariant(true); | 883 | QTest::newRow("onallDesktop") << &PlasmaWindow::onAllDesktopsChanged << QVariant::fromValue(&PlasmaWindowInterface::setOnAllDesktops) << QVariant(true); | ||
882 | QTest::newRow("title") << &PlasmaWindow::titleChanged << QVariant::fromValue(&PlasmaWindowInterface::setTitle) << QVariant(QStringLiteral("foo")); | 884 | QTest::newRow("title") << &PlasmaWindow::titleChanged << QVariant::fromValue(&PlasmaWindowInterface::setTitle) << QVariant(QStringLiteral("foo")); | ||
883 | QTest::newRow("appId") << &PlasmaWindow::appIdChanged << QVariant::fromValue(&PlasmaWindowInterface::setAppId) << QVariant(QStringLiteral("foo")); | 885 | QTest::newRow("appId") << &PlasmaWindow::appIdChanged << QVariant::fromValue(&PlasmaWindowInterface::setAppId) << QVariant(QStringLiteral("foo")); | ||
884 | QTest::newRow("icon" ) << &PlasmaWindow::iconChanged << QVariant::fromValue(&PlasmaWindowInterface::setThemedIconName) << QVariant(QStringLiteral("foo")); | 886 | #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 28) | ||
887 | QTest::newRow("iconname" ) << &PlasmaWindow::iconChanged << QVariant::fromValue(&PlasmaWindowInterface::setThemedIconName) << QVariant(QStringLiteral("foo")); | ||||
888 | #endif | ||||
889 | QTest::newRow("icon" ) << &PlasmaWindow::iconChanged << QVariant::fromValue(&PlasmaWindowInterface::setIcon) << QVariant::fromValue(QIcon::fromTheme(QStringLiteral("foo"))); | ||||
885 | QTest::newRow("vd") << &PlasmaWindow::virtualDesktopChanged << QVariant::fromValue(&PlasmaWindowInterface::setVirtualDesktop) << QVariant(2u); | 890 | QTest::newRow("vd") << &PlasmaWindow::virtualDesktopChanged << QVariant::fromValue(&PlasmaWindowInterface::setVirtualDesktop) << QVariant(2u); | ||
886 | QTest::newRow("unmapped") << &PlasmaWindow::unmapped << QVariant::fromValue(&PlasmaWindowInterface::unmap) << QVariant(); | 891 | QTest::newRow("unmapped") << &PlasmaWindow::unmapped << QVariant::fromValue(&PlasmaWindowInterface::unmap) << QVariant(); | ||
887 | } | 892 | } | ||
888 | 893 | | |||
889 | void PlasmaWindowModelTest::testChangeWindowAfterModelDestroy() | 894 | void PlasmaWindowModelTest::testChangeWindowAfterModelDestroy() | ||
890 | { | 895 | { | ||
891 | // this test verifies that changes in a window after the model got destroyed doesn't crash | 896 | // this test verifies that changes in a window after the model got destroyed doesn't crash | ||
892 | auto model = m_pw->createWindowModel(); | 897 | auto model = m_pw->createWindowModel(); | ||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |