Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/dbus/qdbusmessage.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5454#include "qdbusutil_p.h"
    5555
     56#ifndef QT_NO_DBUS
     57
    5658QT_BEGIN_NAMESPACE
    5759
     
    6466    : msg(0), reply(0), type(DBUS_MESSAGE_TYPE_INVALID),
    6567      timeout(-1), localReply(0), ref(1), delayedReply(false), localMessage(false),
    66       parametersValidated(false)
     68      parametersValidated(false), autoStartService(true)
    6769{
    6870}
     
    130132        msg = q_dbus_message_new_method_call(data(d_ptr->service.toUtf8()), d_ptr->path.toUtf8(),
    131133                                             data(d_ptr->interface.toUtf8()), d_ptr->name.toUtf8());
     134        q_dbus_message_set_auto_start( msg, d_ptr->autoStartService );
    132135        break;
    133136    case DBUS_MESSAGE_TYPE_METHOD_RETURN:
     
    290293
    291294    // no complex types seen
    292     // optimise by using the variant list itself
     295    // optimize by using the variant list itself
    293296    QDBusMessage retval;
    294297    QDBusMessagePrivate *d = retval.d_ptr;
     
    450453    }
    451454
    452     // the reply must have a msg or be a local-loop optimisation
     455    // the reply must have a msg or be a local-loop optimization
    453456    Q_ASSERT(reply.d_ptr->reply || reply.d_ptr->localMessage);
    454457    return reply;
     
    469472    }
    470473
    471     // the reply must have a msg or be a local-loop optimisation
     474    // the reply must have a msg or be a local-loop optimization
    472475    Q_ASSERT(reply.d_ptr->reply || reply.d_ptr->localMessage);
    473476    return reply;
     
    642645{
    643646    return d_ptr->delayedReply;
     647}
     648
     649/*!
     650    Sets the auto start flag to \a enable. This flag only makes sense
     651    for method call messages, where it tells the D-Bus server to
     652    either auto start the service responsible for the service name, or
     653    not to auto start it.
     654
     655    By default this flag is true, i.e. a service is autostarted.
     656    This means:
     657
     658    When the service that this method call is sent to is already
     659    running, the method call is sent to it. If the service is not
     660    running yet, the D-Bus daemon is requested to autostart the
     661    service that is assigned to this service name. This is
     662    handled by .service files that are placed in a directory known
     663    to the D-Bus server. These files then each contain a service
     664    name and the path to a program that should be executed when
     665    this service name is requested.
     666
     667    \since 4.7
     668*/
     669void QDBusMessage::setAutoStartService(bool enable)
     670{
     671    d_ptr->autoStartService = enable;
     672}
     673
     674/*!
     675    Returns the auto start flag, as set by setAutoStartService(). By default, this
     676    flag is true, which means QtDBus will auto start a service, if it is
     677    not running already.
     678
     679    \sa setAutoStartService()
     680
     681    \since 4.7
     682*/
     683bool QDBusMessage::autoStartService() const
     684{
     685    return d_ptr->autoStartService;
    644686}
    645687
     
    760802QT_END_NAMESPACE
    761803
     804#endif // QT_NO_DBUS
Note: See TracChangeset for help on using the changeset viewer.