changeset 7 | f7bc934e204c |
parent 3 | 41300fa6a67c |
3:41300fa6a67c | 7:f7bc934e204c |
---|---|
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtDBus module of the Qt Toolkit. |
7 ** This file is part of the QtDBus module of the Qt Toolkit. |
8 ** |
8 ** |
489 a reply, for at most \a timeout milliseconds. This function is |
489 a reply, for at most \a timeout milliseconds. This function is |
490 suitable for method calls only. It returns the reply message as |
490 suitable for method calls only. It returns the reply message as |
491 its return value, which will be either of type |
491 its return value, which will be either of type |
492 QDBusMessage::ReplyMessage or QDBusMessage::ErrorMessage. |
492 QDBusMessage::ReplyMessage or QDBusMessage::ErrorMessage. |
493 |
493 |
494 If no reply is received within \a timeout milliseconds, an automatic |
|
495 error will be delivered indicating the expiration of the call. |
|
496 The default \a timeout is -1, which will be replaced with an |
|
497 implementation-defined value that is suitable for inter-process |
|
498 communications (generally, 25 seconds). |
|
499 |
|
494 See the QDBusInterface::call() function for a more friendly way |
500 See the QDBusInterface::call() function for a more friendly way |
495 of placing calls. |
501 of placing calls. |
496 |
502 |
497 \warning If \a mode is QDBus::BlockWithGui, this function will |
503 \warning If \a mode is QDBus::BlockWithGui, this function will |
498 reenter the Qt event loop in order to wait for the |
504 reenter the Qt event loop in order to wait for the |
524 /*! |
530 /*! |
525 \since 4.5 |
531 \since 4.5 |
526 Sends the \a message over this connection and returns |
532 Sends the \a message over this connection and returns |
527 immediately. This function is suitable for method calls only. It |
533 immediately. This function is suitable for method calls only. It |
528 returns an object of type QDBusPendingCall which can be used to |
534 returns an object of type QDBusPendingCall which can be used to |
529 track the status of the reply. The \a timeout parameter is used to |
535 track the status of the reply. |
530 determine when an auto-generated error reply may be emitted and is |
536 |
531 also the upper limit for waiting in QDBusPendingCall::waitForFinished(). |
537 If no reply is received within \a timeout milliseconds, an automatic |
538 error will be delivered indicating the expiration of the call. The |
|
539 default \a timeout is -1, which will be replaced with an |
|
540 implementation-defined value that is suitable for inter-process |
|
541 communications (generally, 25 seconds). This timeout is also the |
|
542 upper limit for waiting in QDBusPendingCall::waitForFinished(). |
|
532 |
543 |
533 See the QDBusInterface::asyncCall() function for a more friendly way |
544 See the QDBusInterface::asyncCall() function for a more friendly way |
534 of placing calls. |
545 of placing calls. |
535 */ |
546 */ |
536 QDBusPendingCall QDBusConnection::asyncCall(const QDBusMessage &message, int timeout) const |
547 QDBusPendingCall QDBusConnection::asyncCall(const QDBusMessage &message, int timeout) const |
617 if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) |
628 if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) |
618 return false; |
629 return false; |
619 if (interface.isEmpty() && name.isEmpty()) |
630 if (interface.isEmpty() && name.isEmpty()) |
620 return false; |
631 return false; |
621 |
632 |
622 QString owner = d->getNameOwner(service); // we don't care if the owner is empty |
|
623 // it might get started later |
|
624 QDBusWriteLocker locker(ConnectAction, d); |
633 QDBusWriteLocker locker(ConnectAction, d); |
625 return d->connectSignal(service, owner, path, interface, name, argumentMatch, signature, receiver, slot); |
634 return d->connectSignal(service, path, interface, name, argumentMatch, signature, receiver, slot); |
626 } |
635 } |
627 |
636 |
628 /*! |
637 /*! |
629 Disconnects the signal specified by the \a service, \a path, \a interface |
638 Disconnects the signal specified by the \a service, \a path, \a interface |
630 and \a name parameters from the slot \a slot in object \a receiver. The |
639 and \a name parameters from the slot \a slot in object \a receiver. The |