Unable to expose user-defined data types over D-Bus

Bug #864318 reported by Jacky Alciné
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Wintermute Project
In Progress
Critical
Jacky Alciné

Bug Description

Wintermute's self-defined data types for D-Bus usage aren't properly serialized.

When attempting to call a method; however, it causes null information to be returned and thus breaking the linguistics system.

Revision history for this message
Jonathan Marsden (jmarsden) wrote :

I think a shortish standalone code example would be helpful to understanding this issue. Can you provide a really simple example program that defines a user-defined type and then tries to serialize it overdbus, and so demonstrates the problem?

Revision history for this message
Jacky Alciné (jackyalcine) wrote :

Well, a code snippet of how the implementation would typically works according to QtDBus's documentation would be the following (currently in the linguistics code branch [lp:~wintermute-devel/wintermute/ling] in file syntax.cpp on lines 141 - 146; however it's been modified below for verbose explanation).

/// Not found in the code; but calling it handles an issue that should have been fixed (user-defined type not marshalled).
qDBusRegisterMetaType<Lexical::Data>();

/// The data to send over DBus.
Lexical::Data l_dt(p_id,p_lcl);

/// Converted to a QVariant for simplified transfer (this might be the issue, but I doubt it).
QVariant l_vrnt = QVariant::fromValue(l_dt);

/// Form the method call for D-Bus.
QDBusMessage l_call = QDBusMessage::createMethodCall ("org.thesii.Wintermute.Data","/Nodes","org.thesii.Wintermute.Data.NodeAdaptor","exists");

/// Load the argument call.
l_call << l_vrnt;
qDebug() << "(ling) [Node] <exists>" << p_lcl;

/// Execute the call and obtain a reply.
QDBusMessage l_reply = QDBusConnection::sessionBus ().call(l_call,QDBus::BlockWithGui);

With this is run, the following is printed out as an non-critical error by Wintermute:

(data) [Node] Unable to determine existance of "1a699ad5e06aa8a6db3bcf9cfb2f00f2" "en" : "No such method 'exists' in interface 'org.thesii.Wintermute.Data.NodeAdaptor' at object path '/Nodes' (signature '(ssa{ss}s)')"

This is because the data library seems to not either not call qDBusRegisterMetaType from System::start() in time, or that maybe the custom types need to have their own introspection for D-Bus. Either way, I'm stumped.

Changed in wintermute:
status: New → Confirmed
Revision history for this message
Jacky Alciné (jackyalcine) wrote :

Thanks to http://techbase.kde.org/Development/Tutorials/D-Bus/CustomTypes; I'm beginning to understand how this stuff works, lol. It's mostly voodoo magic but I've figured out a means of getting this done.

Changed in wintermute:
assignee: nobody → Jacky Alciné (jackyalcine)
Revision history for this message
Jacky Alciné (jackyalcine) wrote :

I figured out a way to get this done via a cheat, I've used QJson to serialize and deserialize the information of the data type for now. I'm going to continue attempting to figure out why QVariant, QMetaType and the Meta Object System doesn't recognize my object.

Changed in wintermute:
status: Confirmed → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.