Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nemo-dbus] Add support for a{sv} type #13

Merged
merged 1 commit into from Mar 17, 2023
Merged

Conversation

attah
Copy link
Contributor

@attah attah commented Feb 19, 2023

So, this adds rudimentary support fro the a{sv} type, which is array of string-variant pairs.
QT, sensibly, maps that to/from QVariantMap.

This was tested with harbour-seaprint-share-plugin calling org.freedesktop.Application.Open on harbour-seaprint from the SharePlugin QML.
(Commits there landing soon-ish, maybe on branch for the former)
It works both with and without content in the a{sv} object.

flattenVariantArrayGuessType looks fishy... but since it is done on plain variants, i do it here too.
I had some issues with it, but those were PEBKAC.

I have no idea how to run the tests, so i haven't done so, nor added any. Hints on that much appreciated.

@attah
Copy link
Contributor Author

attah commented Feb 20, 2023

Having slept on it, org.freedesktop.Application.* is not actually needed for me and i can add whatever methods i please.
But all the same i think a{sv} variant map is useful, and being able to access those methods on arbitrary apps is neat.

@pvuorela
Copy link
Contributor

I have no idea how to run the tests, so i haven't done so, nor added any. Hints on that much appreciated.

There's usually a -tests package with tests.xml. That can be used with testrunner-lite e.g.
"testrunner-lite -f /opt/tests/nemo-qml-plugins-qt5/dbus/test-definition/tests.xml -o dbus-test" which executes the tests and writes the output to a file. In this case, though, the tests includes only couple cases which are executed with the qmltestrunner so those commands could be executed manually as well.

The testrunner lite as a QA tool is not included in the main repositories, but it's in "tools". Suppose that could be still available if manually added with ssu ar etc. Sources in https://github.com/mer-tools/testrunner-lite

Besides that at least this appears good to me, though could do some test with the type still.

@attah
Copy link
Contributor Author

attah commented Feb 28, 2023

Now with some basic tests.

Note to self: testrunner-lite does not tell you about how it went, qmltestrunner -input /opt/tests/nemo-qml-plugins-qt5/dbus/auto/tst_dbus_interface.qml, however, does.

Copy link
Contributor

@pvuorela pvuorela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to do what it promises. Approved.

Might be nice for developers if we had documented the types supported, but that's an existing shortcoming.

@pvuorela pvuorela merged commit 68eae38 into sailfishos:master Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants