2008/10/28 Michael Tansella <span dir="ltr"><<a href="mailto:michael-tansella@gmx.de">michael-tansella@gmx.de</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">> Are you extracting the data out of the<br>
> struct with the ">>" operators<br>
<br>
</div>Thank you again for that hint:<br>
<br>
For interested the way I implemented it:<br>
</blockquote></div><br>Here my snippet to read Phonebooks from sim:<br><br>struct PhonebookEntry<br>{<br> int index;<br> QString name;<br> QString number;<br>};<br><br>Q_DECLARE_METATYPE ( PhonebookEntry );<br>Q_DECLARE_METATYPE ( QList<PhonebookEntry> );<br>
<br>const QDBusArgument &operator>>(const QDBusArgument &argument, PhonebookEntry &pe) {<br> argument.beginStructure();<br> argument >> pe.index >> <a href="http://pe.name">pe.name</a> >> pe.number;<br>
argument.endStructure();<br> return argument;<br>}<br><br>const QDBusArgument &operator<<(QDBusArgument &argument, const PhonebookEntry &pe) {<br> argument.beginStructure();<br> argument << pe.index << <a href="http://pe.name">pe.name</a> << pe.number;<br>
argument.endStructure();<br> return argument;<br>}<br><br>qDBusRegisterMetaType<PhonebookEntry>(); //somewhere in the code<br><br>QDBusMessage m=gsm_sim->call ( "RetrievePhonebook","received" );<br>
QList<PhonebookEntry> lpe=qdbus_cast<QList<PhonebookEntry> >(m.arguments()[0]);<br>qDebug() <<lpe;<br><br>You may be interested to the following too:<br><br>const QDebug operator<<(QDebug debug, const PhonebookEntry &pe) {<br>
debug << pe.index <<pe.number<< <a href="http://pe.name">pe.name</a>;<br> return debug;<br>}<br><br>const QDebug operator<<(QDebug debug, const QList<PhonebookEntry> &lpe) {<br> foreach(PhonebookEntry pe, lpe) debug << pe;<br>
return debug;<br>}<br><br>Where to put this? fso/wiki? om/wiki?<br><br>Regards<br><br> Nicola<br><br><br><br><br><br><br>