From a03360ce3fa4b2de50917188a8a816992e864ba1 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 13 Sep 2012 14:14:56 -0300 Subject: Created class QStateAction to use as GAction proxy. --- tests/client/actiongrouptest.cpp | 3 ++- tests/client/modeltest.cpp | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/client/actiongrouptest.cpp b/tests/client/actiongrouptest.cpp index 3843ace..6fc2f82 100644 --- a/tests/client/actiongrouptest.cpp +++ b/tests/client/actiongrouptest.cpp @@ -20,6 +20,7 @@ #include "qdbusmenumodel.h" #include "qdbusactiongroup.h" #include "dbusmenuscript.h" +#include "qstateaction.h" #include #include @@ -128,7 +129,7 @@ private Q_SLOTS: // Get Action QVariant action = m_model.data(m_model.index(1, 0), QMenuModel::Action); QVERIFY(action.isValid()); - QAction *act = m_actionGroup.action(action.toString()); + QStateAction *act = m_actionGroup.action(action.toString()); QVERIFY(act); act->trigger(); diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp index 4cf7f54..347676e 100644 --- a/tests/client/modeltest.cpp +++ b/tests/client/modeltest.cpp @@ -144,55 +144,55 @@ private Q_SLOTS: QVariant e = m_model.data(m_model.index(0, 0), QMenuModel::Extra); QVERIFY(e.isValid()); - QObject *extra = e.value(); + QVariantMap extra = e.toMap(); // Boolean - QVariant v = extra->property("boolean"); + QVariant v = extra["boolean"]; QCOMPARE(v.type(), QVariant::Bool); QCOMPARE(v.toBool(), true); // Byte - v = extra->property("byte"); + v = extra["byte"]; QCOMPARE(v.typeName(), "uchar"); QCOMPARE(v.value(), (uchar)42); // Int16 - v = extra->property("int16"); + v = extra["int16"]; QCOMPARE(v.typeName(), "short"); QCOMPARE(v.value(), (short)-42); // UInt16 - v = extra->property("uint16"); + v = extra["uint16"]; QCOMPARE(v.typeName(), "ushort"); QCOMPARE(v.value(), (ushort)42); // Int32 - v = extra->property("int32"); + v = extra["int32"]; QCOMPARE(v.type(), QVariant::Int); QCOMPARE(v.toInt(), -42); // UInt32 - v = extra->property("uint32"); + v = extra["uint32"]; QCOMPARE(v.type(), QVariant::UInt); QCOMPARE(v.toUInt(), (uint) 42); // Int64 - v = extra->property("int64"); + v = extra["int64"]; QCOMPARE(v.typeName(), "long"); QCOMPARE(v.value(), (long) -42); // UInt64 - v = extra->property("uint64"); + v = extra["uint64"]; QCOMPARE(v.typeName(), "ulong"); QCOMPARE(v.value(), (ulong) 42); // Double - v = extra->property("double"); + v = extra["double"]; QCOMPARE(v.type(), QVariant::Double); QCOMPARE(v.toDouble(), 42.42); // String - v = extra->property("string"); + v = extra["string"]; QCOMPARE(v.type(), QVariant::String); QCOMPARE(v.toString(), QString("42")); } -- cgit v1.2.3