Changeset 846 for trunk/src/dbus


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:
62 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/dbus/dbus.pro

    r561 r846  
    44    xml
    55CONFIG += link_pkgconfig
    6 DEFINES += QDBUS_MAKEDLL \
     6DEFINES += QT_BUILD_DBUS_LIB \
    77    DBUS_API_SUBJECT_TO_CHANGE
    88QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS
     
    2121}
    2222win32 {
    23     LIBS_PRIVATE += -lws2_32 \
     23    wince*:LIBS_PRIVATE += -lws2
     24    else:LIBS_PRIVATE += -lws2_32 \
    2425        -ladvapi32 \
    2526        -lnetapi32 \
  • trunk/src/dbus/qdbus_symbols.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)
     
    4444#include <QtCore/qmutex.h>
    4545#include <private/qmutexpool_p.h>
     46
     47#ifndef QT_NO_DBUS
    4648
    4749QT_BEGIN_NAMESPACE
     
    110112Q_DESTRUCTOR_FUNCTION(qdbus_unloadLibDBus)
    111113
     114#endif // QT_LINKED_LIBDBUS
     115
    112116QT_END_NAMESPACE
    113117
    114 #endif
     118#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbus_symbols_p.h

    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)
     
    5757#include <QtCore/qglobal.h>
    5858#include <dbus/dbus.h>
     59
     60#ifndef QT_NO_DBUS
    5961
    6062QT_BEGIN_NAMESPACE
     
    196198/* dbus-message.h */
    197199DEFINEFUNC(DBusMessage* , dbus_message_copy, (const DBusMessage *message),
     200           (message), return)
     201DEFINEFUNC(dbus_bool_t   , dbus_message_get_auto_start, (DBusMessage   *message),
    198202           (message), return)
    199203DEFINEFUNC(const char*   , dbus_message_get_error_name, (DBusMessage   *message),
     
    269273DEFINEFUNC(DBusMessage*  , dbus_message_ref, (DBusMessage   *message),
    270274           (message), return)
     275DEFINEFUNC(void          , dbus_message_set_auto_start, (DBusMessage   *message,
     276                                                         dbus_bool_t    auto_start),
     277           (message, auto_start), return)
    271278DEFINEFUNC(dbus_bool_t   , dbus_message_set_destination, (DBusMessage   *message,
    272279                                                          const char    *destination),
     
    363370QT_END_NAMESPACE
    364371
    365 #endif
     372#endif // QT_NO_DBUS
     373#endif // QDBUS_SYMBOLS_P_H
  • trunk/src/dbus/qdbusabstractadaptor.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)
     
    5353#include "qdbusabstractadaptor_p.h"
    5454#include "qdbusmetatype_p.h"
     55
     56#ifndef QT_NO_DBUS
    5557
    5658QT_BEGIN_NAMESPACE
     
    379381
    380382QT_END_NAMESPACE
     383
     384#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusabstractadaptor.h

    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)
     
    4646#include <QtDBus/qdbusmacros.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    5355
    5456class QDBusAbstractAdaptorPrivate;
    55 class QDBUS_EXPORT QDBusAbstractAdaptor: public QObject
     57class Q_DBUS_EXPORT QDBusAbstractAdaptor: public QObject
    5658{
    5759    Q_OBJECT
     
    7476QT_END_HEADER
    7577
     78#endif // QT_NO_DBUS
     79
    7680#endif
  • trunk/src/dbus/qdbusabstractadaptor_p.h

    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)
     
    6868#define QCLASSINFO_DBUS_INTROSPECTION   "D-Bus Introspection"
    6969
     70#ifndef QT_NO_DBUS
     71
    7072QT_BEGIN_NAMESPACE
    7173
     
    133135QT_END_NAMESPACE
    134136
     137#endif // QT_NO_DBUS
    135138#endif // QDBUSABSTRACTADAPTORPRIVATE_H
  • trunk/src/dbus/qdbusabstractinterface.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)
     
    4343#include "qdbusabstractinterface_p.h"
    4444
     45#include <qthread.h>
     46
    4547#include "qdbusargument.h"
    4648#include "qdbuspendingcall.h"
     
    5153
    5254#include <qdebug.h>
     55
     56#ifndef QT_NO_DBUS
    5357
    5458QT_BEGIN_NAMESPACE
     
    439443
    440444    QDBusMessage reply = d->connection.call(msg, mode);
    441     d->lastError = reply;       // will clear if reply isn't an error
     445    if (thread() == QThread::currentThread())
     446        d->lastError = reply;       // will clear if reply isn't an error
    442447
    443448    // ensure that there is at least one element
     
    556561        return;
    557562
    558     // we end up recursing here, so optimise away
     563    // we end up recursing here, so optimize away
    559564    if (qstrcmp(signal + 1, "destroyed(QObject*)") == 0)
    560565        return;
     
    766771QT_END_NAMESPACE
    767772
     773#endif // QT_NO_DBUS
     774
    768775#include "moc_qdbusabstractinterface.cpp"
  • trunk/src/dbus/qdbusabstractinterface.h

    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)
     
    5252#include <QtDBus/qdbusconnection.h>
    5353
     54#ifndef QT_NO_DBUS
     55
    5456QT_BEGIN_HEADER
    5557
     
    6365class QDBusAbstractInterfacePrivate;
    6466
    65 class QDBUS_EXPORT QDBusAbstractInterfaceBase: public QObject
     67class Q_DBUS_EXPORT QDBusAbstractInterfaceBase: public QObject
    6668{
    6769public:
     
    7375};
    7476
    75 class QDBUS_EXPORT QDBusAbstractInterface:
     77class Q_DBUS_EXPORT QDBusAbstractInterface:
    7678#ifdef Q_QDOC
    7779        public QObject
     
    160162QT_END_HEADER
    161163
     164#endif // QT_NO_DBUS
    162165#endif
  • trunk/src/dbus/qdbusabstractinterface_p.h

    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)
     
    6363#define ANNOTATION_NO_WAIT      "org.freedesktop.DBus.Method.NoReply"
    6464
     65#ifndef QT_NO_DBUS
     66
    6567QT_BEGIN_NAMESPACE
    6668
     
    99101QT_END_NAMESPACE
    100102
     103#endif // QT_NO_DBUS
    101104#endif
  • trunk/src/dbus/qdbusargument.cpp

    r769 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)
     
    5757#include "qdbusutil_p.h"
    5858
     59#ifndef QT_NO_DBUS
     60
    5961QT_BEGIN_NAMESPACE
    6062
     
    824826
    825827    If the type you want to marshall is a QList, QVector or any of the
    826     Qt's \l {Generic Containers} that take one template parameter,
     828    Qt's \l {Container Classes} that take one template parameter,
    827829    you need not declare an \c{operator<<} function for it, since
    828830    QtDBus provides generic templates to do the job of marshalling
     
    951953
    952954    If the type you want to demarshall is a QList, QVector or any of the
    953     Qt's \l {Generic Containers} that take one template parameter, you
     955    Qt's \l {Container Classes} that take one template parameter, you
    954956    need not declare an \c{operator>>} function for it, since QtDBus
    955957    provides generic templates to do the job of demarshalling the data.
     
    13291331
    13301332QT_END_NAMESPACE
     1333
     1334#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusargument.h

    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 <QtDBus/qdbusmacros.h>
    5555
     56#ifndef QT_NO_DBUS
     57
    5658QT_BEGIN_HEADER
    5759
     
    6365class QDBusDemarshaller;
    6466class QDBusMarshaller;
    65 class QDBUS_EXPORT QDBusArgument
     67class Q_DBUS_EXPORT QDBusArgument
    6668{
    6769public:
     
    171173}
    172174
    173 // specialise for QVariant, allowing it to be used in place of QDBusVariant
     175// specialize for QVariant, allowing it to be used in place of QDBusVariant
    174176template<> inline QVariant qdbus_cast<QVariant>(const QDBusArgument &arg, QVariant *)
    175177{
     
    183185}
    184186
    185 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v);
     187Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v);
    186188
    187189// QVariant types
    188190#ifndef QDBUS_NO_SPECIALTYPES
    189191
    190 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date);
    191 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date);
    192 
    193 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time);
    194 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time);
    195 
    196 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt);
    197 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt);
    198 
    199 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect);
    200 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect);
    201 
    202 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect);
    203 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect);
    204 
    205 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size);
    206 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size);
    207 
    208 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size);
    209 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size);
    210 
    211 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt);
    212 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt);
    213 
    214 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt);
    215 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt);
    216 
    217 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line);
    218 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line);
    219 
    220 QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line);
    221 QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line);
     192Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date);
     193Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date);
     194
     195Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time);
     196Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time);
     197
     198Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt);
     199Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt);
     200
     201Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect);
     202Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect);
     203
     204Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect);
     205Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect);
     206
     207Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size);
     208Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size);
     209
     210Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size);
     211Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size);
     212
     213Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt);
     214Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt);
     215
     216Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt);
     217Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt);
     218
     219Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line);
     220Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line);
     221
     222Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line);
     223Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line);
    222224#endif
    223225
     
    381383QT_END_HEADER
    382384
     385#endif // QT_NO_DBUS
    383386#endif
  • trunk/src/dbus/qdbusargument_p.h

    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)
     
    5656#include <qdbusargument.h>
    5757#include "qdbus_symbols_p.h"
     58
     59#ifndef QT_NO_DBUS
    5860
    5961QT_BEGIN_NAMESPACE
     
    207209QT_END_NAMESPACE
    208210
     211#endif // QT_NO_DBUS
    209212#endif
  • trunk/src/dbus/qdbusconnection.cpp

    r769 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)
     
    5555#include "qdbusthreaddebug_p.h"
    5656
     57#ifndef QT_NO_DBUS
     58
    5759QT_BEGIN_NAMESPACE
    5860
     
    124126}
    125127
    126 QDBUS_EXPORT void qDBusBindToApplication();
     128Q_DBUS_EXPORT void qDBusBindToApplication();
    127129void qDBusBindToApplication()
    128130{
     
    139141    \relates QDBusConnection
    140142
    141     Returns a QDBusConnection object opened with the session bus. The object reference returned
    142     by this function is valid until the QCoreApplication's destructor is run, when the
    143     connection will be closed and the object, deleted.
     143    Returns a QDBusConnection object opened with the session bus. The object
     144    reference returned by this function is valid until the application terminates,
     145    at which point the connection will be closed and the object deleted.
    144146*/
    145147/*!
     
    172174    function.
    173175
     176    Once disconnected, calling connectToBus() will not reestablish a
     177    connection, you must create a new QDBusConnection instance.
     178
    174179    As a convenience for the two most common connection types, the
    175180    sessionBus() and systemBus() functions return open connections to
     
    208213    \value ExportScriptableSignals              export this object's scriptable signals
    209214    \value ExportScriptableProperties           export this object's scriptable properties
     215    \value ExportScriptableInvokables           export this object's scriptable invokables
    210216    \value ExportScriptableContents             shorthand form for ExportScriptableSlots |
    211217                                                ExportScriptableSignals |
     
    215221    \value ExportNonScriptableSignals           export this object's non-scriptable signals
    216222    \value ExportNonScriptableProperties        export this object's non-scriptable properties
     223    \value ExportNonScriptableInvokables        export this object's non-scriptable invokables
    217224    \value ExportNonScriptableContents          shorthand form for ExportNonScriptableSlots |
    218225                                                ExportNonScriptableSignals |
     
    222229    \value ExportAllSignals                     export all of this object's signals
    223230    \value ExportAllProperties                  export all of this object's properties
     231    \value ExportAllInvokables                  export all of this object's invokables
    224232    \value ExportAllContents                    export all of this object's contents
    225 
    226233    \value ExportChildObjects                   export this object's child objects
    227234
     
    852859/*!
    853860    Returns true if this QDBusConnection object is connected.
    854 
    855     If it isn't connected, calling connectToBus() on the same
    856     connection name will not make be connected. You need to call the
    857     QDBusConnection constructor again.
    858861*/
    859862bool QDBusConnection::isConnected() const
     
    915918/*!
    916919    Attempts to register the \a serviceName on the D-Bus server and
    917     returns true if the registration succeded. The registration will
     920    returns true if the registration succeeded. The registration will
    918921    fail if the name is already registered by another application.
    919922
     
    9971000{
    9981001    _q_manager()->setSender(s);
    999 }
    1000 
    1001 /*!
    1002   \internal
    1003 */
    1004 void QDBusConnectionPrivate::setConnection(const QString &name, QDBusConnectionPrivate *c)
    1005 {
    1006     _q_manager()->setConnection(name, c);
    10071002}
    10081003
     
    10491044
    10501045QT_END_NAMESPACE
     1046
     1047#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusconnection.h

    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)
     
    4646#include <QtCore/qstring.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    7173
    7274class QDBusConnectionPrivate;
    73 class QDBUS_EXPORT QDBusConnection
     75class Q_DBUS_EXPORT QDBusConnection
    7476{
    7577    Q_GADGET
     
    8486        ExportScriptableSignals = 0x20,
    8587        ExportScriptableProperties = 0x40,
     88        ExportScriptableInvokables = 0x80,
    8689        ExportScriptableContents = 0xf0,
    8790
     
    8992        ExportNonScriptableSignals = 0x200,
    9093        ExportNonScriptableProperties = 0x400,
     94        ExportNonScriptableInvokables = 0x800,
    9195        ExportNonScriptableContents = 0xf00,
    9296
     
    9498        ExportAllSignals = ExportScriptableSignals|ExportNonScriptableSignals,
    9599        ExportAllProperties = ExportScriptableProperties|ExportNonScriptableProperties,
     100        ExportAllInvokables = ExportScriptableInvokables|ExportNonScriptableInvokables,
    96101        ExportAllContents = ExportScriptableContents|ExportNonScriptableContents,
    97102
     
    182187QT_END_HEADER
    183188
     189#endif // QT_NO_DBUS
    184190#endif
  • trunk/src/dbus/qdbusconnection_p.h

    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)
     
    7171
    7272#include <qdbusmessage.h>
     73
     74#ifndef QT_NO_DBUS
    7375
    7476QT_BEGIN_NAMESPACE
     
    159161    struct WatchedServiceData {
    160162        WatchedServiceData() : refcount(0) {}
     163        WatchedServiceData(const QString &owner, int refcount = 0)
     164            : owner(owner), refcount(refcount)
     165        {}
    161166        QString owner;
    162167        int refcount;
     
    199204                         const QString &path, const QString &interface,
    200205                         QDBusAbstractInterface *receiver, const char *signal);
     206    void registerService(const QString &serviceName);
     207    void unregisterService(const QString &serviceName);
    201208
    202209    bool handleMessage(const QDBusMessage &msg);
     
    243250    void objectDestroyed(QObject *o);
    244251    void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args);
    245     void _q_serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
    246     void registerService(const QString &serviceName);
    247     void unregisterService(const QString &serviceName);
     252
     253private slots:
     254    void serviceOwnerChangedNoLock(const QString &name, const QString &oldOwner, const QString &newOwner);
     255    void registerServiceNoLock(const QString &serviceName);
     256    void unregisterServiceNoLock(const QString &serviceName);
    248257
    249258signals:
     
    299308                            bool buildSignature);
    300309    static DBusHandlerResult messageFilter(DBusConnection *, DBusMessage *, void *);
     310    static bool checkReplyForDelivery(QDBusConnectionPrivate *target, QObject *object,
     311                                      int idx, const QList<int> &metaTypes,
     312                                      const QDBusMessage &msg);
    301313    static QDBusCallDeliveryEvent *prepareReply(QDBusConnectionPrivate *target, QObject *object,
    302314                                                int idx, const QList<int> &metaTypes,
     
    308320
    309321    static void setSender(const QDBusConnectionPrivate *s);
    310     static void setConnection(const QString &name, QDBusConnectionPrivate *c);
    311322
    312323    friend class QDBusActivateObjectEvent;
     
    332343QT_END_NAMESPACE
    333344
     345#endif // QT_NO_DBUS
    334346#endif
  • trunk/src/dbus/qdbusconnectioninterface.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)
     
    5151
    5252#include "qdbus_symbols_p.h"          // for the DBUS_* constants
     53
     54#ifndef QT_NO_DBUS
    5355
    5456QT_BEGIN_NAMESPACE
     
    414416
    415417QT_END_NAMESPACE
     418
     419#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusconnectioninterface.h

    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)
     
    4848#include <QtDBus/qdbusreply.h>
    4949
     50#ifndef QT_NO_DBUS
     51
    5052QT_BEGIN_HEADER
    5153
     
    6163 * Proxy class for interface org.freedesktop.DBus
    6264 */
    63 class QDBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface
     65class Q_DBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface
    6466{
    6567    Q_OBJECT
     
    127129QT_END_HEADER
    128130
     131#endif // QT_NO_DBUS
    129132#endif
  • trunk/src/dbus/qdbuscontext.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)
     
    4747#include "qdbuscontext_p.h"
    4848
     49#ifndef QT_NO_DBUS
     50
    4951QT_BEGIN_NAMESPACE
    5052
     
    203205
    204206QT_END_NAMESPACE
     207
     208#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbuscontext.h

    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)
     
    4646#include <QtDBus/qdbuserror.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    5658
    5759class QDBusContextPrivate;
    58 class QDBUS_EXPORT QDBusContext
     60class Q_DBUS_EXPORT QDBusContext
    5961{
    6062public:
     
    8284QT_END_HEADER
    8385
     86#endif // QT_NO_DBUS
    8487#endif
  • trunk/src/dbus/qdbuscontext_p.h

    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)
     
    5555#define QDBUSCONTEXT_P_H
    5656
     57#include <QtCore/qglobal.h>
     58
     59#ifndef QT_NO_DBUS
     60
    5761QT_BEGIN_NAMESPACE
    5862
     
    7579QT_END_NAMESPACE
    7680
     81#endif // QT_NO_DBUS
    7782#endif
    7883
  • trunk/src/dbus/qdbusdemarshaller.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)
  • trunk/src/dbus/qdbuserror.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)
     
    4848#include "qdbusmessage.h"
    4949#include "qdbusmessage_p.h"
     50
     51#ifndef QT_NO_DBUS
    5052
    5153QT_BEGIN_NAMESPACE
     
    364366QT_END_NAMESPACE
    365367
    366 
     368#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbuserror.h

    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)
     
    4646#include <QtCore/qstring.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    5658class QDBusMessage;
    5759
    58 class QDBUS_EXPORT QDBusError
     60class Q_DBUS_EXPORT QDBusError
    5961{
    6062public:
     
    114116
    115117#ifndef QT_NO_DEBUG_STREAM
    116 QDBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &);
     118Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &);
    117119#endif
    118120
     
    121123QT_END_HEADER
    122124
     125#endif // QT_NO_DBUS
    123126#endif
  • trunk/src/dbus/qdbusextratypes.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)
     
    4343#include "qdbusutil_p.h"
    4444
     45#ifndef QT_NO_DBUS
     46
    4547QT_BEGIN_NAMESPACE
    4648
     
    238240QT_END_NAMESPACE
    239241
     242#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusextratypes.h

    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)
     
    4949#include <QtDBus/qdbusmacros.h>
    5050
     51#ifndef QT_NO_DBUS
     52
    5153QT_BEGIN_HEADER
    5254
     
    5860Q_CORE_EXPORT uint qHash(const QString &key);
    5961
    60 class QDBUS_EXPORT QDBusObjectPath : private QString
     62class Q_DBUS_EXPORT QDBusObjectPath : private QString
    6163{
    6264public:
     
    108110
    109111
    110 class QDBUS_EXPORT QDBusSignature : private QString
     112class Q_DBUS_EXPORT QDBusSignature : private QString
    111113{
    112114public:
     
    188190QT_END_HEADER
    189191
     192#endif // QT_NO_DBUS
    190193#endif
  • trunk/src/dbus/qdbusintegrator.cpp

    r769 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)
     
    6565#include "qdbusthreaddebug_p.h"
    6666
     67#ifndef QT_NO_DBUS
     68
    6769QT_BEGIN_NAMESPACE
    6870
    6971static bool isDebugging;
    7072#define qDBusDebug              if (!::isDebugging); else qDebug
     73
     74Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
     75
     76static inline QString dbusServiceString()
     77{ return *orgFreedesktopDBusString(); }
     78static inline QString dbusInterfaceString()
     79{
     80    // it's the same string, but just be sure
     81    Q_ASSERT(*orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS));
     82    return *orgFreedesktopDBusString();
     83}
    7184
    7285static inline QDebug operator<<(QDebug dbg, const QThread *th)
     
    507520}
    508521
    509 extern QDBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
     522extern Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
    510523void qDBusAddSpyHook(QDBusSpyHook hook)
    511524{
     
    539552        (*(*list)[i])(amsg);
    540553    }
     554
     555    if (!ref)
     556        return false;
    541557
    542558    switch (amsg.type()) {
     
    550566    case QDBusMessage::ReplyMessage:
    551567    case QDBusMessage::ErrorMessage:
     568    case QDBusMessage::InvalidMessage:
    552569        return false;           // we don't handle those here
    553     case QDBusMessage::InvalidMessage:
    554         Q_ASSERT_X(false, "QDBusConnection", "Invalid message found when processing");
    555         break;
    556570    }
    557571
     
    617631
    618632        // check type:
    619         if (mm.methodType() != QMetaMethod::Slot)
     633        if (mm.methodType() != QMetaMethod::Slot && mm.methodType() != QMetaMethod::Method)
    620634            continue;
    621635
     
    681695            continue;
    682696
    683         if (isScriptable && (flags & QDBusConnection::ExportScriptableSlots) == 0)
    684             continue;           // not exported
    685         if (!isScriptable && (flags & QDBusConnection::ExportNonScriptableSlots) == 0)
    686             continue;           // not exported
     697        if (mm.methodType() == QMetaMethod::Slot) {
     698            if (isScriptable && (flags & QDBusConnection::ExportScriptableSlots) == 0)
     699                continue;           // scriptable slots not exported
     700            if (!isScriptable && (flags & QDBusConnection::ExportNonScriptableSlots) == 0)
     701                continue;           // non-scriptable slots not exported
     702        } else {
     703            if (isScriptable && (flags & QDBusConnection::ExportScriptableInvokables) == 0)
     704                continue;           // scriptable invokables not exported
     705            if (!isScriptable && (flags & QDBusConnection::ExportNonScriptableInvokables) == 0)
     706                continue;           // non-scriptable invokables not exported
     707        }
    687708
    688709        // if we got here, this slot matched
     
    693714    return -1;
    694715}
     716
     717static QDBusCallDeliveryEvent * const DIRECT_DELIVERY = (QDBusCallDeliveryEvent *)1;
    695718
    696719QDBusCallDeliveryEvent* QDBusConnectionPrivate::prepareReply(QDBusConnectionPrivate *target,
     
    705728    if (metaTypes[n] == QDBusMetaTypeId::message)
    706729        --n;
     730
     731    if (msg.arguments().count() < n)
     732        return 0;               // too few arguments
    707733
    708734    // check that types match
     
    714740    // we can deliver
    715741    // prepare for the call
     742    if (target == object)
     743        return DIRECT_DELIVERY;
    716744    return new QDBusCallDeliveryEvent(QDBusConnection(target), idx, target, msg, metaTypes);
    717745}
     
    728756    // Slots receive read-only copies of the message (i.e., pass by value or by const-ref)
    729757    QDBusCallDeliveryEvent *call = prepareReply(this, hook.obj, hook.midx, hook.params, msg);
     758    if (call == DIRECT_DELIVERY) {
     759        // short-circuit delivery
     760        Q_ASSERT(this == hook.obj);
     761        deliverCall(this, 0, msg, hook.params, hook.midx);
     762        return;
     763    }
    730764    if (call)
    731765        postEventToThread(ActivateSignalAction, hook.obj, call);
     
    759793        return false;
    760794
     795#ifndef QT_NO_PROPERTIES
    761796    Q_ASSERT_X(QThread::currentThread() == object->thread(),
    762797               "QDBusConnection: internal threading error",
     
    778813    if (cacheIt == slotCache.hash.constEnd() || cacheIt.key() != cacheKey)
    779814    {
    780         // not cached, analyse the meta object
     815        // not cached, analyze the meta object
    781816        const QMetaObject *mo = object->metaObject();
    782817        QByteArray memberName = msg.member().toUtf8();
     
    817852        return true;
    818853    }
     854#endif // QT_NO_PROPERTIES
     855    return false;
    819856}
    820857
     
    948985
    949986    rootNode.flags = 0;
     987
     988    // prepopulate watchedServices:
     989    // we know that the owner of org.freedesktop.DBus is itself
     990    watchedServices.insert(dbusServiceString(), WatchedServiceData(dbusServiceString(), 1));
     991
     992    // prepopulate matchRefCounts:
     993    // we know that org.freedesktop.DBus will never change owners
     994    matchRefCounts.insert("type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'", 1);
    950995}
    951996
     
    11741219}
    11751220
    1176 void QDBusConnectionPrivate::_q_serviceOwnerChanged(const QString &name,
    1177                                                     const QString &oldOwner, const QString &newOwner)
     1221void QDBusConnectionPrivate::serviceOwnerChangedNoLock(const QString &name,
     1222                                                       const QString &oldOwner, const QString &newOwner)
    11781223{
    11791224    Q_UNUSED(oldOwner);
    1180     QDBusWriteLocker locker(UpdateSignalHookOwnerAction, this);
     1225//    QDBusWriteLocker locker(UpdateSignalHookOwnerAction, this);
    11811226    WatchedServicesHash::Iterator it = watchedServices.find(name);
    11821227    if (it == watchedServices.end())
     
    13751420
    13761421    // try the object itself:
    1377     if (node.flags & (QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportNonScriptableSlots)) {
     1422    if (node.flags & (QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportNonScriptableSlots) ||
     1423        node.flags & (QDBusConnection::ExportScriptableInvokables|QDBusConnection::ExportNonScriptableInvokables)) {
    13781424        bool interfaceFound = true;
    13791425        if (!msg.interface().isEmpty())
     
    16311677    mode = ClientMode;
    16321678
     1679    const char *service = q_dbus_bus_get_unique_name(connection);
     1680    Q_ASSERT(service);
     1681    baseService = QString::fromUtf8(service);
     1682
    16331683    q_dbus_connection_set_exit_on_disconnect(connection, false);
    16341684    q_dbus_connection_set_watch_functions(connection, qDBusAddWatch, qDBusRemoveWatch,
     
    16371687                                            qDBusToggleTimeout, this, 0);
    16381688    q_dbus_connection_set_dispatch_status_function(connection, qDBusUpdateDispatchStatus, this, 0);
    1639 
    1640     // Initialize the match rules
    1641     // We want all messages that have us as destination
    1642     // signals don't have destinations, but connectSignal() takes care of them
    1643     const char *service = q_dbus_bus_get_unique_name(connection);
    1644     if (service) {
    1645         QVarLengthArray<char, 56> filter;
    1646         filter.append("destination='", 13);
    1647         filter.append(service, qstrlen(service));
    1648         filter.append("\'\0", 2);
    1649 
    1650         QDBusErrorInternal error;
    1651         q_dbus_bus_add_match(connection, filter.constData(), error);
    1652         if (handleError(error)) {
    1653             closeConnection();
    1654             return;
    1655         }
    1656 
    1657         baseService = QString::fromUtf8(service);
    1658     } else {
    1659         qWarning("QDBusConnectionPrivate::setConnection: Unable to get base service");
    1660     }
    1661 
    1662     QString busService = QLatin1String(DBUS_SERVICE_DBUS);
    1663     connectSignal(busService, QString(), QString(), QLatin1String("NameAcquired"), QStringList(), QString(),
    1664                   this, SLOT(registerService(QString)));
    1665     connectSignal(busService, QString(), QString(), QLatin1String("NameLost"), QStringList(), QString(),
    1666                   this, SLOT(unregisterService(QString)));
    1667 
    1668 
    16691689    q_dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0);
     1690
     1691    // Initialize the hooks for the NameAcquired and NameLost signals
     1692    // we don't use connectSignal here because we don't need the rules to be sent to the bus
     1693    // the bus will always send us these two signals
     1694    SignalHook hook;
     1695    hook.service = dbusServiceString();
     1696    hook.path.clear(); // no matching
     1697    hook.obj = this;
     1698    hook.params << QMetaType::Void << QVariant::String; // both functions take a QString as parameter and return void
     1699
     1700    hook.midx = staticMetaObject.indexOfSlot("registerServiceNoLock(QString)");
     1701    Q_ASSERT(hook.midx != -1);
     1702    signalHooks.insert(QLatin1String("NameAcquired:" DBUS_INTERFACE_DBUS), hook);
     1703
     1704    hook.midx = staticMetaObject.indexOfSlot("unregisterServiceNoLock(QString)");
     1705    Q_ASSERT(hook.midx != -1);
     1706    signalHooks.insert(QLatin1String("NameLost:" DBUS_INTERFACE_DBUS), hook);
    16701707
    16711708    qDBusDebug() << this << ": connected successfully";
     
    20542091                if (++data.refcount == 1) {
    20552092                    // we need to watch for this service changing
    2056                     QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS);
    2057                     connectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS),
     2093                    connectSignal(dbusServiceString(), QString(), dbusInterfaceString(),
    20582094                                  QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(),
    2059                                   this, SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
     2095                                  this, SLOT(serviceOwnerChangedNoLock(QString,QString,QString)));
    20602096                    data.owner = getNameOwnerNoCache(hook.service);
    20612097                    qDBusDebug() << this << "Watching service" << hook.service << "for owner changes (current owner:"
     
    21342170            if (--sit.value().refcount == 0) {
    21352171                watchedServices.erase(sit);
    2136                 QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS);
    2137                 disconnectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS),
     2172                disconnectSignal(dbusServiceString(), QString(), dbusInterfaceString(),
    21382173                              QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(),
    21392174                              this, SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
     
    22572292QString QDBusConnectionPrivate::getNameOwnerNoCache(const QString &serviceName)
    22582293{
    2259     QDBusMessage msg = QDBusMessage::createMethodCall(QLatin1String(DBUS_SERVICE_DBUS),
    2260             QLatin1String(DBUS_PATH_DBUS), QLatin1String(DBUS_INTERFACE_DBUS),
     2294    QDBusMessage msg = QDBusMessage::createMethodCall(dbusServiceString(),
     2295            QLatin1String(DBUS_PATH_DBUS), dbusInterfaceString(),
    22612296            QLatin1String("GetNameOwner"));
    22622297    QDBusMessagePrivate::setParametersValidated(msg, true);
     
    23192354{
    23202355    QDBusWriteLocker locker(RegisterServiceAction, this);
     2356    registerServiceNoLock(serviceName);
     2357}
     2358
     2359void QDBusConnectionPrivate::registerServiceNoLock(const QString &serviceName)
     2360{
    23212361    serviceNames.append(serviceName);
    23222362}
     
    23252365{
    23262366    QDBusWriteLocker locker(UnregisterServiceAction, this);
     2367    unregisterServiceNoLock(serviceName);
     2368}
     2369
     2370void QDBusConnectionPrivate::unregisterServiceNoLock(const QString &serviceName)
     2371{
    23272372    serviceNames.removeAll(serviceName);
    23282373}
     
    23442389
    23452390QT_END_NAMESPACE
     2391
     2392#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusintegrator_p.h

    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)
     
    6969#include "qdbusmessage.h"
    7070#include "qdbusconnection_p.h"
     71
     72#ifndef QT_NO_DBUS
    7173
    7274QT_BEGIN_NAMESPACE
     
    158160Q_DECLARE_METATYPE(QDBusSlotCache)
    159161
     162#endif // QT_NO_DBUS
    160163#endif
  • trunk/src/dbus/qdbusinterface.cpp

    r769 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)
     
    5050#include "qdbusconnection_p.h"
    5151
     52#ifndef QT_NO_DBUS
     53
    5254QT_BEGIN_NAMESPACE
    5355
     
    276278            QMetaObject::activate(q, metaObject, id, argv);
    277279
    278         } else if (mm.methodType() == QMetaMethod::Slot) {
     280        } else if (mm.methodType() == QMetaMethod::Slot || mm.methodType() == QMetaMethod::Method) {
    279281            // method call relay from Qt world to D-Bus world
    280282            // get D-Bus equivalent signature
     
    323325
    324326QT_END_NAMESPACE
     327
     328#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusinterface.h

    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)
     
    4646#include <QtDBus/qdbusconnection.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    5355
    5456class QDBusInterfacePrivate;
    55 class QDBUS_EXPORT QDBusInterface: public QDBusAbstractInterface
     57class Q_DBUS_EXPORT QDBusInterface: public QDBusAbstractInterface
    5658{
    5759    friend class QDBusConnection;
     
    7779QT_END_HEADER
    7880
     81#endif // QT_NO_DBUS
    7982#endif
  • trunk/src/dbus/qdbusinterface_p.h

    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)
     
    5959#include <qdbusinterface.h>
    6060
     61#ifndef QT_NO_DBUS
     62
    6163QT_BEGIN_NAMESPACE
    6264
     
    7779QT_END_NAMESPACE
    7880
     81#endif // QT_NO_DBUS
    7982#endif
  • trunk/src/dbus/qdbusinternalfilters.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)
     
    5757#include "qdbusmessage_p.h"
    5858#include "qdbusutil_p.h"
     59
     60#ifndef QT_NO_DBUS
    5961
    6062QT_BEGIN_NAMESPACE
     
    8688    "      <arg name=\"interface_name\" type=\"s\" direction=\"in\"/>\n"
    8789    "      <arg name=\"values\" type=\"a{sv}\" direction=\"out\"/>\n"
    88     "      <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"QVariantMap\"/>"
     90    "      <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"QVariantMap\"/>\n"
    8991    "    </method>\n"
    9092    "  </interface>\n";
     
    498500
    499501QT_END_NAMESPACE
     502
     503#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusintrospection.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)
     
    4242#include "qdbusintrospection_p.h"
    4343#include "qdbusxmlparser_p.h"
     44
     45#ifndef QT_NO_DBUS
    4446
    4547QT_BEGIN_NAMESPACE
     
    424426
    425427QT_END_NAMESPACE
     428
     429#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusintrospection_p.h

    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)
     
    6464QT_BEGIN_NAMESPACE
    6565
    66 class QDBUS_EXPORT QDBusIntrospection
     66class Q_DBUS_EXPORT QDBusIntrospection
    6767{
    6868public:
  • trunk/src/dbus/qdbusmacros.h

    r769 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)
     
    4747#include <QtCore/qvariant.h>
    4848
    49 #if defined(QDBUS_MAKEDLL)
    50 # define QDBUS_EXPORT Q_DECL_EXPORT
    51 #elif defined(QT_SHARED)
    52 # define QDBUS_EXPORT Q_DECL_IMPORT
    53 #else
    54 # define QDBUS_EXPORT
    55 #endif
    56 
    5749#ifndef Q_MOC_RUN
    5850# define Q_NOREPLY
     
    6759
    6860// prevent syncqt complaints
     61#ifndef QT_NO_DBUS
     62
    6963QT_BEGIN_HEADER
    7064QT_BEGIN_NAMESPACE
     
    7367QT_END_HEADER
    7468
     69#endif // QT_NO_DBUS
    7570#endif
  • trunk/src/dbus/qdbusmarshaller.cpp

    r769 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)
     
    4343#include "qdbusmetatype_p.h"
    4444#include "qdbusutil_p.h"
     45
     46#ifndef QT_NO_DBUS
    4547
    4648QT_BEGIN_NAMESPACE
     
    506508        int element = q_dbus_message_iter_get_element_type(&demarshaller->iterator);
    507509        if (q_dbus_type_is_fixed(element)) {
    508             // another optimisation: fixed size arrays
     510            // another optimization: fixed size arrays
    509511            // code is exactly like QDBusDemarshaller::toByteArray
    510512            DBusMessageIter sub;
     
    515517            q_dbus_message_iter_get_fixed_array(&sub,&data,&len);
    516518
    517             char signature[2] = { element, 0 };
     519            char signature[2] = { char(element), 0 };
    518520            q_dbus_message_iter_open_container(&iterator, DBUS_TYPE_ARRAY, signature, &sub);
    519521            q_dbus_message_iter_append_fixed_array(&sub, element, &data, len);
     
    549551
    550552QT_END_NAMESPACE
     553
     554#endif // QT_NO_DBUS
  • 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
  • trunk/src/dbus/qdbusmessage.h

    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)
     
    4848#include <QtCore/qvariant.h>
    4949
     50#ifndef QT_NO_DBUS
     51
    5052QT_BEGIN_HEADER
    5153
     
    5557
    5658class QDBusMessagePrivate;
    57 class QDBUS_EXPORT QDBusMessage
     59class Q_DBUS_EXPORT QDBusMessage
    5860{
    5961public:
     
    105107    bool isDelayedReply() const;
    106108
     109    void setAutoStartService(bool enable);
     110    bool autoStartService() const;
     111
    107112    void setArguments(const QList<QVariant> &arguments);
    108113    QList<QVariant> arguments() const;
     
    116121
    117122#ifndef QT_NO_DEBUG_STREAM
    118 QDBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &);
     123Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &);
    119124#endif
    120125
     
    123128QT_END_HEADER
    124129
     130#endif // QT_NO_DBUS
    125131#endif
    126132
  • trunk/src/dbus/qdbusmessage_p.h

    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)
     
    6060struct DBusMessage;
    6161
     62#ifndef QT_NO_DBUS
     63
    6264QT_BEGIN_NAMESPACE
    6365
     
    8688    uint localMessage : 1;
    8789    mutable uint parametersValidated : 1;
     90    uint autoStartService : 1;
    8891
    8992    static void setParametersValidated(QDBusMessage &msg, bool enable)
     
    102105QT_END_NAMESPACE
    103106
     107#endif // QT_NO_DBUS
    104108#endif
  • trunk/src/dbus/qdbusmetaobject.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)
     
    5353#include "qdbusintrospection_p.h"
    5454#include "qdbusabstractinterface_p.h"
     55
     56#ifndef QT_NO_DBUS
    5557
    5658QT_BEGIN_NAMESPACE
     
    678680QT_END_NAMESPACE
    679681
     682#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusmetaobject_p.h

    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)
     
    6363
    6464struct QDBusMetaObjectPrivate;
    65 struct QDBUS_EXPORT QDBusMetaObject: public QMetaObject
     65struct Q_DBUS_EXPORT QDBusMetaObject: public QMetaObject
    6666{
    6767    bool cached;
  • trunk/src/dbus/qdbusmetatype.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 "qdbusmetatype_p.h"
    5555#include "qdbusargument_p.h"
     56
     57#ifndef QT_NO_DBUS
    5658
    5759Q_DECLARE_METATYPE(QList<bool>)
     
    241243        QVector<QDBusCustomTypeInfo> *ct = customTypes();
    242244        if (id >= ct->size())
    243             return false;       // non-existant
     245            return false;       // non-existent
    244246
    245247        const QDBusCustomTypeInfo &info = (*ct).at(id);
     
    270272        QVector<QDBusCustomTypeInfo> *ct = customTypes();
    271273        if (id >= ct->size())
    272             return false;       // non-existant
     274            return false;       // non-existent
    273275
    274276        const QDBusCustomTypeInfo &info = (*ct).at(id);
     
    463465
    464466QT_END_NAMESPACE
     467
     468#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusmetatype.h

    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)
     
    4646#include <QtDBus/qdbusargument.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    5254QT_MODULE(DBus)
    5355
    54 class QDBUS_EXPORT QDBusMetaType
     56class Q_DBUS_EXPORT QDBusMetaType
    5557{
    5658public:
     
    9597QT_END_HEADER
    9698
     99#endif // QT_NO_DBUS
    97100#endif
  • trunk/src/dbus/qdbusmetatype_p.h

    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)
  • trunk/src/dbus/qdbusmisc.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)
     
    5050#include "qdbusmetatype_p.h"
    5151#include "qdbusabstractadaptor_p.h" // for QCLASSINFO_DBUS_*
     52
     53#ifndef QT_NO_DBUS
    5254
    5355QT_BEGIN_NAMESPACE
     
    196198
    197199QT_END_NAMESPACE
     200
     201#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbuspendingcall.cpp

    r769 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)
     
    4848#include "qcoreevent.h"
    4949#include <private/qobject_p.h>
     50
     51#ifndef QT_NO_DBUS
    5052
    5153QT_BEGIN_NAMESPACE
     
    533535QT_END_NAMESPACE
    534536
     537#endif // QT_NO_DBUS
     538
    535539#include "moc_qdbuspendingcall.cpp"
  • trunk/src/dbus/qdbuspendingcall.h

    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)
     
    5050#include <QtDBus/qdbusmessage.h>
    5151
     52#ifndef QT_NO_DBUS
     53
    5254QT_BEGIN_HEADER
    5355
     
    6163
    6264class QDBusPendingCallPrivate;
    63 class QDBUS_EXPORT QDBusPendingCall
     65class Q_DBUS_EXPORT QDBusPendingCall
    6466{
    6567public:
     
    9597
    9698class QDBusPendingCallWatcherPrivate;
    97 class QDBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall
     99class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall
    98100{
    99101    Q_OBJECT
     
    120122QT_END_HEADER
    121123
     124#endif // QT_NO_DBUS
    122125#endif
  • trunk/src/dbus/qdbuspendingcall_p.h

    r769 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)
     
    6363#include "qdbusmessage.h"
    6464#include "qdbus_symbols_p.h"
     65
     66#ifndef QT_NO_DBUS
    6567
    6668QT_BEGIN_NAMESPACE
     
    136138QT_END_NAMESPACE
    137139
     140#endif // QT_NO_DBUS
    138141#endif
  • trunk/src/dbus/qdbuspendingreply.cpp

    r769 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)
     
    4444#include "qdbusmetatype.h"
    4545
     46#ifndef QT_NO_DBUS
     47
    4648/*!
    4749    \class QDBusPendingReply
     
    277279}
    278280
     281#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbuspendingreply.h

    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)
     
    4848#include <QtDBus/qdbuspendingcall.h>
    4949
     50#ifndef QT_NO_DBUS
     51
    5052QT_BEGIN_HEADER
    5153
     
    5456QT_MODULE(DBus)
    5557
    56 class QDBUS_EXPORT QDBusPendingReplyData: public QDBusPendingCall
     58class Q_DBUS_EXPORT QDBusPendingReplyData: public QDBusPendingCall
    5759{
    5860protected:
     
    8486    template<typename T1> inline int metaTypeFor(T1 * = 0)
    8587    { return qMetaTypeId<T1>(); }
    86     // specialise for QVariant, allowing it to be used in place of QDBusVariant
     88    // specialize for QVariant, allowing it to be used in place of QDBusVariant
    8789    template<> inline int metaTypeFor<QVariant>(QVariant *)
    8890    { return qMetaTypeId<QDBusVariant>(); }
     
    212214QT_END_HEADER
    213215
    214 #endif
     216#endif // QT_NO_DBUS
     217#endif
  • trunk/src/dbus/qdbusreply.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)
     
    4444#include "qdbusmetatype_p.h"
    4545#include <QDebug>
     46
     47#ifndef QT_NO_DBUS
    4648
    4749QT_BEGIN_NAMESPACE
     
    243245
    244246QT_END_NAMESPACE
     247
     248#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusreply.h

    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)
     
    5252#include <QtDBus/qdbuspendingreply.h>
    5353
     54#ifndef QT_NO_DBUS
     55
    5456QT_BEGIN_HEADER
    5557
     
    5860QT_MODULE(DBus)
    5961
    60 QDBUS_EXPORT void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data);
     62Q_DBUS_EXPORT void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data);
    6163
    6264template<typename T>
     
    194196QT_END_HEADER
    195197
     198#endif // QT_NO_DBUS
    196199#endif
  • trunk/src/dbus/qdbusserver.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)
     
    4343#include "qdbusconnection_p.h"
    4444
     45#ifndef QT_NO_DBUS
     46
    4547QT_BEGIN_NAMESPACE
    4648
     
    4850    \class QDBusServer
    4951    \inmodule QtDBus
    50     \since 4.2
     52    \internal
    5153
    5254    \brief The QDBusServer class provides peer-to-peer communication
     
    99101
    100102/*!
    101     Returns the address this server is assosiated with.
     103    Returns the address this server is associated with.
    102104*/
    103105QString QDBusServer::address() const
     
    120122
    121123QT_END_NAMESPACE
     124
     125#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusserver.h

    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)
     
    4646#include <QtDBus/qdbusmacros.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    5658class QDBusConnection;
    5759
    58 class QDBUS_EXPORT QDBusServer: public QObject
     60class Q_DBUS_EXPORT QDBusServer: public QObject
    5961{
    6062    Q_OBJECT
     
    7880QT_END_HEADER
    7981
     82#endif // QT_NO_DBUS
    8083#endif
  • trunk/src/dbus/qdbusservicewatcher.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)
     
    4848#include <private/qobject_p.h>
    4949
     50#ifndef QT_NO_DBUS
     51
    5052QT_BEGIN_NAMESPACE
    5153
     
    375377QT_END_NAMESPACE
    376378
     379#endif // QT_NO_DBUS
     380
    377381#include "moc_qdbusservicewatcher.cpp"
  • trunk/src/dbus/qdbusservicewatcher.h

    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)
     
    4646#include <QtDBus/qdbusmacros.h>
    4747
     48#ifndef QT_NO_DBUS
     49
    4850QT_BEGIN_HEADER
    4951
     
    5557
    5658class QDBusServiceWatcherPrivate;
    57 class QDBUS_EXPORT QDBusServiceWatcher: public QObject
     59class Q_DBUS_EXPORT QDBusServiceWatcher: public QObject
    5860{
    5961    Q_OBJECT
     
    101103QT_END_HEADER
    102104
     105#endif // QT_NO_DBUS
    103106#endif // QDBUSSERVICEWATCHER_H
  • trunk/src/dbus/qdbusthreaddebug_p.h

    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)
     
    5353//
    5454
     55#include <QtCore/qglobal.h>
     56
     57#ifndef QT_NO_DBUS
     58
    5559#if !defined(QDBUS_THREAD_DEBUG) && defined(QT_BUILD_INTERNAL)
    5660# define QDBUS_THREAD_DEBUG 1
     
    6064QT_BEGIN_NAMESPACE
    6165typedef void (*qdbusThreadDebugFunc)(int, int, QDBusConnectionPrivate *);
    62 QDBUS_EXPORT void qdbusDefaultThreadDebug(int, int, QDBusConnectionPrivate *);
    63 extern QDBUS_EXPORT qdbusThreadDebugFunc qdbusThreadDebug;
     66Q_DBUS_EXPORT void qdbusDefaultThreadDebug(int, int, QDBusConnectionPrivate *);
     67extern Q_DBUS_EXPORT qdbusThreadDebugFunc qdbusThreadDebug;
    6468QT_END_NAMESPACE
    6569#endif
     
    228232#endif
    229233
    230 #endif
     234#endif // QT_NO_DBUS
     235#endif
  • trunk/src/dbus/qdbusutil.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)
     
    4747
    4848#include "qdbusargument.h"
     49
     50#ifndef QT_NO_DBUS
    4951
    5052QT_BEGIN_NAMESPACE
     
    308310
    309311        Unique connection names start with a colon (":") and are followed by a list of dot-separated
    310         components composed of ASCII letters, digits, the hypen or the underscore ("_") character.
     312        components composed of ASCII letters, digits, the hyphen or the underscore ("_") character.
    311313    */
    312314    bool isValidUniqueConnectionName(const QString &connName)
     
    467469
    468470QT_END_NAMESPACE
     471
     472#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusutil_p.h

    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)
     
    6060#include <QtDBus/qdbuserror.h>
    6161
     62#ifndef QT_NO_DBUS
     63
    6264QT_BEGIN_HEADER
    6365
     
    6668namespace QDBusUtil
    6769{
    68     QDBUS_EXPORT bool isValidInterfaceName(const QString &ifaceName);
     70    Q_DBUS_EXPORT bool isValidInterfaceName(const QString &ifaceName);
    6971
    70     QDBUS_EXPORT bool isValidUniqueConnectionName(const QString &busName);
     72    Q_DBUS_EXPORT bool isValidUniqueConnectionName(const QString &busName);
    7173
    72     QDBUS_EXPORT bool isValidBusName(const QString &busName);
     74    Q_DBUS_EXPORT bool isValidBusName(const QString &busName);
    7375
    74     QDBUS_EXPORT bool isValidMemberName(const QString &memberName);
     76    Q_DBUS_EXPORT bool isValidMemberName(const QString &memberName);
    7577
    76     QDBUS_EXPORT bool isValidErrorName(const QString &errorName);
     78    Q_DBUS_EXPORT bool isValidErrorName(const QString &errorName);
    7779
    78     QDBUS_EXPORT bool isValidPartOfObjectPath(const QString &path);
     80    Q_DBUS_EXPORT bool isValidPartOfObjectPath(const QString &path);
    7981
    80     QDBUS_EXPORT bool isValidObjectPath(const QString &path);
     82    Q_DBUS_EXPORT bool isValidObjectPath(const QString &path);
    8183
    82     QDBUS_EXPORT bool isValidSignature(const QString &signature);
     84    Q_DBUS_EXPORT bool isValidSignature(const QString &signature);
    8385
    84     QDBUS_EXPORT bool isValidSingleSignature(const QString &signature);
     86    Q_DBUS_EXPORT bool isValidSingleSignature(const QString &signature);
    8587
    86     QDBUS_EXPORT QString argumentToString(const QVariant &variant);
     88    Q_DBUS_EXPORT QString argumentToString(const QVariant &variant);
    8789
    8890    enum AllowEmptyFlag {
     
    158160QT_END_HEADER
    159161
     162#endif // QT_NO_DBUS
    160163#endif
  • trunk/src/dbus/qdbusxmlgenerator.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)
     
    5050#include "qdbusutil_p.h"
    5151
     52#ifndef QT_NO_DBUS
     53
    5254QT_BEGIN_NAMESPACE
    5355
    54 extern QDBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,
     56extern Q_DBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,
    5557                                                       const QMetaObject *base, int flags);
    5658
     
    132134            // adding a signal
    133135            isSignal = true;
    134         else if (mm.methodType() == QMetaMethod::Slot && mm.access() == QMetaMethod::Public)
     136        else if (mm.access() == QMetaMethod::Public && (mm.methodType() == QMetaMethod::Slot || mm.methodType() == QMetaMethod::Method))
    135137            isSignal = false;
    136138        else
     
    140142                                   QDBusConnection::ExportNonScriptableSignals)))
    141143            continue;           // we're not exporting any signals
    142         if (!isSignal && !(flags & (QDBusConnection::ExportScriptableSlots |
    143                                     QDBusConnection::ExportNonScriptableSlots)))
    144             continue;           // we're not exporting any slots
     144        if (!isSignal && (!(flags & (QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportNonScriptableSlots)) &&
     145                          !(flags & (QDBusConnection::ExportScriptableInvokables | QDBusConnection::ExportNonScriptableInvokables))))
     146            continue;           // we're not exporting any slots or invokables
    145147
    146148        QString xml = QString::fromLatin1("    <%1 name=\"%2\">\n")
     
    159161                if (QDBusMetaType::signatureToType(typeName) == QVariant::Invalid)
    160162                    xml += QString::fromLatin1("      <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"%1\"/>\n")
    161                            .arg(typeNameToXml(mm.typeName()));
     163                        .arg(typeNameToXml(QVariant::typeToName(QVariant::Type(typeId))));
    162164            } else
    163165                continue;
     
    303305
    304306QT_END_NAMESPACE
     307
     308#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusxmlparser.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)
     
    5050#include <QtCore/qvariant.h>
    5151#include <QtCore/qtextstream.h>
     52
     53#ifndef QT_NO_DBUS
    5254
    5355QT_BEGIN_NAMESPACE
     
    368370
    369371QT_END_NAMESPACE
     372
     373#endif // QT_NO_DBUS
  • trunk/src/dbus/qdbusxmlparser_p.h

    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)
     
    5959#include "qdbusintrospection_p.h"
    6060
     61#ifndef QT_NO_DBUS
     62
    6163QT_BEGIN_NAMESPACE
    6264
     
    8385QT_END_NAMESPACE
    8486
     87#endif // QT_NO_DBUS
    8588#endif
Note: See TracChangeset for help on using the changeset viewer.