Merge lp://staging/~3v1n0/qmenumodel/variant-string-parser into lp://staging/qmenumodel

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Michael Zanetti
Approved revision: 141
Merged at revision: 122
Proposed branch: lp://staging/~3v1n0/qmenumodel/variant-string-parser
Merge into: lp://staging/qmenumodel
Diff against target: 771 lines (+318/-128)
13 files modified
debian/changelog (+6/-0)
libqmenumodel/src/converter.cpp (+30/-0)
libqmenumodel/src/converter.h (+2/-0)
libqmenumodel/src/qdbusobject.cpp (+0/-1)
libqmenumodel/src/qstateaction.cpp (+20/-0)
libqmenumodel/src/qstateaction.h (+2/-0)
libqmenumodel/src/unitymenumodel.cpp (+16/-2)
libqmenumodel/src/unitymenumodel.h (+2/-0)
tests/client/actiongrouptest.cpp (+59/-50)
tests/client/cachetest.cpp (+0/-5)
tests/client/convertertest.cpp (+181/-60)
tests/client/modelsignalstest.cpp (+0/-5)
tests/client/treetest.cpp (+0/-5)
To merge this branch: bzr merge lp://staging/~3v1n0/qmenumodel/variant-string-parser
Reviewer Review Type Date Requested Status
Nick Dedekind (community) Needs Information
Lukáš Tinkl (community) Approve
Review via email: mp+308529@code.staging.launchpad.net

Commit message

UnityMenuModel add support for activating and changing state with a variant string parameter

And support LongLong and ULongLong variants, this allows to use typed values from QML, such as:
  menuModel.activateByVariantString(menuIndex, "int64 %1".arg(bigNumber))
  menuModel.activateByVariantString(menuIndex, "uint32 %1".arg(unsignedNumber))

Or any other more complex string as supported by GVariant [1]

[1] https://developer.gnome.org/glib/stable/gvariant-text.html

To post a comment you must log in.
125. By Marco Trevisan (Treviño)

UnityMenuModel: avoid copying the string to a new std one

126. By Marco Trevisan (Treviño)

UnityMenuModel: avoid initializing an empty QVariant if not needed

127. By Marco Trevisan (Treviño)

converterTest: split tests by type

128. By Marco Trevisan (Treviño)

convertertest: add tests for [U]LongLong converters

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

One of the tests is failing:

7/9 Test #5: qmltest ..........................***Failed 2.61 sec

Where is CI? :S

review: Needs Fixing
129. By Marco Trevisan (Treviño)

Converter: move parseVariantString here from UnityMenuModel

130. By Marco Trevisan (Treviño)

QStateAction: add ability to activate or change state by variant string

131. By Marco Trevisan (Treviño)

ActionGroupTest: split tests depending on they need the helper script or not

And cleanup units

132. By Marco Trevisan (Treviño)

ActionGroupTest: add test for activateByVariantString

133. By Marco Trevisan (Treviño)

ConverterTest: use data in the testSchemaConvert

134. By Marco Trevisan (Treviño)

convertertest: repeat tests using test data

135. By Marco Trevisan (Treviño)

convertertest: create QGVariantType wrapper to avoid reinterperating a QString

136. By Marco Trevisan (Treviño)

ConverterTest: remove C++11 features for now

137. By Marco Trevisan (Treviño)

remove deprecated g_type_init() calls

138. By Marco Trevisan (Treviño)

converterTest: QVERIFY comparison return value

139. By Marco Trevisan (Treviño)

convertertest: add tests for converting to QVariant

140. By Marco Trevisan (Treviño)

converterTest: add tests for toQVariantFromVariantString

141. By Marco Trevisan (Treviño)

Add conversion tests for maps and lists to QVariant

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Alright, working fine, thanks!

review: Approve
142. By Marco Trevisan (Treviño)

ConverterTest: add checks for tuples and lists

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Do the actions which we activate contain the parameter types for the types which they require? As far as I remember, it's accessible via g_action_group_get_action_parameter_type.

Wouldn't it be better to try translate the type given to the type required automatically like in UnityMenuModel::changeState with Converter::toGVariantWithSchema

review: Needs Information
143. By Marco Trevisan (Treviño)

UnityMenuModel: use conversion with gschema in unity actions

144. By Marco Trevisan (Treviño)

UnityMenuModel: avoid copy on assignment

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> Do the actions which we activate contain the parameter types for the types
> which they require? As far as I remember, it's accessible via
> g_action_group_get_action_parameter_type.
>
> Wouldn't it be better to try translate the type given to the type required
> automatically like in UnityMenuModel::changeState with
> Converter::toGVariantWithSchema

Thanks, added that too.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches