| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusextratypes.cpp |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||
| 2 | ** | - | ||||||
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. | - | ||||||
| 4 | ** Contact: http://www.qt.io/licensing/ | - | ||||||
| 5 | ** | - | ||||||
| 6 | ** This file is part of the QtDBus module of the Qt Toolkit. | - | ||||||
| 7 | ** | - | ||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL21$ | - | ||||||
| 9 | ** Commercial License Usage | - | ||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further | - | ||||||
| 15 | ** information use the contact form at http://www.qt.io/contact-us. | - | ||||||
| 16 | ** | - | ||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
| 19 | ** General Public License version 2.1 or version 3 as published by the Free | - | ||||||
| 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and | - | ||||||
| 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the | - | ||||||
| 22 | ** following information to ensure the GNU Lesser General Public License | - | ||||||
| 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | - | ||||||
| 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - | ||||||
| 25 | ** | - | ||||||
| 26 | ** As a special exception, The Qt Company gives you certain additional | - | ||||||
| 27 | ** rights. These rights are described in The Qt Company LGPL Exception | - | ||||||
| 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - | ||||||
| 29 | ** | - | ||||||
| 30 | ** $QT_END_LICENSE$ | - | ||||||
| 31 | ** | - | ||||||
| 32 | ****************************************************************************/ | - | ||||||
| 33 | - | |||||||
| 34 | #include "qdbusextratypes.h" | - | ||||||
| 35 | #include "qdbusutil_p.h" | - | ||||||
| 36 | - | |||||||
| 37 | #ifndef QT_NO_DBUS | - | ||||||
| 38 | - | |||||||
| 39 | QT_BEGIN_NAMESPACE | - | ||||||
| 40 | - | |||||||
| 41 | void QDBusObjectPath::doCheck() | - | ||||||
| 42 | { | - | ||||||
| 43 | if (!QDBusUtil::isValidObjectPath(m_path)) {
| 5-700 | ||||||
| 44 | qWarning("QDBusObjectPath: invalid path \"%s\"", qPrintable(m_path)); | - | ||||||
| 45 | m_path.clear(); | - | ||||||
| 46 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||
| 47 | } executed 705 times by 19 tests: end of blockExecuted by:
| 705 | ||||||
| 48 | - | |||||||
| 49 | void QDBusSignature::doCheck() | - | ||||||
| 50 | { | - | ||||||
| 51 | if (!QDBusUtil::isValidSignature(m_signature)) {
| 5-49 | ||||||
| 52 | qWarning("QDBusSignature: invalid signature \"%s\"", qPrintable(m_signature)); | - | ||||||
| 53 | m_signature.clear(); | - | ||||||
| 54 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||
| 55 | } executed 54 times by 3 tests: end of blockExecuted by:
| 54 | ||||||
| 56 | - | |||||||
| 57 | /*! | - | ||||||
| 58 | \class QDBusVariant | - | ||||||
| 59 | \inmodule QtDBus | - | ||||||
| 60 | \since 4.2 | - | ||||||
| 61 | - | |||||||
| 62 | \brief The QDBusVariant class enables the programmer to identify | - | ||||||
| 63 | the variant type provided by the D-Bus typesystem. | - | ||||||
| 64 | - | |||||||
| 65 | A D-Bus function that takes an integer, a D-Bus variant and a string as parameters | - | ||||||
| 66 | can be called with the following argument list (see QDBusMessage::setArguments()): | - | ||||||
| 67 | - | |||||||
| 68 | \snippet qdbusextratypes/qdbusextratypes.cpp 0 | - | ||||||
| 69 | - | |||||||
| 70 | When a D-Bus function returns a D-Bus variant, it can be retrieved as follows: | - | ||||||
| 71 | - | |||||||
| 72 | \snippet qdbusextratypes/qdbusextratypes.cpp 1 | - | ||||||
| 73 | - | |||||||
| 74 | The QVariant within a QDBusVariant is required to distinguish between a normal | - | ||||||
| 75 | D-Bus value and a value within a D-Bus variant. | - | ||||||
| 76 | - | |||||||
| 77 | \sa {The Qt D-Bus Type System} | - | ||||||
| 78 | */ | - | ||||||
| 79 | - | |||||||
| 80 | /*! | - | ||||||
| 81 | \fn QDBusVariant::QDBusVariant() | - | ||||||
| 82 | - | |||||||
| 83 | Constructs a new D-Bus variant. | - | ||||||
| 84 | */ | - | ||||||
| 85 | - | |||||||
| 86 | /*! | - | ||||||
| 87 | \fn QDBusVariant::QDBusVariant(const QVariant &variant) | - | ||||||
| 88 | - | |||||||
| 89 | Constructs a new D-Bus variant from the given Qt \a variant. | - | ||||||
| 90 | - | |||||||
| 91 | \sa setVariant() | - | ||||||
| 92 | */ | - | ||||||
| 93 | - | |||||||
| 94 | /*! | - | ||||||
| 95 | \fn QVariant QDBusVariant::variant() const | - | ||||||
| 96 | - | |||||||
| 97 | Returns this D-Bus variant as a QVariant object. | - | ||||||
| 98 | - | |||||||
| 99 | \sa setVariant() | - | ||||||
| 100 | */ | - | ||||||
| 101 | - | |||||||
| 102 | /*! | - | ||||||
| 103 | \fn void QDBusVariant::setVariant(const QVariant &variant) | - | ||||||
| 104 | - | |||||||
| 105 | Assigns the value of the given Qt \a variant to this D-Bus variant. | - | ||||||
| 106 | - | |||||||
| 107 | \sa variant() | - | ||||||
| 108 | */ | - | ||||||
| 109 | - | |||||||
| 110 | /*! | - | ||||||
| 111 | \class QDBusObjectPath | - | ||||||
| 112 | \inmodule QtDBus | - | ||||||
| 113 | \since 4.2 | - | ||||||
| 114 | - | |||||||
| 115 | \brief The QDBusObjectPath class enables the programmer to | - | ||||||
| 116 | identify the OBJECT_PATH type provided by the D-Bus typesystem. | - | ||||||
| 117 | - | |||||||
| 118 | \sa {The Qt D-Bus Type System} | - | ||||||
| 119 | */ | - | ||||||
| 120 | - | |||||||
| 121 | /*! | - | ||||||
| 122 | \fn QDBusObjectPath::QDBusObjectPath() | - | ||||||
| 123 | - | |||||||
| 124 | Constructs a new object path. | - | ||||||
| 125 | */ | - | ||||||
| 126 | - | |||||||
| 127 | /*! | - | ||||||
| 128 | \fn QDBusObjectPath::QDBusObjectPath(const char *path) | - | ||||||
| 129 | - | |||||||
| 130 | Constructs a new object path from the given \a path. | - | ||||||
| 131 | - | |||||||
| 132 | \sa setPath() | - | ||||||
| 133 | */ | - | ||||||
| 134 | - | |||||||
| 135 | /*! | - | ||||||
| 136 | \fn QDBusObjectPath::QDBusObjectPath(QLatin1String path) | - | ||||||
| 137 | - | |||||||
| 138 | Constructs a new object path from the given \a path. | - | ||||||
| 139 | */ | - | ||||||
| 140 | - | |||||||
| 141 | /*! | - | ||||||
| 142 | \fn QDBusObjectPath::QDBusObjectPath(const QString &path) | - | ||||||
| 143 | - | |||||||
| 144 | Constructs a new object path from the given \a path. | - | ||||||
| 145 | */ | - | ||||||
| 146 | - | |||||||
| 147 | /*! | - | ||||||
| 148 | \fn QString QDBusObjectPath::path() const | - | ||||||
| 149 | - | |||||||
| 150 | Returns this object path. | - | ||||||
| 151 | - | |||||||
| 152 | \sa setPath() | - | ||||||
| 153 | */ | - | ||||||
| 154 | - | |||||||
| 155 | /*! | - | ||||||
| 156 | \fn void QDBusObjectPath::setPath(const QString &path) | - | ||||||
| 157 | - | |||||||
| 158 | Assigns the value of the given \a path to this object path. | - | ||||||
| 159 | - | |||||||
| 160 | \sa path() | - | ||||||
| 161 | */ | - | ||||||
| 162 | - | |||||||
| 163 | /*! | - | ||||||
| 164 | \class QDBusSignature | - | ||||||
| 165 | \inmodule QtDBus | - | ||||||
| 166 | \since 4.2 | - | ||||||
| 167 | - | |||||||
| 168 | \brief The QDBusSignature class enables the programmer to | - | ||||||
| 169 | identify the SIGNATURE type provided by the D-Bus typesystem. | - | ||||||
| 170 | - | |||||||
| 171 | \sa {The Qt D-Bus Type System} | - | ||||||
| 172 | */ | - | ||||||
| 173 | - | |||||||
| 174 | /*! | - | ||||||
| 175 | \fn QDBusSignature::QDBusSignature() | - | ||||||
| 176 | - | |||||||
| 177 | Constructs a new signature. | - | ||||||
| 178 | - | |||||||
| 179 | \sa setSignature() | - | ||||||
| 180 | */ | - | ||||||
| 181 | - | |||||||
| 182 | /*! | - | ||||||
| 183 | \fn QDBusSignature::QDBusSignature(const char *signature) | - | ||||||
| 184 | - | |||||||
| 185 | Constructs a new signature from the given \a signature. | - | ||||||
| 186 | */ | - | ||||||
| 187 | - | |||||||
| 188 | /*! | - | ||||||
| 189 | \fn QDBusSignature::QDBusSignature(QLatin1String signature) | - | ||||||
| 190 | - | |||||||
| 191 | Constructs a new signature from the given \a signature. | - | ||||||
| 192 | */ | - | ||||||
| 193 | - | |||||||
| 194 | /*! | - | ||||||
| 195 | \fn QDBusSignature::QDBusSignature(const QString &signature) | - | ||||||
| 196 | - | |||||||
| 197 | Constructs a new signature from the given \a signature. | - | ||||||
| 198 | */ | - | ||||||
| 199 | - | |||||||
| 200 | /*! | - | ||||||
| 201 | \fn QString QDBusSignature::signature() const | - | ||||||
| 202 | - | |||||||
| 203 | Returns this signature. | - | ||||||
| 204 | - | |||||||
| 205 | \sa setSignature() | - | ||||||
| 206 | */ | - | ||||||
| 207 | - | |||||||
| 208 | /*! | - | ||||||
| 209 | \fn void QDBusSignature::setSignature(const QString &signature) | - | ||||||
| 210 | - | |||||||
| 211 | Assigns the value of the given \a signature to this signature. | - | ||||||
| 212 | \sa signature() | - | ||||||
| 213 | */ | - | ||||||
| 214 | - | |||||||
| 215 | QT_END_NAMESPACE | - | ||||||
| 216 | - | |||||||
| 217 | #endif // QT_NO_DBUS | - | ||||||
| Source code | Switch to Preprocessed file |