[patch] kwalletd timeouts
Thiago Macieira
thiago at kde.org
Wed Jul 9 14:22:31 BST 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080709/03055668/attachment.sig>
More information about the kde-core-devel
mailing list