[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [patch] kwalletd timeouts
From:       Thiago Macieira <thiago () kde ! org>
Date:       2008-07-09 13:22:31
Message-ID: 200807091022.32286.thiago () kde ! org
[Download RAW message or body]


Michael Leupold wrote:
>+    QDBusMessage replyMessage =
> walletLauncher->getInterface().connection().call( 
> +        openMessage, 
> QDBus::Block, 18000000);
>+    if (replyMessage.type() == QDBusMessage::ReplyMessage) {
>+        QDBusReply<int> r(replyMessage);
>+        if (r.isValid()) {
>+            int drc = r;
>+            if (drc != -1) {
>+                return new Wallet(drc, name);
>+            }
>         }

Patch seems fine.

On the section above, though, I have a suggestion for improvement. Instead 
of:

    QDBusMessage replyMessage =....
    if (replyMessage.type() == QDBusMessage::ReplyMessage) {
        QDBusReply<int> r(replyMessage);

You can simply do:
    QDBusReply<int> r = ....

where .... is still the same 
(walletLauncher()->getInterface()->connection().call(...))

QDBusReply::isValid already includes the testing to see if the message is 
a reply.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic