diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-06-30 08:31:22 -0700 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-08-13 09:07:38 +0200 |
commit | 4e6ebabb305e47a7fd20c510e79715ef912a924a (patch) | |
tree | ceb3ac97eecdb2149b963c5f2bb941d752b451ac /src/dbus/qdbusintegrator.cpp | |
parent | d2c1a6cbb459a2271ae92ddcbca507f4ccd3a863 (diff) |
Replace the const QString global static with a QStringLiteral
It was originally created to avoid allocating memory for the QString at
every turn, but we have QStringLiteral for that today. It has also
served a very good run by catching qatomic.h implementations that had
bad cv qualifications.
Change-Id: Id6d952b8cce363015ec2611d346b4cccedecf137
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/dbus/qdbusintegrator.cpp')
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 468859fdec..470cc991dc 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -77,15 +77,21 @@ QT_BEGIN_NAMESPACE static QBasicAtomicInt isDebugging = Q_BASIC_ATOMIC_INITIALIZER(-1); #define qDBusDebug if (::isDebugging == 0); else qDebug -Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS))) +static inline QString orgFreedesktopDBusString() +{ + return QStringLiteral(DBUS_SERVICE_DBUS); +} static inline QString dbusServiceString() -{ return *orgFreedesktopDBusString(); } +{ + return orgFreedesktopDBusString(); +} + static inline QString dbusInterfaceString() { // it's the same string, but just be sure - Q_ASSERT(*orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS)); - return *orgFreedesktopDBusString(); + Q_ASSERT(orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS)); + return orgFreedesktopDBusString(); } static inline QDebug operator<<(QDebug dbg, const QThread *th) |