[Interest] Question about using QtDBus

Thiago Macieira thiago.macieira at intel.com
Thu Sep 4 17:58:28 CEST 2014


On Thursday 04 September 2014 12:40:16 Rogers Nate wrote:
> On 09/03/2014 01:34 PM, Thiago Macieira wrote:
> > On Wednesday 03 September 2014 17:16:47 Rogers Nate wrote:
> >>         <annotation name="org.qtproject.QtDBus.QtTypeName.Out0"
> >> 
> >> value="QList<ServiceErrorLogData>"/>
> > 
> > Not valid XML. The < needs to be < and the > needs to be >
> 
> Ha, that was it, thanks!  One last question on how to process the value,
> I noticed some people use waitForFinished().  Is that required or is it
> safest to use that?  I found that the two functions below produce the
> same output, granted this is a very simple example.  Should I be using
> waitForFinished()?

It's automatic if you try to access the data.

> void CanData::generateTestData()
> {
>     QDBusPendingReply<QList<ServiceErrorLogData> > logData =
> m_ServiceData->serviceErrorLog();
>     logData.waitForFinished();
>     if (logData.isError())
>     {
>         qDebug() << logData.error();
>     }
> 
>     foreach(ServiceErrorLogData data, logData.value() )

You probably didn't get an error and value() did wait for the data to arrive 
before returning it.

> Confidentiality Notice: The preceding e-mail message (including any
> attachments) contains information that may be confidential, protected by
> applicable legal privileges, or constitute non-public information. It is
> intended to be conveyed only to the designated recipient(s). If you are not
> an intended recipient of this message, please notify the sender by replying
> to this message and then delete it from your system. Use, dissemination,
> distribution or reproduction of this message by unintended recipients is
> not authorized and may be unlawful.

Can you try and remove this note? Obviously your email is not confidential, 
since it was sent to the entire world.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list