diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-05-28 08:27:50 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-05-28 08:31:07 (GMT) |
commit | f390f9b51cf8686e9ed44f13a33c7349b9e96a09 (patch) | |
tree | 162c768769713a7215bca64daf8f2bdc75c9fbee /src/dbus | |
parent | 0bb0699d403b7541472a72a4057ecf0ca366a7cd (diff) | |
download | Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.zip Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.tar.gz Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.tar.bz2 |
improved string operations all over the place
used character operations whenever possible
better usage of QLatin1String
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbuserror.cpp | 2 | ||||
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 6 | ||||
-rw-r--r-- | src/dbus/qdbusmetaobject.cpp | 2 | ||||
-rw-r--r-- | src/dbus/qdbusutil.cpp | 16 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 955a31c..2347a54 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -339,7 +339,7 @@ QString QDBusError::errorString(ErrorType error) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QDBusError &msg) { - dbg.nospace() << "QDBusError(" << msg.name() << ", " << msg.message() << ")"; + dbg.nospace() << "QDBusError(" << msg.name() << ", " << msg.message() << ')'; return dbg.space(); } #endif diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index f40a45f..33f44ab 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -74,7 +74,7 @@ static inline QDebug operator<<(QDebug dbg, const QThread *th) dbg.nospace() << "QThread(ptr=" << (void*)th; if (th && !th->objectName().isEmpty()) dbg.nospace() << ", name=" << th->objectName(); - dbg.nospace() << ")"; + dbg.nospace() << ')'; return dbg.space(); } @@ -90,7 +90,7 @@ static inline QDebug operator<<(QDebug dbg, const QDBusConnectionPrivate *conn) dbg.nospace() << "same thread"; else dbg.nospace() << conn->thread(); - dbg.nospace() << ")"; + dbg.nospace() << ')'; return dbg.space(); } @@ -565,7 +565,7 @@ static void huntAndEmit(DBusConnection *connection, DBusMessage *msg, QDBusConnectionPrivate::ObjectTreeNode::DataList::ConstIterator it = haystack.children.constBegin(); QDBusConnectionPrivate::ObjectTreeNode::DataList::ConstIterator end = haystack.children.constEnd(); for ( ; it != end; ++it) - huntAndEmit(connection, msg, needle, *it, isScriptable, isAdaptor, path + QLatin1String("/") + it->name); + huntAndEmit(connection, msg, needle, *it, isScriptable, isAdaptor, path + QLatin1Char('/') + it->name); if (needle == haystack.obj) { // is this a signal we should relay? diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index 8eb8b1a..ce76ecc 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -601,7 +601,7 @@ QDBusMetaObject *QDBusMetaObject::createMetaObject(const QString &interface, con // mark as an error error = QDBusError(QDBusError::UnknownInterface, - QString( QLatin1String("Interface '%1' was not found") ) + QString::fromLatin1("Interface '%1' was not found") .arg(interface)); return 0; } diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index 471b899..dd983a0 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -80,15 +80,15 @@ static bool variantToString(const QVariant &arg, QString &out) int argType = arg.userType(); if (argType == QVariant::StringList) { - out += QLatin1String("{"); + out += QLatin1Char('{'); QStringList list = arg.toStringList(); foreach (QString item, list) out += QLatin1Char('\"') + item + QLatin1String("\", "); if (!list.isEmpty()) out.chop(2); - out += QLatin1String("}"); + out += QLatin1Char('}'); } else if (argType == QVariant::ByteArray) { - out += QLatin1String("{"); + out += QLatin1Char('{'); QByteArray list = arg.toByteArray(); for (int i = 0; i < list.count(); ++i) { out += QString::number(list.at(i)); @@ -96,9 +96,9 @@ static bool variantToString(const QVariant &arg, QString &out) } if (!list.isEmpty()) out.chop(2); - out += QLatin1String("}"); + out += QLatin1Char('}'); } else if (argType == QVariant::List) { - out += QLatin1String("{"); + out += QLatin1Char('{'); QList<QVariant> list = arg.toList(); foreach (QVariant item, list) { if (!variantToString(item, out)) @@ -107,7 +107,7 @@ static bool variantToString(const QVariant &arg, QString &out) } if (!list.isEmpty()) out.chop(2); - out += QLatin1String("}"); + out += QLatin1Char('}'); } else if (argType == QMetaType::Char || argType == QMetaType::Short || argType == QMetaType::Int || argType == QMetaType::Long || argType == QMetaType::LongLong) { out += QString::number(arg.toLongLong()); @@ -142,7 +142,7 @@ static bool variantToString(const QVariant &arg, QString &out) return false; out += QLatin1Char(']'); } else if (arg.canConvert(QVariant::String)) { - out += QLatin1String("\"") + arg.toString() + QLatin1String("\""); + out += QLatin1Char('\"') + arg.toString() + QLatin1Char('\"'); } else { out += QLatin1Char('['); out += QLatin1String(arg.typeName()); @@ -226,7 +226,7 @@ bool argToString(const QDBusArgument &busArg, QString &out) if (elementType != QDBusArgument::BasicType && elementType != QDBusArgument::VariantType && elementType != QDBusArgument::MapEntryType) - out += QLatin1String("]"); + out += QLatin1Char(']'); return true; } |