diff options
42 files changed, 1583 insertions, 94 deletions
@@ -6767,8 +6767,15 @@ if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" if [ $? != "0" ]; then CFG_JAVASCRIPTCORE_JIT=no fi - elif [ "$XPLATFORM" = "symbian-gcce" ]; then - CFG_JAVASCRIPTCORE_JIT=no + else + case "$XPLATFORM" in + symbian-gcce) + CFG_JAVASCRIPTCORE_JIT=no + ;; + linux-icc*) + CFG_JAVASCRIPTCORE_JIT=no + ;; + esac fi fi @@ -8602,7 +8609,7 @@ case "$CFG_WEBKIT" in debug) echo "WebKit module .......... yes (debug)" ;; no) echo "WebKit module .......... no" ;; esac -if [ "$CFG_WEBKIT" != "no" ]; then +if [ "$CFG_WEBKIT" != "no" ] || [ "$CFG_SCRIPT" != "no" ]; then if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then echo "JavaScriptCore JIT ..... To be decided by JavaScriptCore" else diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index e79f87a..2949cd0 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -49,22 +49,51 @@ QT_BEGIN_NAMESPACE // we allow for 2^24 = 8^8 = 16777216 simultaneously running timers -enum { NumberOfBuckets = 8, FirstBucketSize = 8 }; - -static const int BucketSize[NumberOfBuckets] = - { 8, 64, 512, 4096, 32768, 262144, 2097152, 16777216 - 2396744 }; -static const int BucketOffset[NumberOfBuckets] = - { 0, 8, 72, 584, 4680, 37448, 299592, 2396744 }; - -static int FirstBucket[FirstBucketSize] = { 1, 2, 3, 4, 5, 6, 7, 8 }; -static QBasicAtomicPointer<int> timerIds[NumberOfBuckets] = +static const int TimerIdMask = 0x00ffffff; +static const int TimerSerialMask = ~TimerIdMask & ~0x80000000; +static const int TimerSerialCounter = TimerIdMask + 1; +static const int MaxTimerId = TimerIdMask; + +static int FirstBucket[] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 +}; + +enum { + FirstBucketOffset = 0, + SecondBucketOffset = sizeof(FirstBucket) / sizeof(FirstBucket[0]), + ThirdBucketOffset = 0x100, + FourthBucketOffset = 0x1000, + FifthBucketOffset = 0x10000, + SixthBucketOffset = 0x100000 +}; + +enum { + FirstBucketSize = SecondBucketOffset, + SecondBucketSize = ThirdBucketOffset - SecondBucketOffset, + ThirdBucketSize = FourthBucketOffset - ThirdBucketOffset, + FourthBucketSize = FifthBucketOffset - FourthBucketOffset, + FifthBucketSize = SixthBucketOffset - FifthBucketOffset, + SixthBucketSize = MaxTimerId - SixthBucketOffset +}; + +static const int BucketSize[] = { + FirstBucketSize, SecondBucketSize, ThirdBucketSize, + FourthBucketSize, FifthBucketSize, SixthBucketSize +}; +enum { NumberOfBuckets = sizeof(BucketSize) / sizeof(BucketSize[0]) }; + +static const int BucketOffset[] = { + FirstBucketOffset, SecondBucketOffset, ThirdBucketOffset, + FourthBucketOffset, FifthBucketOffset, SixthBucketOffset +}; + +static QBasicAtomicPointer<int> timerIds[] = { Q_BASIC_ATOMIC_INITIALIZER(FirstBucket), Q_BASIC_ATOMIC_INITIALIZER(0), Q_BASIC_ATOMIC_INITIALIZER(0), Q_BASIC_ATOMIC_INITIALIZER(0), Q_BASIC_ATOMIC_INITIALIZER(0), - Q_BASIC_ATOMIC_INITIALIZER(0), - Q_BASIC_ATOMIC_INITIALIZER(0), Q_BASIC_ATOMIC_INITIALIZER(0) }; static void timerIdsDestructorFunction() @@ -77,18 +106,23 @@ Q_DESTRUCTOR_FUNCTION(timerIdsDestructorFunction) static QBasicAtomicInt nextFreeTimerId = Q_BASIC_ATOMIC_INITIALIZER(1); -static const int TimerIdMask = 0x00ffffff; -static const int TimerSerialMask = ~TimerIdMask & ~0x80000000; -static const int TimerSerialCounter = TimerIdMask + 1; - // avoid the ABA-problem by using 7 of the top 8 bits of the timerId as a serial number static inline int prepareNewValueWithSerialNumber(int oldId, int newId) { return (newId & TimerIdMask) | ((oldId + TimerSerialCounter) & TimerSerialMask); } +namespace { + template<bool> struct QStaticAssertType; + template<> struct QStaticAssertType<true> { enum { Value = 1 }; }; +} +#define q_static_assert(expr) (void)QStaticAssertType<expr>::Value + static inline int bucketOffset(int timerId) { + q_static_assert(sizeof BucketSize == sizeof BucketOffset); + q_static_assert(sizeof(timerIds) / sizeof(timerIds[0]) == NumberOfBuckets); + for (int i = 0; i < NumberOfBuckets; ++i) { if (timerId < BucketSize[i]) return i; @@ -187,7 +221,8 @@ void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId) int at = bucketIndex(bucket, which); int *b = timerIds[bucket]; - Q_ASSERT(b[at] == -timerId); + Q_ASSERT_X(timerId == -b[at], "QAbstractEventDispatcher::releaseTimerId", + "Internal error: timer ID not found"); int freeId, newTimerId; do { diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 52ed217..08c9ea1 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -59,7 +59,8 @@ HEADERS += $$PUB_HEADERS \ qdbusintegrator_p.h \ qdbuspendingcall_p.h \ qdbus_symbols_p.h \ - qdbusservicewatcher.h + qdbusservicewatcher.h \ + qdbusunixfiledescriptor.h SOURCES += qdbusconnection.cpp \ qdbusconnectioninterface.cpp \ qdbuserror.cpp \ @@ -85,4 +86,5 @@ SOURCES += qdbusconnection.cpp \ qdbuspendingcall.cpp \ qdbuspendingreply.cpp \ qdbus_symbols.cpp \ - qdbusservicewatcher.cpp + qdbusservicewatcher.cpp \ + qdbusunixfiledescriptor.cpp diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h index c5f55af..039657e 100644 --- a/src/dbus/qdbus_symbols_p.h +++ b/src/dbus/qdbus_symbols_p.h @@ -296,6 +296,12 @@ DEFINEFUNC(dbus_bool_t , dbus_message_set_sender, (DBusMessage *message, DEFINEFUNC(void , dbus_message_unref, (DBusMessage *message), (message), ) +/* dbus-misc.h */ +DEFINEFUNC(void , dbus_get_version , (int *major_version_p, + int *minor_version_p, + int *micro_version_p), + (major_version_p, minor_version_p, micro_version_p), ) + /* dbus-pending-call.h */ DEFINEFUNC(dbus_bool_t , dbus_pending_call_set_notify, (DBusPendingCall *pending, DBusPendingCallNotifyFunction function, @@ -352,21 +358,17 @@ DEFINEFUNC(dbus_bool_t , dbus_server_set_watch_functions, (DBusServer DEFINEFUNC(void , dbus_server_unref, (DBusServer *server), (server), ) -/* dbus-signature.h */ -DEFINEFUNC(dbus_bool_t , dbus_signature_validate, (const char *signature, - DBusError *error), - (signature, error), return) -DEFINEFUNC(dbus_bool_t , dbus_signature_validate_single, (const char *signature, - DBusError *error), - (signature, error), return) -DEFINEFUNC(dbus_bool_t , dbus_type_is_basic, (int typecode), - (typecode), return) -DEFINEFUNC(dbus_bool_t , dbus_type_is_fixed, (int typecode), - (typecode), return) - /* dbus-thread.h */ DEFINEFUNC(dbus_bool_t , dbus_threads_init_default, (), (), return) + +/* D-Bus 1.4 symbols */ +#if !defined(QT_LINKED_LIBDBUS) || (DBUS_VERSION >= 0x010400) +DEFINEFUNC(dbus_bool_t , dbus_connection_can_send_type , (DBusConnection *connection, + int type), + (connection, type), return) +#endif + QT_END_NAMESPACE #endif // QT_NO_DBUS diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp index 09f0e82..806b7fe 100644 --- a/src/dbus/qdbusargument.cpp +++ b/src/dbus/qdbusargument.cpp @@ -487,6 +487,20 @@ QDBusArgument &QDBusArgument::operator<<(const QDBusSignature &arg) /*! \overload + \since 4.8 + \internal + Appends the primitive value \a arg of type \c{UNIX_FILE_DESCRIPTOR} (Unix + File Descriptor) to the D-Bus stream. +*/ +QDBusArgument &QDBusArgument::operator<<(const QDBusUnixFileDescriptor &arg) +{ + if (QDBusArgumentPrivate::checkWrite(d)) + d->marshaller()->append(arg); + return *this; +} + +/*! + \overload Appends the primitive value \a arg of type \c{VARIANT} to the D-Bus stream. A D-Bus variant type can contain any type, including other @@ -729,6 +743,20 @@ const QDBusArgument &QDBusArgument::operator>>(QDBusSignature &arg) const /*! \overload + \since 4.8 + \internal + Extracts one D-Bus primitive argument of type \c{UNIX_FILE_DESCRIPTOR} + (Unix file descriptor) from the D-Bus stream. +*/ +const QDBusArgument &QDBusArgument::operator>>(QDBusUnixFileDescriptor &arg) const +{ + if (QDBusArgumentPrivate::checkReadAndDetach(d)) + arg = d->demarshaller()->toUnixFileDescriptor(); + return *this; +} + +/*! + \overload Extracts one D-Bus primitive argument of type \c{VARIANT} from the D-Bus stream. diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index e331d8f..f80723e 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -61,6 +61,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) +class QDBusUnixFileDescriptor; + class QDBusArgumentPrivate; class QDBusDemarshaller; class QDBusMarshaller; @@ -96,6 +98,7 @@ public: QDBusArgument &operator<<(const QDBusVariant &arg); QDBusArgument &operator<<(const QDBusObjectPath &arg); QDBusArgument &operator<<(const QDBusSignature &arg); + QDBusArgument &operator<<(const QDBusUnixFileDescriptor &arg); QDBusArgument &operator<<(const QStringList &arg); QDBusArgument &operator<<(const QByteArray &arg); @@ -127,6 +130,7 @@ public: const QDBusArgument &operator>>(QDBusVariant &arg) const; const QDBusArgument &operator>>(QDBusObjectPath &arg) const; const QDBusArgument &operator>>(QDBusSignature &arg) const; + const QDBusArgument &operator>>(QDBusUnixFileDescriptor &arg) const; const QDBusArgument &operator>>(QStringList &arg) const; const QDBusArgument &operator>>(QByteArray &arg) const; diff --git a/src/dbus/qdbusargument_p.h b/src/dbus/qdbusargument_p.h index 89a383f..1c713a3 100644 --- a/src/dbus/qdbusargument_p.h +++ b/src/dbus/qdbusargument_p.h @@ -54,10 +54,16 @@ // #include <qdbusargument.h> +#include "qdbusunixfiledescriptor.h" #include "qdbus_symbols_p.h" #ifndef QT_NO_DBUS +#ifndef DBUS_TYPE_UNIX_FD +# define DBUS_TYPE_UNIX_FD int('h') +# define DBUS_TYPE_UNIX_FD_AS_STRING "h" +#endif + QT_BEGIN_NAMESPACE class QDBusMarshaller; @@ -117,6 +123,7 @@ public: void append(const QString &arg); void append(const QDBusObjectPath &arg); void append(const QDBusSignature &arg); + void append(const QDBusUnixFileDescriptor &arg); void append(const QStringList &arg); void append(const QByteArray &arg); bool append(const QDBusVariant &arg); // this one can fail @@ -172,6 +179,7 @@ public: QString toString(); QDBusObjectPath toObjectPath(); QDBusSignature toSignature(); + QDBusUnixFileDescriptor toUnixFileDescriptor(); QDBusVariant toVariant(); QStringList toStringList(); QByteArray toByteArray(); diff --git a/src/dbus/qdbusdemarshaller.cpp b/src/dbus/qdbusdemarshaller.cpp index 111122e..3910381 100644 --- a/src/dbus/qdbusdemarshaller.cpp +++ b/src/dbus/qdbusdemarshaller.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qdbusargument_p.h" +#include "qdbusconnection.h" #include <stdlib.h> QT_BEGIN_NAMESPACE @@ -126,6 +127,13 @@ inline QDBusSignature QDBusDemarshaller::toSignature() return QDBusSignature(QString::fromUtf8(qIterGet<char *>(&iterator))); } +inline QDBusUnixFileDescriptor QDBusDemarshaller::toUnixFileDescriptor() +{ + QDBusUnixFileDescriptor fd; + fd.giveFileDescriptor(qIterGet<dbus_int32_t>(&iterator)); + return fd; +} + inline QDBusVariant QDBusDemarshaller::toVariant() { QDBusDemarshaller sub(capabilities); @@ -173,6 +181,10 @@ QDBusArgument::ElementType QDBusDemarshaller::currentType() case DBUS_TYPE_DICT_ENTRY: return QDBusArgument::MapEntryType; + case DBUS_TYPE_UNIX_FD: + return capabilities & QDBusConnection::UnixFileDescriptorPassing ? + QDBusArgument::BasicType : QDBusArgument::UnknownType; + case DBUS_TYPE_INVALID: return QDBusArgument::UnknownType; @@ -231,6 +243,11 @@ QVariant QDBusDemarshaller::toVariantInternal() case DBUS_TYPE_STRUCT: return QVariant::fromValue(duplicate()); + case DBUS_TYPE_UNIX_FD: + if (capabilities & QDBusConnection::UnixFileDescriptorPassing) + return qVariantFromValue(toUnixFileDescriptor()); + // fall through + default: // qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'", // q_dbus_message_iter_get_arg_type(&iterator), diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 5f4dadd..5d53390 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1666,6 +1666,31 @@ void QDBusConnectionPrivate::setPeer(DBusConnection *c, const QDBusErrorInternal QMetaObject::invokeMethod(this, "doDispatch", Qt::QueuedConnection); } +static QDBusConnection::ConnectionCapabilities connectionCapabilies(DBusConnection *connection) +{ + QDBusConnection::ConnectionCapabilities result = 0; + +#if defined(QT_LINKED_LIBDBUS) && DBUS_VERSION < 0x010400 + // no capabilities are possible +#else +# if !defined(QT_LINKED_LIBDBUS) + // run-time check if the next functions are available + int major, minor, micro; + q_dbus_get_version(&major, &minor, µ); + if (major == 1 && minor < 4) + return result; +# endif + +#ifndef DBUS_TYPE_UNIX_FD +# define DBUS_TYPE_UNIX_FD int('h') +#endif + if (q_dbus_connection_can_send_type(connection, DBUS_TYPE_UNIX_FD)) + result |= QDBusConnection::UnixFileDescriptorPassing; +#endif + + return result; +} + void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusErrorInternal &error) { if (!dbc) { @@ -1679,6 +1704,7 @@ void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusError const char *service = q_dbus_bus_get_unique_name(connection); Q_ASSERT(service); baseService = QString::fromUtf8(service); + capabilities = connectionCapabilies(connection); q_dbus_connection_set_exit_on_disconnect(connection, false); q_dbus_connection_set_watch_functions(connection, qDBusAddWatch, qDBusRemoveWatch, diff --git a/src/dbus/qdbusmarshaller.cpp b/src/dbus/qdbusmarshaller.cpp index 76d76cc..6dec359 100644 --- a/src/dbus/qdbusmarshaller.cpp +++ b/src/dbus/qdbusmarshaller.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qdbusargument_p.h" +#include "qdbusconnection.h" #include "qdbusmetatype_p.h" #include "qdbusutil_p.h" @@ -138,6 +139,16 @@ inline void QDBusMarshaller::append(const QDBusSignature &arg) qIterAppend(&iterator, ba, DBUS_TYPE_SIGNATURE, &cdata); } +inline void QDBusMarshaller::append(const QDBusUnixFileDescriptor &arg) +{ + int fd = arg.fileDescriptor(); + if (!ba && fd == -1) { + error(QLatin1String("Invalid file descriptor passed in arguments")); + } else { + qIterAppend(&iterator, ba, DBUS_TYPE_UNIX_FD, &fd); + } +} + inline void QDBusMarshaller::append(const QByteArray &arg) { if (ba) { @@ -243,7 +254,7 @@ inline QDBusMarshaller *QDBusMarshaller::beginMap(int kid, int vid) .arg(QLatin1String(QVariant::typeToName(QVariant::Type(kid))))); return this; } - if (ksignature[1] != 0 || !q_dbus_type_is_basic(*ksignature)) { + if (ksignature[1] != 0 || !QDBusUtil::isValidBasicType(*ksignature)) { qWarning("QDBusMarshaller: type '%s' (%d) cannot be used as the key type in a D-BUS map.", QVariant::typeToName( QVariant::Type(kid) ), kid); error(QString::fromLatin1("Type %1 passed in arguments cannot be used as a key in a map") @@ -474,6 +485,13 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg) qFatal("QDBusMarshaller::appendVariantInternal got a DICT_ENTRY!"); return false; + case DBUS_TYPE_UNIX_FD: + if (capabilities & QDBusConnection::UnixFileDescriptorPassing || ba) { + append(qvariant_cast<QDBusUnixFileDescriptor>(arg)); + return true; + } + // fall through + default: qWarning("QDBusMarshaller::appendVariantInternal: Found unknown D-BUS type '%s'", signature); @@ -493,7 +511,7 @@ bool QDBusMarshaller::appendRegisteredType(const QVariant &arg) bool QDBusMarshaller::appendCrossMarshalling(QDBusDemarshaller *demarshaller) { int code = q_dbus_message_iter_get_arg_type(&demarshaller->iterator); - if (q_dbus_type_is_basic(code)) { + if (QDBusUtil::isValidBasicType(code)) { // easy: just append // do exactly like the D-BUS docs suggest // (see apidocs for q_dbus_message_iter_get_basic) @@ -507,7 +525,7 @@ bool QDBusMarshaller::appendCrossMarshalling(QDBusDemarshaller *demarshaller) if (code == DBUS_TYPE_ARRAY) { int element = q_dbus_message_iter_get_element_type(&demarshaller->iterator); - if (q_dbus_type_is_fixed(element)) { + if (QDBusUtil::isValidFixedType(element) && element != DBUS_TYPE_UNIX_FD) { // another optimization: fixed size arrays // code is exactly like QDBusDemarshaller::toByteArray DBusMessageIter sub; diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp index 9f29205..9d9112c 100644 --- a/src/dbus/qdbusmetatype.cpp +++ b/src/dbus/qdbusmetatype.cpp @@ -50,12 +50,18 @@ #include <qvector.h> #include "qdbusmessage.h" +#include "qdbusunixfiledescriptor.h" #include "qdbusutil_p.h" #include "qdbusmetatype_p.h" #include "qdbusargument_p.h" #ifndef QT_NO_DBUS +#ifndef DBUS_TYPE_UNIX_FD +# define DBUS_TYPE_UNIX_FD int('h') +# define DBUS_TYPE_UNIX_FD_AS_STRING "h" +#endif + Q_DECLARE_METATYPE(QList<bool>) Q_DECLARE_METATYPE(QList<short>) Q_DECLARE_METATYPE(QList<ushort>) @@ -96,6 +102,7 @@ int QDBusMetaTypeId::variant; int QDBusMetaTypeId::objectpath; int QDBusMetaTypeId::signature; int QDBusMetaTypeId::error; +int QDBusMetaTypeId::unixfd; void QDBusMetaTypeId::init() { @@ -110,7 +117,8 @@ void QDBusMetaTypeId::init() variant = qRegisterMetaType<QDBusVariant>("QDBusVariant"); objectpath = qRegisterMetaType<QDBusObjectPath>("QDBusObjectPath"); signature = qRegisterMetaType<QDBusSignature>("QDBusSignature"); - error = qRegisterMetaType<QDBusError>("QDBusError"); + error = qRegisterMetaType<QDBusError>("QDBusError"); + unixfd = qRegisterMetaType<QDBusUnixFileDescriptor>("QDBusUnixFileDescriptor"); #ifndef QDBUS_NO_SPECIALTYPES // and register QtCore's with us @@ -139,6 +147,7 @@ void QDBusMetaTypeId::init() qDBusRegisterMetaType<QList<double> >(); qDBusRegisterMetaType<QList<QDBusObjectPath> >(); qDBusRegisterMetaType<QList<QDBusSignature> >(); + qDBusRegisterMetaType<QList<QDBusUnixFileDescriptor> >(); #endif initialized = true; @@ -343,6 +352,9 @@ int QDBusMetaType::signatureToType(const char *signature) case DBUS_TYPE_SIGNATURE: return QDBusMetaTypeId::signature; + case DBUS_TYPE_UNIX_FD: + return QDBusMetaTypeId::unixfd; + case DBUS_TYPE_VARIANT: return QDBusMetaTypeId::variant; @@ -432,6 +444,8 @@ const char *QDBusMetaType::typeToSignature(int type) return DBUS_TYPE_OBJECT_PATH_AS_STRING; else if (type == QDBusMetaTypeId::signature) return DBUS_TYPE_SIGNATURE_AS_STRING; + else if (type == QDBusMetaTypeId::unixfd) + return DBUS_TYPE_UNIX_FD_AS_STRING; // try the database QVector<QDBusCustomTypeInfo> *ct = customTypes(); diff --git a/src/dbus/qdbusmetatype_p.h b/src/dbus/qdbusmetatype_p.h index 2fce133..b931c75 100644 --- a/src/dbus/qdbusmetatype_p.h +++ b/src/dbus/qdbusmetatype_p.h @@ -65,6 +65,7 @@ struct QDBusMetaTypeId static int objectpath; // QDBusObjectPath static int signature; // QDBusSignature static int error; // QDBusError + static int unixfd; // QDBusUnixFileDescriptor static void init(); }; diff --git a/src/dbus/qdbusunixfiledescriptor.cpp b/src/dbus/qdbusunixfiledescriptor.cpp new file mode 100644 index 0000000..f45b6cc --- /dev/null +++ b/src/dbus/qdbusunixfiledescriptor.cpp @@ -0,0 +1,316 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "qdbusunixfiledescriptor.h" +#include <QSharedData> + +#ifdef Q_OS_UNIX +# include <private/qcore_unix_p.h> +#endif + +QT_BEGIN_NAMESPACE + +/*! + \class QDBusUnixFileDescriptor + \inmodule QtDBus + \since 4.8 + + \brief The QDBusUnixFileDescriptor class holds one Unix file descriptor. + + The QDBusUnixFileDescriptor class is used to hold one Unix file + descriptor for use with the QtDBus module. This allows applications to + send and receive Unix file descriptors over the D-Bus connection, mapping + automatically to the D-Bus type 'h'. + + Objects of type QDBusUnixFileDescriptors can be used also as parameters + in signals and slots that get exported to D-Bus by registering with + QDBusConnection::registerObject. + + QDBusUnixFileDescriptor does not take ownership of the file descriptor. + Instead, it will use the Unix system call \c dup(2) to make a copy of the + file descriptor. This file descriptor belongs to the + QDBusUnixFileDescriptor object and should not be stored or closed by the + user. Instead, you should make your own copy if you need that. + + \section2 Availability + + Unix file descriptor passing is not available in all D-Bus connections. + This feature is present with D-Bus library and bus daemon version 1.4 and + upwards on Unix systems. QtDBus automatically enables the feature if such + a version was found at compile-time and run-time. + + To verify that your connection does support passing file descriptors, + check if the QDBusConnection::UnixFileDescriptorPassing capability is set + with QDBusConnection::connectionCapabilities(). If the flag is not + active, then you will not be able to make calls to methods that have + QDBusUnixFileDescriptor as arguments or even embed such a type in a + variant. You will also not receive calls containing that type. + + Note also that remote applications may not have support for Unix file + descriptor passing. If you make a D-Bus to a remote application that + cannot receive such a type, you will receive an error reply. If you try + to send a signal containing a D-Bus file descriptor or return one from a + method call, the message will be silently dropped. + + Even if the feature is not available, QDBusUnixFileDescriptor will + continue to operate, so code need not have compile-time checks for the + availability of this feature. + + On non-Unix systems, QDBusUnixFileDescriptor will always report an + invalid state and QDBusUnixFileDescriptor::isSupported() will return + false. + + \sa QDBusConnection::ConnectionCapabilities, QDBusConnection::connectionCapabilities +*/ + +class QDBusUnixFileDescriptorPrivate : public QSharedData { +public: + QDBusUnixFileDescriptorPrivate() : fd(-1) { } + QDBusUnixFileDescriptorPrivate(const QDBusUnixFileDescriptorPrivate &other) + : QSharedData(other), fd(-1) + { } + ~QDBusUnixFileDescriptorPrivate(); + + QAtomicInt fd; +}; + +template<> inline +QExplicitlySharedDataPointer<QDBusUnixFileDescriptorPrivate>::~QExplicitlySharedDataPointer() +{ if (d && !d->ref.deref()) delete d; } + +/*! + Constructs a QDBusUnixFileDescriptor without a wrapped file descriptor. + This is equivalent to constructing the object with an invalid file + descriptor (like -1). + + \sa fileDescriptor, isValid +*/ +QDBusUnixFileDescriptor::QDBusUnixFileDescriptor() + : d(0) +{ +} + +/*! + Constructs a QDBusUnixFileDescriptor object by copying the \a + fileDescriptor parameter. The original file descriptor is not touched and + must be closed by the user. + + Note that the value returned by fileDescriptor() will be different from + the \a fileDescriptor parameter passed. + + If the \a fileDescriptor parameter is not valid, isValid() will return + false and fileDescriptor() will return -1. + + \sa setFileDescriptor, fileDescriptor +*/ +QDBusUnixFileDescriptor::QDBusUnixFileDescriptor(int fileDescriptor) + : d(0) +{ + if (fileDescriptor != -1) + setFileDescriptor(fileDescriptor); +} + +/*! + Constructs a QDBusUnixFileDescriptor object by copying \a other. +*/ +QDBusUnixFileDescriptor::QDBusUnixFileDescriptor(const QDBusUnixFileDescriptor &other) + : d(other.d) +{ +} + +/*! + Copies the Unix file descriptor from the \a other QDBusUnixFileDescriptor + object. If the current object contained a file descriptor, it will be + properly disposed of before. +*/ +QDBusUnixFileDescriptor &QDBusUnixFileDescriptor::operator=(const QDBusUnixFileDescriptor &other) +{ + if (this != &other) + d.operator=(other.d); + return *this; +} + +/*! + Destroys this QDBusUnixFileDescriptor object and disposes of the Unix file descriptor that it contained. +*/ +QDBusUnixFileDescriptor::~QDBusUnixFileDescriptor() +{ +} + +/*! + Returns true if this Unix file descriptor is valid. A valid Unix file + descriptor is not -1. + + \sa fileDescriptor() +*/ +bool QDBusUnixFileDescriptor::isValid() const +{ + return d ? d->fd != -1 : false; +} + +/*! + Returns the Unix file descriptor contained by this + QDBusUnixFileDescriptor object. An invalid file descriptor is represented + by the value -1. + + Note that the file descriptor returned by this function is owned by the + QDBusUnixFileDescriptor object and must not be stored past the lifetime + of this object. It is ok to use it while this object is valid, but if one + wants to store it for longer use, the file descriptor should be cloned + using the Unix \c dup(2), \c dup2(2) or \c dup3(2) functions. + + \sa isValid() +*/ +int QDBusUnixFileDescriptor::fileDescriptor() const +{ + return d ? d->fd.operator int() : -1; +} + +// actual implementation +#ifdef Q_OS_UNIX + +// qdoc documentation is generated on Unix + +/*! + Returns true if Unix file descriptors are supported on this platform. In + other words, this function returns true if this is a Unix platform. + + Note that QDBusUnixFileDescriptor continues to operate even if this + function returns false. The only difference is that the + QDBusUnixFileDescriptor objects will always be in the isValid() == false + state and fileDescriptor() will always return -1. The class will not + consume any operating system resources. +*/ +bool QDBusUnixFileDescriptor::isSupported() +{ + return true; +} + +/*! + Sets the file descriptor that this QDBusUnixFileDescriptor object holds + to a copy of \a fileDescriptor.T he original file descriptor is not + touched and must be closed by the user. + + Note that the value returned by fileDescriptor() will be different from + the \a fileDescriptor parameter passed. + + If the \a fileDescriptor parameter is not valid, isValid() will return + false and fileDescriptor() will return -1. + + \sa isValid(), fileDescriptor() +*/ +void QDBusUnixFileDescriptor::setFileDescriptor(int fileDescriptor) +{ + if (fileDescriptor != -1) + giveFileDescriptor(qt_safe_dup(fileDescriptor)); +} + +/*! + \internal + Sets the Unix file descriptor to \a fileDescriptor without copying. + + \sa setFileDescriptor() +*/ +void QDBusUnixFileDescriptor::giveFileDescriptor(int fileDescriptor) +{ + // if we are the sole ref, d remains unchanged + // if detaching happens, d->fd will be -1 + if (d) + d.detach(); + else + d = new QDBusUnixFileDescriptorPrivate; + + if (d->fd != -1) + qt_safe_close(d->fd); + + if (fileDescriptor != -1) + d->fd = fileDescriptor; +} + +/*! + \internal + Extracts the Unix file descriptor from the QDBusUnixFileDescriptor object + and transfers ownership. + + Note: since QDBusUnixFileDescriptor is implicitly shared, this function + is inherently racy and should be avoided. +*/ +int QDBusUnixFileDescriptor::takeFileDescriptor() +{ + if (!d) + return -1; + + return d->fd.fetchAndStoreRelaxed(-1); +} + +QDBusUnixFileDescriptorPrivate::~QDBusUnixFileDescriptorPrivate() +{ + if (fd != -1) + qt_safe_close(fd); +} + +#else +bool QDBusUnixFileDescriptor::isSupported() +{ + return false; +} + +void QDBusUnixFileDescriptor::setFileDescriptor(int) +{ +} + +void QDBusUnixFileDescriptor::giveFileDescriptor(int) +{ +} + +int QDBusUnixFileDescriptor::takeFileDescriptor() +{ + return -1; +} + +QDBusUnixFileDescriptorPrivate::~QDBusUnixFileDescriptorPrivate() +{ +} + +#endif + +QT_END_NAMESPACE diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h new file mode 100644 index 0000000..d0a2f3c --- /dev/null +++ b/src/dbus/qdbusunixfiledescriptor.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QDBUSUNIXFILEDESCRIPTOR_H +#define QDBUSUNIXFILEDESCRIPTOR_H + +#include <QtCore/QSharedDataPointer> +#include <QtDBus/qdbusmacros.h> + +#ifndef QT_NO_DBUS + +#ifdef Q_COMPILER_RVALUE_REFS +# include <utility> +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(DBus) + +class QDBusUnixFileDescriptorPrivate; +template<> QExplicitlySharedDataPointer<QDBusUnixFileDescriptorPrivate>::~QExplicitlySharedDataPointer(); + +class Q_DBUS_EXPORT QDBusUnixFileDescriptor +{ +public: + QDBusUnixFileDescriptor(); + explicit QDBusUnixFileDescriptor(int fileDescriptor); + QDBusUnixFileDescriptor(const QDBusUnixFileDescriptor &other); + QDBusUnixFileDescriptor &operator=(const QDBusUnixFileDescriptor &other); + ~QDBusUnixFileDescriptor(); + + bool isValid() const; + + int fileDescriptor() const; + void setFileDescriptor(int fileDescriptor); + + void giveFileDescriptor(int fileDescriptor); + int takeFileDescriptor(); + + static bool isSupported(); + +#if defined(Q_COMPILER_RVALUE_REFS) + QDBusUnixFileDescriptor(QDBusUnixFileDescriptor &&other) : d(static_cast<Data &&>(other.d)) + { } + inline QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other) + { d.swap(other.d); return *this; } +#endif + +protected: + typedef QExplicitlySharedDataPointer<QDBusUnixFileDescriptorPrivate> Data; + Data d; +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QDBusUnixFileDescriptor) +Q_DECLARE_METATYPE(QList<QDBusUnixFileDescriptor>) + +QT_END_HEADER + +#endif // QT_NO_DBUS +#endif // QDBUSUNIXFILEDESCRIPTOR_H diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index 9730f54..a4bd168 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -46,6 +46,7 @@ #include <QtCore/qstringlist.h> #include "qdbusargument.h" +#include "qdbusunixfiledescriptor.h" #ifndef QT_NO_DBUS @@ -130,6 +131,10 @@ static bool variantToString(const QVariant &arg, QString &out) } else if (argType == qMetaTypeId<QDBusSignature>()) { out += QLatin1String("[Signature: ") + qvariant_cast<QDBusSignature>(arg).signature(); out += QLatin1Char(']'); + } else if (argType == qMetaTypeId<QDBusUnixFileDescriptor>()) { + out += QLatin1String("[Unix FD: "); + out += QLatin1String(qvariant_cast<QDBusUnixFileDescriptor>(arg).isValid() ? "valid" : "not valid"); + out += QLatin1Char(']'); } else if (argType == qMetaTypeId<QDBusVariant>()) { const QVariant v = qvariant_cast<QDBusVariant>(arg).variant(); out += QLatin1String("[Variant"); @@ -233,6 +238,68 @@ bool argToString(const QDBusArgument &busArg, QString &out) return true; } +//------- D-Bus Types -------- +static const char oneLetterTypes[] = "vsogybnqiuxtdh"; +static const char basicTypes[] = "sogybnqiuxtdh"; +static const char fixedTypes[] = "ybnqiuxtdh"; + +static bool isBasicType(int c) +{ + return c != DBUS_TYPE_INVALID && strchr(basicTypes, c) != NULL; +} + +static bool isFixedType(int c) +{ + return c != DBUS_TYPE_INVALID && strchr(fixedTypes, c) != NULL; +} + +// Returns a pointer to one-past-end of this type if it's valid; +// returns NULL if it isn't valid. +static const char *validateSingleType(const char *signature) +{ + register char c = *signature; + if (c == DBUS_TYPE_INVALID) + return false; + + // is it one of the one-letter types? + if (strchr(oneLetterTypes, c) != NULL) + return signature + 1; + + // is it an array? + if (c == DBUS_TYPE_ARRAY) { + // then it's valid if the next type is valid + // or if it's a dict-entry + c = *++signature; + if (c == DBUS_DICT_ENTRY_BEGIN_CHAR) { + // beginning of a dictionary entry + // a dictionary entry has a key which is of basic types + // and a free value + c = *++signature; + if (!isBasicType(c)) + return 0; + signature = validateSingleType(signature + 1); + return signature && *signature == DBUS_DICT_ENTRY_END_CHAR ? signature + 1 : 0; + } + + return validateSingleType(signature); + } + + if (c == DBUS_STRUCT_BEGIN_CHAR) { + // beginning of a struct + ++signature; + while (true) { + signature = validateSingleType(signature); + if (!signature) + return 0; + if (*signature == DBUS_STRUCT_END_CHAR) + return signature + 1; + } + } + + // invalid/unknown type + return 0; +} + /*! \namespace QDBusUtil \inmodule QtDBus @@ -442,6 +509,25 @@ namespace QDBusUtil } /*! + \fn bool QDBusUtil::isValidBasicType(int type) + Returns true if \a c is a valid, basic D-Bus type. + */ + bool isValidBasicType(int c) + { + return isBasicType(c); + } + + /*! + \fn bool QDBusUtil::isValidFixedType(int type) + Returns true if \a c is a valid, fixed D-Bus type. + */ + bool isValidFixedType(int c) + { + return isFixedType(c); + } + + + /*! \fn bool QDBusUtil::isValidSignature(const QString &signature) Returns true if \a signature is a valid D-Bus type signature for one or more types. This function returns true if it can all of \a signature into valid, individual types and no @@ -451,7 +537,15 @@ namespace QDBusUtil */ bool isValidSignature(const QString &signature) { - return q_dbus_signature_validate(signature.toUtf8(), 0); + QByteArray ba = signature.toLatin1(); + const char *data = ba.constData(); + while (true) { + data = validateSingleType(data); + if (!data) + return false; + if (*data == '\0') + return true; + } } /*! @@ -462,7 +556,9 @@ namespace QDBusUtil */ bool isValidSingleSignature(const QString &signature) { - return q_dbus_signature_validate_single(signature.toUtf8(), 0); + QByteArray ba = signature.toLatin1(); + const char *data = validateSingleType(ba.constData()); + return data && *data == '\0'; } } // namespace QDBusUtil diff --git a/src/dbus/qdbusutil_p.h b/src/dbus/qdbusutil_p.h index 3721e98..24b5cea 100644 --- a/src/dbus/qdbusutil_p.h +++ b/src/dbus/qdbusutil_p.h @@ -81,6 +81,10 @@ namespace QDBusUtil Q_DBUS_EXPORT bool isValidObjectPath(const QString &path); + Q_DBUS_EXPORT bool isValidFixedType(int c); + + Q_DBUS_EXPORT bool isValidBasicType(int c); + Q_DBUS_EXPORT bool isValidSignature(const QString &signature); Q_DBUS_EXPORT bool isValidSingleSignature(const QString &signature); diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 1d50baf..3dd194b 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -266,7 +266,7 @@ void QDeclarativeFlickablePrivate::flickY(qreal velocity) flick(vData, q->minYExtent(), q->maxYExtent(), q->height(), fixupY_callback, velocity); } -void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, +void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity) { Q_Q(QDeclarativeFlickable); diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index dc3ecca..9eecc65 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -54,7 +54,15 @@ #include <QtCore/qvarlengtharray.h> #include <QtScript/qscriptcontextinfo.h> -Q_DECLARE_METATYPE(QScriptValue); +Q_DECLARE_METATYPE(QScriptValue) + +#if defined(__GNUC__) +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 +// The code in this file does not violate strict aliasing, but GCC thinks it does +// so turn off the warnings for us to have a clean build +# pragma GCC diagnostic ignored "-Wstrict-aliasing" +# endif +#endif QT_BEGIN_NAMESPACE diff --git a/src/gui/util/qscroller.cpp b/src/gui/util/qscroller.cpp index 9c2d24d..db128c1 100644 --- a/src/gui/util/qscroller.cpp +++ b/src/gui/util/qscroller.cpp @@ -279,9 +279,11 @@ private: \sa QScrollEvent, QScrollPrepareEvent, QScrollerProperties */ +typedef QMap<QObject *, QScroller *> ScrollerHash; +typedef QSet<QScroller *> ScrollerSet; -QMap<QObject *, QScroller *> QScrollerPrivate::allScrollers; -QSet<QScroller *> QScrollerPrivate::activeScrollers; +Q_GLOBAL_STATIC(ScrollerHash, qt_allScrollers) +Q_GLOBAL_STATIC(ScrollerSet, qt_activeScrollers) /*! Returns \c true if a QScroller object was already created for \a target; \c false otherwise. @@ -290,7 +292,7 @@ QSet<QScroller *> QScrollerPrivate::activeScrollers; */ bool QScroller::hasScroller(QObject *target) { - return (QScrollerPrivate::allScrollers.value(target)); + return (qt_allScrollers()->value(target)); } /*! @@ -308,11 +310,11 @@ QScroller *QScroller::scroller(QObject *target) return 0; } - if (QScrollerPrivate::allScrollers.contains(target)) - return QScrollerPrivate::allScrollers.value(target); + if (qt_allScrollers()->contains(target)) + return qt_allScrollers()->value(target); QScroller *s = new QScroller(target); - QScrollerPrivate::allScrollers.insert(target, s); + qt_allScrollers()->insert(target, s); return s; } @@ -332,7 +334,7 @@ const QScroller *QScroller::scroller(const QObject *target) */ QList<QScroller *> QScroller::activeScrollers() { - return QScrollerPrivate::activeScrollers.toList(); + return qt_activeScrollers()->toList(); } /*! @@ -508,8 +510,8 @@ QScroller::~QScroller() // do not delete the recognizer. The QGestureManager is doing this. d->recognizer = 0; #endif - QScrollerPrivate::allScrollers.remove(d->target); - QScrollerPrivate::activeScrollers.remove(this); + qt_allScrollers()->remove(d->target); + qt_activeScrollers()->remove(this); delete d_ptr; } @@ -1754,9 +1756,9 @@ void QScrollerPrivate::setState(QScroller::State newstate) firstScroll = true; } if (state == QScroller::Dragging || state == QScroller::Scrolling) - activeScrollers.insert(q); + qt_activeScrollers()->insert(q); else - activeScrollers.remove(q); + qt_activeScrollers()->remove(q); emit q->stateChanged(state); } diff --git a/src/gui/util/qscroller_p.h b/src/gui/util/qscroller_p.h index 8c5f2e7..c119615 100644 --- a/src/gui/util/qscroller_p.h +++ b/src/gui/util/qscroller_p.h @@ -148,10 +148,6 @@ public slots: void targetDestroyed(); public: - // static - static QMap<QObject *, QScroller *> allScrollers; - static QSet<QScroller *> activeScrollers; - // non static QObject *target; QScrollerProperties properties; diff --git a/tests/auto/dbus.pro b/tests/auto/dbus.pro index e5f87e3..31b46a3 100644 --- a/tests/auto/dbus.pro +++ b/tests/auto/dbus.pro @@ -11,9 +11,9 @@ SUBDIRS=\ qdbusmetatype \ qdbuspendingcall \ qdbuspendingreply \ - qdbusperformance \ qdbusreply \ qdbusservicewatcher \ + qdbustype \ qdbusthreading \ qdbusxmlparser \ diff --git a/tests/auto/qdbusmarshall/common.h b/tests/auto/qdbusmarshall/common.h index 532394a..8f7f3c3 100644 --- a/tests/auto/qdbusmarshall/common.h +++ b/tests/auto/qdbusmarshall/common.h @@ -39,6 +39,22 @@ ** ****************************************************************************/ #include <math.h> // isnan +#include <qvariant.h> + +#ifdef Q_OS_UNIX +# include <private/qcore_unix_p.h> + +static bool compareFileDescriptors(int fd1, int fd2) +{ + QT_STATBUF st1, st2; + if (QT_FSTAT(fd1, &st1) == -1 || QT_FSTAT(fd2, &st2) == -1) { + perror("fstat"); + return false; + } + + return (st1.st_dev == st2.st_dev) && (st1.st_ino == st2.st_ino); +} +#endif Q_DECLARE_METATYPE(QVariant) Q_DECLARE_METATYPE(QList<bool>) @@ -77,6 +93,22 @@ Q_DECLARE_METATYPE(ObjectPathStringMap) Q_DECLARE_METATYPE(LLDateTimeMap) Q_DECLARE_METATYPE(SignatureStringMap) +static bool compare(const QDBusUnixFileDescriptor &t1, const QDBusUnixFileDescriptor &t2) +{ + int fd1 = t1.fileDescriptor(); + int fd2 = t2.fileDescriptor(); + if ((fd1 == -1 || fd2 == -1) && fd1 != fd2) { + // one is valid, the other isn't + return false; + } + +#ifdef Q_OS_UNIX + return compareFileDescriptors(fd1, fd2); +#else + return true; +#endif +} + struct MyStruct { int i; @@ -130,6 +162,32 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, MyVariantMapStruct &ms return arg; } +struct MyFileDescriptorStruct +{ + QDBusUnixFileDescriptor fd; + + inline bool operator==(const MyFileDescriptorStruct &other) const + { return compare(fd, other.fd); } +}; +Q_DECLARE_METATYPE(MyFileDescriptorStruct) +Q_DECLARE_METATYPE(QList<MyFileDescriptorStruct>) + +QDBusArgument &operator<<(QDBusArgument &arg, const MyFileDescriptorStruct &ms) +{ + arg.beginStructure(); + arg << ms.fd; + arg.endStructure(); + return arg; +} + +const QDBusArgument &operator>>(const QDBusArgument &arg, MyFileDescriptorStruct &ms) +{ + arg.beginStructure(); + arg >> ms.fd; + arg.endStructure(); + return arg; +} + void commonInit() { @@ -157,6 +215,8 @@ void commonInit() qDBusRegisterMetaType<MyStruct>(); qDBusRegisterMetaType<MyVariantMapStruct>(); qDBusRegisterMetaType<QList<MyVariantMapStruct> >(); + qDBusRegisterMetaType<MyFileDescriptorStruct>(); + qDBusRegisterMetaType<QList<MyFileDescriptorStruct> >(); } #ifdef USE_PRIVATE_CODE #include "private/qdbusintrospection_p.h" @@ -467,6 +527,8 @@ bool compareToArgument(const QDBusArgument &arg, const QVariant &v2) return compare<QList<QDBusObjectPath> >(arg, v2); else if (id == qMetaTypeId<QList<QDBusSignature> >()) return compare<QList<QDBusSignature> >(arg, v2); + else if (id == qMetaTypeId<QList<QDBusUnixFileDescriptor> >()) + return compare<QList<QDBusUnixFileDescriptor> >(arg, v2); else if (id == qMetaTypeId<QList<QDateTime> >()) return compare<QList<QDateTime> >(arg, v2); @@ -511,6 +573,10 @@ bool compareToArgument(const QDBusArgument &arg, const QVariant &v2) return compare<MyVariantMapStruct>(arg, v2); else if (id == qMetaTypeId<QList<MyVariantMapStruct> >()) return compare<QList<MyVariantMapStruct> >(arg, v2); + else if (id == qMetaTypeId<MyFileDescriptorStruct>()) + return compare<MyFileDescriptorStruct>(arg, v2); + else if (id == qMetaTypeId<QList<MyFileDescriptorStruct> >()) + return compare<QList<MyFileDescriptorStruct> >(arg, v2); } qWarning() << "Unexpected QVariant type" << v2.userType() @@ -563,6 +629,9 @@ template<> bool compare(const QVariant &v1, const QVariant &v2) else if (id == qMetaTypeId<QDBusSignature>()) return qvariant_cast<QDBusSignature>(v1).signature() == qvariant_cast<QDBusSignature>(v2).signature(); + else if (id == qMetaTypeId<QDBusUnixFileDescriptor>()) + return compare(qvariant_cast<QDBusUnixFileDescriptor>(v1), qvariant_cast<QDBusUnixFileDescriptor>(v2)); + else if (id == qMetaTypeId<QDBusVariant>()) return compare(qvariant_cast<QDBusVariant>(v1).variant(), qvariant_cast<QDBusVariant>(v2).variant()); diff --git a/tests/auto/qdbusmarshall/qdbusmarshall.pro b/tests/auto/qdbusmarshall/qdbusmarshall.pro index f8e0875..ad40c0d 100644 --- a/tests/auto/qdbusmarshall/qdbusmarshall.pro +++ b/tests/auto/qdbusmarshall/qdbusmarshall.pro @@ -3,6 +3,8 @@ contains(QT_CONFIG,dbus): { TEMPLATE = subdirs CONFIG += ordered SUBDIRS = qpong test + + requires(contains(QT_CONFIG,private_tests)) } else { SOURCES += dummy.cpp } diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp index 9bae6af..737f0cf 100644 --- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp @@ -42,6 +42,7 @@ #include <QtTest/QtTest> #include <QtDBus/QtDBus> #include <QtDBus/private/qdbusutil_p.h> +#include <QtDBus/private/qdbusconnection_p.h> #include "common.h" #include <limits> @@ -93,7 +94,11 @@ private slots: void receiveUnknownType(); private: + int fileDescriptorForTest(); + QProcess proc; + QTemporaryFile tempFile; + bool fileDescriptorPassing; }; class QDBusMessageSpy: public QObject @@ -116,6 +121,7 @@ void tst_QDBusMarshall::initTestCase() { commonInit(); QDBusConnection con = QDBusConnection::sessionBus(); + fileDescriptorPassing = con.connectionCapabilities() & QDBusConnection::UnixFileDescriptorPassing; #ifdef Q_OS_WIN proc.start("qpong"); #else @@ -144,6 +150,15 @@ void tst_QDBusMarshall::cleanupTestCase() proc.waitForFinished(200); } +int tst_QDBusMarshall::fileDescriptorForTest() +{ + if (!tempFile.isOpen()) { + tempFile.setFileTemplate(QDir::tempPath() + "/qdbusmarshalltestXXXXXX.tmp"); + tempFile.open(); + } + return tempFile.handle(); +} + void tst_QDBusMarshall::sendBasic_data() { QTest::addColumn<QVariant>("value"); @@ -167,6 +182,9 @@ void tst_QDBusMarshall::sendBasic_data() QTest::newRow("signature") << qVariantFromValue(QDBusSignature("g")) << "g" << "[Signature: g]"; QTest::newRow("emptystring") << QVariant("") << "s" << "\"\""; QTest::newRow("nullstring") << QVariant(QString()) << "s" << "\"\""; + + if (fileDescriptorPassing) + QTest::newRow("file-descriptor") << qVariantFromValue(QDBusUnixFileDescriptor(fileDescriptorForTest())) << "h" << "[Unix FD: valid]"; #endif } @@ -255,6 +273,18 @@ void tst_QDBusMarshall::sendArrays_data() << std::numeric_limits<double>::quiet_NaN(); QTest::newRow("doublelist") << qVariantFromValue(doubles) << "ad" << "[Argument: ad {1.2, 2.2, 4.4, -inf, inf, nan}]"; + QList<QDBusObjectPath> objectPaths; + QTest::newRow("emptyobjectpathlist") << qVariantFromValue(objectPaths) << "ao" << "[Argument: ao {}]"; + objectPaths << QDBusObjectPath("/") << QDBusObjectPath("/foo"); + QTest::newRow("objectpathlist") << qVariantFromValue(objectPaths) << "ao" << "[Argument: ao {[ObjectPath: /], [ObjectPath: /foo]}]"; + + if (fileDescriptorPassing) { + QList<QDBusUnixFileDescriptor> fileDescriptors; + QTest::newRow("emptyfiledescriptorlist") << qVariantFromValue(fileDescriptors) << "ah" << "[Argument: ah {}]"; + fileDescriptors << QDBusUnixFileDescriptor(fileDescriptorForTest()) << QDBusUnixFileDescriptor(1); + QTest::newRow("filedescriptorlist") << qVariantFromValue(fileDescriptors) << "ah" << "[Argument: ah {[Unix FD: valid], [Unix FD: valid]}]"; + } + QVariantList variants; QTest::newRow("emptyvariantlist") << QVariant(variants) << "av" << "[Argument: av {}]"; variants << QString("Hello") << QByteArray("World") << 42 << -43.0 << 44U << Q_INT64_C(-45) @@ -456,6 +486,12 @@ void tst_QDBusMarshall::sendMaps_data() QTest::newRow("gs-map") << qVariantFromValue(gsmap) << "a{gs}" << "[Argument: a{gs} {[Signature: a{gs}] = \"array of dict_entry of (signature, string)\", [Signature: i] = \"int32\", [Signature: s] = \"string\"}]"; + if (fileDescriptorPassing) { + svmap["zzfiledescriptor"] = qVariantFromValue(QDBusUnixFileDescriptor(fileDescriptorForTest())); + QTest::newRow("sv-map1-fd") << qVariantFromValue(svmap) << "a{sv}" + << "[Argument: a{sv} {\"a\" = [Variant(int): 1], \"b\" = [Variant(QByteArray): {99}], \"c\" = [Variant(QString): \"b\"], \"d\" = [Variant(uint): 42], \"e\" = [Variant(short): -47], \"f\" = [Variant: [Variant(int): 0]], \"zzfiledescriptor\" = [Variant(QDBusUnixFileDescriptor): [Unix FD: valid]]}]"; + } + svmap.clear(); svmap["ismap"] = qVariantFromValue(ismap); svmap["ssmap"] = qVariantFromValue(ssmap); @@ -509,6 +545,18 @@ void tst_QDBusMarshall::sendStructs_data() QTest::newRow("empty-list-of-string-variantmap") << qVariantFromValue(list) << "a(sa{sv})" << "[Argument: a(sa{sv}) {}]"; list << mvms; QTest::newRow("list-of-string-variantmap") << qVariantFromValue(list) << "a(sa{sv})" << "[Argument: a(sa{sv}) {[Argument: (sa{sv}) \"Hello, World\", [Argument: a{sv} {\"bytearray\" = [Variant(QByteArray): {72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100}], \"int\" = [Variant(int): 42], \"short\" = [Variant(short): -47], \"uint\" = [Variant(uint): 42]}]]}]"; + + if (fileDescriptorPassing) { + MyFileDescriptorStruct fds; + fds.fd = QDBusUnixFileDescriptor(fileDescriptorForTest()); + QTest::newRow("fdstruct") << qVariantFromValue(fds) << "(h)" << "[Argument: (h) [Unix FD: valid]]"; + + QList<MyFileDescriptorStruct> fdlist; + QTest::newRow("empty-list-of-fdstruct") << qVariantFromValue(fdlist) << "a(h)" << "[Argument: a(h) {}]"; + + fdlist << fds; + QTest::newRow("list-of-fdstruct") << qVariantFromValue(fdlist) << "a(h)" << "[Argument: a(h) {[Argument: (h) [Unix FD: valid]]}]"; + } } void tst_QDBusMarshall::sendComplex_data() @@ -642,6 +690,12 @@ void tst_QDBusMarshall::sendArgument_data() arg << QString(); QTest::newRow("nullstring") << qVariantFromValue(arg) << "s" << int(QDBusArgument::BasicType); + if (fileDescriptorPassing) { + arg = QDBusArgument(); + arg << QDBusUnixFileDescriptor(fileDescriptorForTest()); + QTest::newRow("filedescriptor") << qVariantFromValue(arg) << "h" << int(QDBusArgument::BasicType); + } + arg = QDBusArgument(); arg << QDBusVariant(1); QTest::newRow("variant") << qVariantFromValue(arg) << "v" << int(QDBusArgument::VariantType); @@ -902,6 +956,27 @@ void tst_QDBusMarshall::sendCallErrors_data() << "Marshalling failed: Unregistered type UnregisteredType passed in arguments" << QString("QDBusMarshaller: type `UnregisteredType' (%1) is not registered with D-BUS. Use qDBusRegisterMetaType to register it") .arg(qMetaTypeId<UnregisteredType>()); + + QTest::newRow("invalid-object-path-arg") << serviceName << objectPath << interfaceName << "ping" + << (QVariantList() << qVariantFromValue(QDBusObjectPath())) + << "org.freedesktop.DBus.Error.Failed" + << "Marshalling failed: Invalid object path passed in arguments" + << ""; + + QTest::newRow("invalid-signature-arg") << serviceName << objectPath << interfaceName << "ping" + << (QVariantList() << qVariantFromValue(QDBusSignature())) + << "org.freedesktop.DBus.Error.Failed" + << "Marshalling failed: Invalid signature passed in arguments" + << ""; + + // invalid file descriptor + if (fileDescriptorPassing) { + QTest::newRow("invalid-file-descriptor") << serviceName << objectPath << interfaceName << "ping" + << (QVariantList() << qVariantFromValue(QDBusUnixFileDescriptor(-1))) + << "org.freedesktop.DBus.Error.Failed" + << "Marshalling failed: Invalid file descriptor passed in arguments" + << ""; + } } void tst_QDBusMarshall::sendCallErrors() @@ -967,6 +1042,21 @@ typedef QScopedPointer<DBusConnection, DisconnectRawDBus> ScopedDBusConnection; typedef QScopedPointer<DBusMessage, GenericUnref<DBusMessage, dbus_message_unref> > ScopedDBusMessage; typedef QScopedPointer<DBusPendingCall, GenericUnref<DBusPendingCall, dbus_pending_call_unref> > ScopedDBusPendingCall; +template <typename T> struct SetResetValue +{ + const T oldValue; + T &value; +public: + SetResetValue(T &v, T newValue) : oldValue(v), value(v) + { + value = newValue; + } + ~SetResetValue() + { + value = oldValue; + } +}; + void tst_QDBusMarshall::receiveUnknownType() { #ifndef DBUS_TYPE_UNIX_FD @@ -986,6 +1076,10 @@ void tst_QDBusMarshall::receiveUnknownType() if (!dbus_connection_can_send_type(rawcon.data(), DBUS_TYPE_UNIX_FD)) QSKIP("Your session bus does not allow sending Unix file descriptors", SkipAll); + // make sure this QDBusConnection won't handle Unix file descriptors + QDBusConnection::ConnectionCapabilities &capabRef = QDBusConnectionPrivate::d(con)->capabilities; + SetResetValue<QDBusConnection::ConnectionCapabilities> resetter(capabRef, capabRef & ~QDBusConnection::UnixFileDescriptorPassing); + if (qstrcmp(QTest::currentDataTag(), "in-call") == 0) { // create a call back to us containing a file descriptor QDBusMessageSpy spy; diff --git a/tests/auto/qdbusperformance/qdbusperformance.pro b/tests/auto/qdbusperformance/qdbusperformance.pro deleted file mode 100644 index 6880518..0000000 --- a/tests/auto/qdbusperformance/qdbusperformance.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,dbus): { - TEMPLATE = subdirs - CONFIG += ordered - SUBDIRS = server test -} else { - SOURCES += ../qdbusmarshall/dummy.cpp -} diff --git a/tests/auto/qdbustype/qdbustype.pro b/tests/auto/qdbustype/qdbustype.pro new file mode 100644 index 0000000..e2f0c90 --- /dev/null +++ b/tests/auto/qdbustype/qdbustype.pro @@ -0,0 +1,10 @@ +load(qttest_p4) +QT = core +contains(QT_CONFIG,dbus): { + SOURCES += tst_qdbustype.cpp + QT += dbus + QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS + LIBS_PRIVATE += $$QT_LIBS_DBUS +} else { + SOURCES += ../qdbusmarshall/dummy.cpp +} diff --git a/tests/auto/qdbustype/tst_qdbustype.cpp b/tests/auto/qdbustype/tst_qdbustype.cpp new file mode 100644 index 0000000..676a904 --- /dev/null +++ b/tests/auto/qdbustype/tst_qdbustype.cpp @@ -0,0 +1,273 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> +#include <QtCore/QCoreApplication> + +#include <QtDBus/private/qdbusutil_p.h> + +#include <dbus/dbus.h> + +class tst_QDBusType : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void isValidFixedType_data(); + void isValidFixedType(); + void isValidBasicType_data(); + void isValidBasicType(); + void isValidSingleSignature_data(); + void isValidSingleSignature(); + void isValidArray_data(); + void isValidArray(); + void isValidSignature_data(); + void isValidSignature(); +}; + +enum { Invalid = false, Valid = true }; + +static void addColumns() +{ + // All tests use these two columns only + QTest::addColumn<QString>("data"); + QTest::addColumn<bool>("result"); + QTest::addColumn<bool>("isValid"); +} + +// ---- type adds --- +static void addFixedTypes() +{ + QTest::newRow("bool") << DBUS_TYPE_BOOLEAN_AS_STRING << true << true; + QTest::newRow("byte") << DBUS_TYPE_BYTE_AS_STRING << true << true; + QTest::newRow("int16") << DBUS_TYPE_INT16_AS_STRING << true << true; + QTest::newRow("uint16") << DBUS_TYPE_UINT16_AS_STRING << true << true; + QTest::newRow("int32") << DBUS_TYPE_INT32_AS_STRING << true << true; + QTest::newRow("uint32") << DBUS_TYPE_UINT32_AS_STRING << true << true; + QTest::newRow("int64") << DBUS_TYPE_INT64_AS_STRING << true << true; + QTest::newRow("uint64") << DBUS_TYPE_UINT64_AS_STRING << true << true; + QTest::newRow("double") << DBUS_TYPE_DOUBLE_AS_STRING << true << true; +#ifdef DBUS_TYPE_UNIX_FD_AS_STRING + QTest::newRow("unixfd") << DBUS_TYPE_UNIX_FD_AS_STRING << true << true; +#endif +} + +static void addInvalidSingleLetterTypes() +{ + QChar nulString[] = { 0 }; + QTest::newRow("nul") << QString(nulString, 1) << false << false; + QTest::newRow("tilde") << "~" << false << false; + QTest::newRow("struct-begin") << "(" << false << false; + QTest::newRow("struct-end") << ")" << false << false; + QTest::newRow("dict-entry-begin") << "{" << false << false; + QTest::newRow("dict-entry-end") << "}" << false << false; + QTest::newRow("array-no-element") << "a" << false << false; +} + +static void addBasicTypes(bool basicsAreValid) +{ + addFixedTypes(); + QTest::newRow("string") << DBUS_TYPE_STRING_AS_STRING << basicsAreValid << true; + QTest::newRow("object-path") << DBUS_TYPE_OBJECT_PATH_AS_STRING << basicsAreValid << true; + QTest::newRow("signature") << DBUS_TYPE_SIGNATURE_AS_STRING << basicsAreValid << true; +} + +static void addVariant(bool variantIsValid) +{ + QTest::newRow("variant") << "v" << variantIsValid << true; +} + +static void addSingleSignatures() +{ + addBasicTypes(Valid); + addVariant(Valid); + QTest::newRow("struct-1") << "(y)" << true; + QTest::newRow("struct-2") << "(yy)" << true; + QTest::newRow("struct-3") << "(yyv)" << true; + + QTest::newRow("struct-nested-1") << "((y))" << true; + QTest::newRow("struct-nested-2") << "((yy))" << true; + QTest::newRow("struct-nested-3") << "(y(y))" << true; + QTest::newRow("struct-nested-4") << "((y)y)" << true; + QTest::newRow("struct-nested-5") << "(y(y)y)" << true; + QTest::newRow("struct-nested-6") << "((y)(y))" << true; + + QTest::newRow("array-1") << "as" << true; + QTest::newRow("struct-array-1") << "(as)" << true; + QTest::newRow("struct-array-2") << "(yas)" << true; + QTest::newRow("struct-array-3") << "(asy)" << true; + QTest::newRow("struct-array-4") << "(yasy)" << true; + + QTest::newRow("dict-1") << "a{sy}" << true; + QTest::newRow("dict-2") << "a{sv}" << true; + QTest::newRow("dict-struct-1") << "a{s(y)}" << true; + QTest::newRow("dict-struct-2") << "a{s(yyyy)}" << true; + QTest::newRow("dict-struct-array") << "a{s(ay)}" << true; + QTest::newRow("dict-array") << "a{sas}" << true; + QTest::newRow("dict-array-struct") << "a{sa(y)}" << true; + + addInvalidSingleLetterTypes(); + QTest::newRow("naked-dict-empty") << "{}" << false; + QTest::newRow("naked-dict-missing-value") << "{i}" << false; + + QTest::newRow("dict-empty") << "a{}" << false; + QTest::newRow("dict-missing-value") << "a{i}" << false; + QTest::newRow("dict-non-basic-key") << "a{vi}" << false; + QTest::newRow("dict-struct-key") << "a{(y)y}" << false; + QTest::newRow("dict-missing-close") << "a{sv" << false; + QTest::newRow("dict-mismatched-close") << "a{sv)" << false; + QTest::newRow("dict-missing-value-close") << "a{s" << false; + + QTest::newRow("empty-struct") << "()" << false; + QTest::newRow("struct-missing-close") << "(s" << false; + QTest::newRow("struct-nested-missing-close-1") << "((s)" << false; + QTest::newRow("struct-nested-missing-close-2") << "((s" << false; + + QTest::newRow("struct-ending-array-no-element") << "(a)" << false; +} + +static void addNakedDictEntry() +{ + QTest::newRow("naked-dict-entry") << "{sv}" << false; +} + +// ---- tests ---- + +void tst_QDBusType::isValidFixedType_data() +{ + addColumns(); + addFixedTypes(); + addBasicTypes(Invalid); + addVariant(Invalid); + addInvalidSingleLetterTypes(); +} + +void tst_QDBusType::isValidFixedType() +{ + QFETCH(QString, data); + QFETCH(bool, result); + QFETCH(bool, isValid); + Q_ASSERT_X(data.length() == 1, "tst_QDBusType", "Test is malformed, this function must test only one-letter types"); + Q_ASSERT(isValid || (!isValid && !result)); + + int type = data.at(0).unicode(); + if (isValid) + QCOMPARE(bool(dbus_type_is_fixed(type)), result); + QCOMPARE(QDBusUtil::isValidFixedType(type), result); +} + +void tst_QDBusType::isValidBasicType_data() +{ + addColumns(); + addBasicTypes(Valid); + addVariant(Invalid); + addInvalidSingleLetterTypes(); +} + +void tst_QDBusType::isValidBasicType() +{ + QFETCH(QString, data); + QFETCH(bool, result); + QFETCH(bool, isValid); + Q_ASSERT_X(data.length() == 1, "tst_QDBusType", "Test is malformed, this function must test only one-letter types"); + Q_ASSERT(isValid || (!isValid && !result)); + + int type = data.at(0).unicode(); + if (isValid) + QCOMPARE(bool(dbus_type_is_basic(type)), result); + QCOMPARE(QDBusUtil::isValidBasicType(type), result); +} + +void tst_QDBusType::isValidSingleSignature_data() +{ + addColumns(); + addSingleSignatures(); + addNakedDictEntry(); +} + +void tst_QDBusType::isValidSingleSignature() +{ + QFETCH(QString, data); + QFETCH(bool, result); + + QCOMPARE(bool(dbus_signature_validate_single(data.toLatin1(), 0)), result); + QCOMPARE(QDBusUtil::isValidSingleSignature(data), result); +} + +void tst_QDBusType::isValidArray_data() +{ + addColumns(); + addSingleSignatures(); +} + +void tst_QDBusType::isValidArray() +{ + QFETCH(QString, data); + QFETCH(bool, result); + + data.prepend("a"); + QCOMPARE(bool(dbus_signature_validate_single(data.toLatin1(), 0)), result); + QCOMPARE(QDBusUtil::isValidSingleSignature(data), result); + + data.prepend("a"); + QCOMPARE(bool(dbus_signature_validate_single(data.toLatin1(), 0)), result); + QCOMPARE(QDBusUtil::isValidSingleSignature(data), result); +} + +void tst_QDBusType::isValidSignature_data() +{ + isValidSingleSignature_data(); +} + +void tst_QDBusType::isValidSignature() +{ + QFETCH(QString, data); + QFETCH(bool, result); + + data.append(data); + if (data.at(0).unicode()) + QCOMPARE(bool(dbus_signature_validate(data.toLatin1(), 0)), result); + QCOMPARE(QDBusUtil::isValidSignature(data), result); +} + +QTEST_MAIN(tst_QDBusType) + +#include "tst_qdbustype.moc" diff --git a/tests/auto/qsslkey/tst_qsslkey.cpp b/tests/auto/qsslkey/tst_qsslkey.cpp index e7b4740..86da09e 100644 --- a/tests/auto/qsslkey/tst_qsslkey.cpp +++ b/tests/auto/qsslkey/tst_qsslkey.cpp @@ -108,10 +108,8 @@ tst_QSslKey::tst_QSslKey() #ifdef Q_WS_MAC // applicationDirPath() points to a path inside the app bundle on Mac. QDir dir(qApp->applicationDirPath() + QLatin1String("/../../../keys")); -#elif defined(Q_OS_WIN) || defined (Q_OS_SYMBIAN) - QDir dir(SRCDIR + QLatin1String("/keys")); // prefer this way to avoid ifdeffery and support shadow builds? #else - QDir dir(qApp->applicationDirPath() + QLatin1String("/keys")); + QDir dir(SRCDIR + QLatin1String("/keys")); // prefer this way to avoid ifdeffery and support shadow builds? #endif QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Readable); QRegExp rx(QLatin1String("^(rsa|dsa)-(pub|pri)-(\\d+)\\.(pem|der)$")); diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro index 00a1b37..b5e3a4b 100644 --- a/tests/benchmarks/benchmarks.pro +++ b/tests/benchmarks/benchmarks.pro @@ -7,6 +7,7 @@ SUBDIRS = \ svg contains(QT_CONFIG, opengl): SUBDIRS += opengl contains(QT_CONFIG, declarative): SUBDIRS += declarative +contains(QT_CONFIG, dbus): SUBDIRS += dbus check-trusted.CONFIG += recursive QMAKE_EXTRA_TARGETS += check-trusted diff --git a/tests/benchmarks/dbus/dbus.pro b/tests/benchmarks/dbus/dbus.pro new file mode 100644 index 0000000..989a0db --- /dev/null +++ b/tests/benchmarks/dbus/dbus.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs +SUBDIRS = \ + qdbusperformance \ + qdbustype diff --git a/tests/auto/qdbusperformance/.gitignore b/tests/benchmarks/dbus/qdbusperformance/.gitignore index 4cd8399..4cd8399 100644 --- a/tests/auto/qdbusperformance/.gitignore +++ b/tests/benchmarks/dbus/qdbusperformance/.gitignore diff --git a/tests/benchmarks/dbus/qdbusperformance/qdbusperformance.pro b/tests/benchmarks/dbus/qdbusperformance/qdbusperformance.pro new file mode 100644 index 0000000..90f88a7 --- /dev/null +++ b/tests/benchmarks/dbus/qdbusperformance/qdbusperformance.pro @@ -0,0 +1,4 @@ +load(qttest_p4) +TEMPLATE = subdirs +CONFIG += ordered +SUBDIRS = server test diff --git a/tests/auto/qdbusperformance/server/server.cpp b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp index 3bd5efc..3bd5efc 100644 --- a/tests/auto/qdbusperformance/server/server.cpp +++ b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp diff --git a/tests/auto/qdbusperformance/server/server.pro b/tests/benchmarks/dbus/qdbusperformance/server/server.pro index 30f81dd..30f81dd 100644 --- a/tests/auto/qdbusperformance/server/server.pro +++ b/tests/benchmarks/dbus/qdbusperformance/server/server.pro diff --git a/tests/auto/qdbusperformance/serverobject.h b/tests/benchmarks/dbus/qdbusperformance/serverobject.h index 6f85bb4..6f85bb4 100644 --- a/tests/auto/qdbusperformance/serverobject.h +++ b/tests/benchmarks/dbus/qdbusperformance/serverobject.h diff --git a/tests/auto/qdbusperformance/test/test.pro b/tests/benchmarks/dbus/qdbusperformance/test/test.pro index 9f5712e..9f5712e 100644 --- a/tests/auto/qdbusperformance/test/test.pro +++ b/tests/benchmarks/dbus/qdbusperformance/test/test.pro diff --git a/tests/auto/qdbusperformance/tst_qdbusperformance.cpp b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp index a5b4b98..a5b4b98 100644 --- a/tests/auto/qdbusperformance/tst_qdbusperformance.cpp +++ b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp diff --git a/tests/benchmarks/dbus/qdbustype/main.cpp b/tests/benchmarks/dbus/qdbustype/main.cpp new file mode 100644 index 0000000..abaae7e --- /dev/null +++ b/tests/benchmarks/dbus/qdbustype/main.cpp @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> +#include <QtCore/QCoreApplication> + +#include <QtDBus/private/qdbusutil_p.h> + +#include <dbus/dbus.h> + +class tst_QDBusType: public QObject +{ + Q_OBJECT +private Q_SLOTS: + void benchmarkSignature_data(); + void benchmarkSignature(); +}; + +static inline void benchmarkAddRow(const char *name, const char *data) +{ + QTest::newRow(QByteArray("native-") + name) << data << true; + QTest::newRow(name) << data << false; +} + +void tst_QDBusType::benchmarkSignature_data() +{ + QTest::addColumn<QString>("data"); + QTest::addColumn<bool>("useNative"); + + for (int loopCount = 0; loopCount < 2; ++loopCount) { + bool useNative = loopCount; + QByteArray prefix = useNative ? "native-" : ""; + + benchmarkAddRow("single-invalid", "~"); + benchmarkAddRow("single-invalid-array", "a~"); + benchmarkAddRow("single-invalid-struct", "(.)"); + + benchmarkAddRow("single-char", "b"); + benchmarkAddRow("single-array", "as"); + benchmarkAddRow("single-simplestruct", "(y)"); + benchmarkAddRow("single-simpledict", "a{sv}"); + benchmarkAddRow("single-complexdict", "a{s(aya{io})}"); + + benchmarkAddRow("multiple-char", "ssg"); + benchmarkAddRow("multiple-arrays", "asasay"); + + benchmarkAddRow("struct-missingclose", "(ayyyy"); + benchmarkAddRow("longstruct", "(yyyyyyayasy)"); + benchmarkAddRow("invalid-longstruct", "(yyyyyyayas.y)"); + benchmarkAddRow("complexstruct", "(y(aasay)oga{sv})"); + benchmarkAddRow("multiple-simple-structs", "(y)(y)(y)"); + } +} + +void tst_QDBusType::benchmarkSignature() +{ + QFETCH(QString, data); + QFETCH(bool, useNative); + + bool result; + if (useNative) { + dbus_signature_validate(data.toLatin1(), 0); + QBENCHMARK { + result = dbus_signature_validate(data.toLatin1(), 0); + } + } else { + QDBusUtil::isValidSignature(data); + QBENCHMARK { + result = QDBusUtil::isValidSignature(data); + } + } + Q_UNUSED(result); +} + +QTEST_MAIN(tst_QDBusType) + +#include "main.moc" diff --git a/tests/benchmarks/dbus/qdbustype/qdbustype.pro b/tests/benchmarks/dbus/qdbustype/qdbustype.pro new file mode 100644 index 0000000..d480a05 --- /dev/null +++ b/tests/benchmarks/dbus/qdbustype/qdbustype.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +TARGET = tst_bench_qdbustype +QT -= gui +QT += dbus +QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS +LIBS_PRIVATE += $$QT_LIBS_DBUS + +SOURCES += main.cpp diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts index 42557e6..c8ae518 100644 --- a/translations/assistant_de.ts +++ b/translations/assistant_de.ts @@ -261,6 +261,10 @@ Grund: <translation>Adresse</translation> </message> <message> + <source>Toolbar Menu</source> + <translation>Werkzeugleisten-Menu</translation> + </message> + <message> <source>Bookmarks Menu</source> <translation>Lesezeichen-Menü</translation> </message> @@ -288,11 +292,11 @@ Grund: <name>CentralWidget</name> <message> <source>Add new page</source> - <translation>Neue Seite hinzufügen</translation> + <translation type="obsolete">Neue Seite hinzufügen</translation> </message> <message> <source>Close current page</source> - <translation>Aktuelle Seite schließen</translation> + <translation type="obsolete">Aktuelle Seite schließen</translation> </message> <message> <source>Print Document</source> @@ -300,27 +304,27 @@ Grund: </message> <message> <source>unknown</source> - <translation>unbekannt</translation> + <translation type="obsolete">unbekannt</translation> </message> <message> <source>Add New Page</source> - <translation>Neue Seite hinzufügen</translation> + <translation type="obsolete">Neue Seite hinzufügen</translation> </message> <message> <source>Close This Page</source> - <translation>Aktuelle Seite schließen</translation> + <translation type="obsolete">Aktuelle Seite schließen</translation> </message> <message> <source>Close Other Pages</source> - <translation>Andere Seiten schließen</translation> + <translation type="obsolete">Andere Seiten schließen</translation> </message> <message> <source>Add Bookmark for this Page...</source> - <translation>Lesezeichen für diese Seite hinzufügen ...</translation> + <translation type="obsolete">Lesezeichen für diese Seite hinzufügen ...</translation> </message> <message> <source>Search</source> - <translation>Suchen</translation> + <translation type="obsolete">Suchen</translation> </message> </context> <context> @@ -640,6 +644,49 @@ Grund: </message> </context> <context> + <name>GlobalActions</name> + <message> + <source>&Back</source> + <translation>&Rückwärts</translation> + </message> + <message> + <source>&Forward</source> + <translation>&Vorwärts</translation> + </message> + <message> + <source>&Home</source> + <translation>&Startseite</translation> + </message> + <message> + <source>ALT+Home</source> + <translation>ALT+Home</translation> + </message> + <message> + <source>Zoom &in</source> + <translation>&Vergrößern</translation> + </message> + <message> + <source>Zoom &out</source> + <translation>Ver&kleinern</translation> + </message> + <message> + <source>&Copy selected Text</source> + <translation>Ausgewählten Text &kopieren</translation> + </message> + <message> + <source>&Print...</source> + <translation>&Drucken ...</translation> + </message> + <message> + <source>&Find in Text...</source> + <translation>&Textsuche ...</translation> + </message> + <message> + <source>&Find</source> + <translation>&Suchen</translation> + </message> +</context> +<context> <name>HelpEngineWrapper</name> <message> <source>Unfiltered</source> @@ -664,16 +711,32 @@ Grund: <translation><title>Fehler 404 ...</title><div align="center"><br><br><h1>Die Seite kann nicht gefunden werden.</h1><br><h3>'%1'</h3></div></translation> </message> <message> + <source>Open Link</source> + <translation>Link öffnen</translation> + </message> + <message> <source>Copy &Link Location</source> <translation>&Link-Adresse kopieren</translation> </message> <message> + <source>Copy</source> + <translation>Kopieren</translation> + </message> + <message> + <source>Reload</source> + <translation>Neu laden</translation> + </message> + <message> <source>Open Link in New Tab Ctrl+LMB</source> <translation>Link in neuem Reiter öffnen (Strg + linke Maustaste)</translation> </message> <message> <source>Open Link in New Tab</source> - <translation>Link in neuem Reiter öffnen</translation> + <translation type="obsolete">Link in neuem Reiter öffnen</translation> + </message> + <message> + <source>Open Link in New Page</source> + <translation>Link in neuer Seite öffnen</translation> </message> </context> <context> @@ -881,7 +944,7 @@ Grund: </message> <message> <source>&Print...</source> - <translation>&Drucken ...</translation> + <translation type="obsolete">&Drucken ...</translation> </message> <message> <source>New &Tab</source> @@ -901,15 +964,15 @@ Grund: </message> <message> <source>&Copy selected Text</source> - <translation>Ausgewählten Text &kopieren</translation> + <translation type="obsolete">Ausgewählten Text &kopieren</translation> </message> <message> <source>&Find in Text...</source> - <translation>&Textsuche ...</translation> + <translation type="obsolete">&Textsuche ...</translation> </message> <message> <source>&Find</source> - <translation>&Suchen</translation> + <translation type="obsolete">&Suchen</translation> </message> <message> <source>Find &Next</source> @@ -925,11 +988,11 @@ Grund: </message> <message> <source>Zoom &in</source> - <translation>&Vergrößern</translation> + <translation type="obsolete">&Vergrößern</translation> </message> <message> <source>Zoom &out</source> - <translation>Ver&kleinern</translation> + <translation type="obsolete">Ver&kleinern</translation> </message> <message> <source>Normal &Size</source> @@ -953,15 +1016,15 @@ Grund: </message> <message> <source>&Home</source> - <translation>&Startseite</translation> + <translation type="obsolete">&Startseite</translation> </message> <message> <source>&Back</source> - <translation>&Rückwärts</translation> + <translation type="obsolete">&Rückwärts</translation> </message> <message> <source>&Forward</source> - <translation>&Vorwärts</translation> + <translation type="obsolete">&Vorwärts</translation> </message> <message> <source>Sync with Table of Contents</source> @@ -1000,6 +1063,22 @@ Grund: <translation>Über ...</translation> </message> <message> + <source>Open Pages</source> + <translation>Offene Seiten</translation> + </message> + <message> + <source>Bookmark Toolbar</source> + <translation>Lesezeichen-Leiste</translation> + </message> + <message> + <source>E&xit</source> + <translation>B&eenden</translation> + </message> + <message> + <source>ALT+P</source> + <translation>ALT+P</translation> + </message> + <message> <source>Navigation Toolbar</source> <translation>Navigationsleiste</translation> </message> @@ -1073,7 +1152,7 @@ Grund: </message> <message> <source>ALT+Home</source> - <translation>ALT+Home</translation> + <translation type="obsolete">ALT+Home</translation> </message> <message> <source>&Bookmarks</source> @@ -1089,6 +1168,17 @@ Grund: </message> </context> <context> + <name>OpenPagesWidget</name> + <message> + <source>Close %1</source> + <translation>Schließe %1</translation> + </message> + <message> + <source>Close All Except %1</source> + <translation>Alle außer %1 schließen</translation> + </message> +</context> +<context> <name>OutputPage</name> <message> <source>Form</source> @@ -1307,6 +1397,14 @@ Möchten Sie sie löschen?</translation> <source>Blank Page</source> <translation>Leere Seite</translation> </message> + <message> + <source>Appearance</source> + <translation>Erscheinungsbild</translation> + </message> + <message> + <source>Show tabs for each individual page</source> + <translation>Reiter für jede einzelne Seite anzeigen</translation> + </message> </context> <context> <name>QCollectionGenerator</name> @@ -1507,6 +1605,29 @@ qhelpgenerator <Hilfe-Projektdatei> [Optionen] </message> </context> <context> + <name>TabBar</name> + <message> + <source>(Untitled)</source> + <translation>(Ohne Titel)</translation> + </message> + <message> + <source>New &Tab</source> + <translation>Neuer &Reiter</translation> + </message> + <message> + <source>&Close Tab</source> + <translation>Reiter &schließen</translation> + </message> + <message> + <source>Close Other Tabs</source> + <translation>Andere Reiter schließen</translation> + </message> + <message> + <source>Add Bookmark for this Page...</source> + <translation>Lesezeichen für diese Seite hinzufügen ...</translation> + </message> +</context> +<context> <name>TopicChooser</name> <message> <source>Choose a topic for <b>%1</b>:</source> diff --git a/translations/designer_de.ts b/translations/designer_de.ts index e7aeb51..91da4c0 100644 --- a/translations/designer_de.ts +++ b/translations/designer_de.ts @@ -364,7 +364,7 @@ </message> <message> <source>page</source> - <translation>Seite</translation> + <translation type="obsolete">Seite</translation> </message> <message> <source>Insert Page</source> @@ -476,7 +476,7 @@ </message> <message> <source>subwindow</source> - <translation>subwindow</translation> + <translation type="obsolete">subwindow</translation> </message> <message> <source>Subwindow</source> @@ -520,6 +520,10 @@ <translation>Layout von '%1' von %2 in %3 umwandeln</translation> </message> <message> + <source>Change layout alignment</source> + <translation>Ausrichtung des Layouts ändern</translation> + </message> + <message> <source>Add '%1' to '%2'</source> <extracomment>Command description for adding buttons to a QButtonGroup</extracomment> <translation>'%1' zu '%2' hinzufügen</translation> @@ -1834,7 +1838,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier </message> <message> <source>Edit</source> - <translation>Bearbeiten</translation> + <translation type="obsolete">Bearbeiten</translation> </message> <message> <source>Toolbars</source> @@ -1849,6 +1853,10 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier <translation>&Ansicht</translation> </message> <message> + <source>&Edit</source> + <translation>&Bearbeiten</translation> + </message> + <message> <source>&Settings</source> <translation>&Einstellungen</translation> </message> @@ -3734,6 +3742,10 @@ Möchten Sie sie überschreiben?</translation> <translation>Geerbt</translation> </message> <message> + <source>[Theme] %1</source> + <translation>[Thema] %1</translation> + </message> + <message> <source>Horizontal</source> <translation>Horizontal</translation> </message> @@ -3742,6 +3754,10 @@ Möchten Sie sie überschreiben?</translation> <translation>Vertikal</translation> </message> <message> + <source>Theme</source> + <translation>Thema</translation> + </message> + <message> <source>Normal Off</source> <translation>Normal, aus</translation> </message> @@ -4328,6 +4344,17 @@ Möchten Sie sie überschreiben?</translation> </message> </context> <context> + <name>qdesigner_internal::IconThemeDialog</name> + <message> + <source>Set Icon From Theme</source> + <translation>Icon aus Thema setzen</translation> + </message> + <message> + <source>Input icon name from the current theme:</source> + <translation>Icon-Name vom aktuellen Thema eingeben:</translation> + </message> +</context> +<context> <name>qdesigner_internal::ItemListEditor</name> <message> <source>Properties &<<</source> @@ -4470,15 +4497,15 @@ Möchten Sie sie überschreiben?</translation> </message> <message> <source>Shortcut:</source> - <translation>Tastenkürzel</translation> + <translation type="obsolete">Tastenkürzel</translation> </message> <message> <source>Checkable:</source> - <translation>Ankreuzbar:</translation> + <translation type="obsolete">Ankreuzbar:</translation> </message> <message> <source>ToolTip:</source> - <translation>ToolTip:</translation> + <translation type="obsolete">ToolTip:</translation> </message> <message> <source>...</source> @@ -4492,6 +4519,22 @@ Möchten Sie sie überschreiben?</translation> <source>Object &name:</source> <translation>Objekt&name:</translation> </message> + <message> + <source>T&oolTip:</source> + <translation>T&oolTip:</translation> + </message> + <message> + <source>Icon th&eme:</source> + <translation>Icon-Th&ema:</translation> + </message> + <message> + <source>&Checkable:</source> + <translation>&Ankreuzbar:</translation> + </message> + <message> + <source>&Shortcut:</source> + <translation>Tastenk&ürzel</translation> + </message> </context> <context> <name>qdesigner_internal::NewDynamicPropertyDialog</name> @@ -4748,9 +4791,17 @@ Please select another name.</source> <translation>Datei auswählen...</translation> </message> <message> + <source>Set Icon From Theme...</source> + <translation>Icon aus Thema setzen...</translation> + </message> + <message> <source>...</source> <translation>...</translation> </message> + <message> + <source>[Theme] %1</source> + <translation>[Thema] %1</translation> + </message> </context> <context> <name>qdesigner_internal::PlainTextEditorDialog</name> @@ -5132,6 +5183,42 @@ Klasse: %2</translation> <translation>Größe</translation> </message> <message> + <source>Layout Alignment</source> + <translation>Ausrichtung des Layouts</translation> + </message> + <message> + <source>No Horizontal Alignment</source> + <translation>Keine horizontale Ausrichtung</translation> + </message> + <message> + <source>Left</source> + <translation>Links</translation> + </message> + <message> + <source>Center Horizontally</source> + <translation>Horizontal zentrieren</translation> + </message> + <message> + <source>Right</source> + <translation>Rechts</translation> + </message> + <message> + <source>No Vertical Alignment</source> + <translation>Keine vertikale Ausrichtung</translation> + </message> + <message> + <source>Top</source> + <translation>Oben</translation> + </message> + <message> + <source>Center Vertically</source> + <translation>Vertikal zentrieren</translation> + </message> + <message> + <source>Bottom</source> + <translation>Unten</translation> + </message> + <message> <source>Set Minimum Width</source> <translation>Minimalbreite festlegen</translation> </message> @@ -5338,6 +5425,10 @@ Klasse: %2</translation> <source>Insert &Image</source> <translation>&Bild einfügen</translation> </message> + <message> + <source>Simplify Rich Text</source> + <translation>Formatierbaren Text vereinfachen</translation> + </message> </context> <context> <name>qdesigner_internal::ScriptDialog</name> diff --git a/translations/qt_de.ts b/translations/qt_de.ts index 0e62340..92a9e1d 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -2514,6 +2514,10 @@ nach <source>Cannot create %1 for output</source> <translation>%1 kann nicht erstellt werden</translation> </message> + <message> + <source>No file engine available or engine does not support UnMapExtension</source> + <translation>Es ist kein Datei-Engine verfügbar oder der gegenwärtig aktive Engine unterstützt die UnMap-Erweiterung nicht</translation> + </message> </context> <context> <name>QFileDialog</name> @@ -3483,6 +3487,18 @@ Möchten Sie die Datei trotzdem löschen?</translation> <source>Cannot resolve symbol "%1" in %2: %3</source> <translation>Das Symbol "%1" kann in %2 nicht aufgelöst werden: %3</translation> </message> + <message> + <source>'%1' is not an ELF object (%2)</source> + <translation>'%1' ist keine ELF-Objektdatei (%2)</translation> + </message> + <message> + <source>'%1' is not an ELF object</source> + <translation>'%1' ist keine ELF-Objektdatei</translation> + </message> + <message> + <source>'%1' is an invalid ELF object (%2)</source> + <translation>'%1' ist keine gültige ELF-Objektdatei (%2)</translation> + </message> </context> <context> <name>QLineEdit</name> @@ -3580,6 +3596,10 @@ Möchten Sie die Datei trotzdem löschen?</translation> <source>%1: Unknown error %2</source> <translation>%1: Unbekannter Fehler %2</translation> </message> + <message> + <source>%1: Access denied</source> + <translation>%1: Zugriff verweigert</translation> + </message> </context> <context> <name>QMYSQLDriver</name> @@ -3922,7 +3942,7 @@ Möchten Sie die Datei trotzdem löschen?</translation> <name>QNetworkAccessDataBackend</name> <message> <source>Operation not supported on %1</source> - <translation>Diese Operation wird von %1 nicht unterstützt</translation> + <translation type="obsolete">Diese Operation wird von %1 nicht unterstützt</translation> </message> <message> <source>Invalid URI: %1</source> |