diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-12-29 20:36:17 -0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-31 06:50:42 +0000 |
commit | 26edd5a3b127c09ade9e75c45e5271113da81064 (patch) | |
tree | 968421ab3b27c6fdb3448c79be3001b6c499cf0c /src/dbus/qdbusutil_p.h | |
parent | 635f95846ee8eba25b36d0b83ad658ae56c63ed0 (diff) |
Use QStringLiteral where applicable in QtDBus
Move to qdbusutil_p.h the string constants that are used often and in
multiple places; use QStringLiteral in qdbusintegrator.cpp for the
strings that are used often.
Change-Id: I8e1325b9ba015bda91bf01c42175d8032ea32f62
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/dbus/qdbusutil_p.h')
-rw-r--r-- | src/dbus/qdbusutil_p.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/dbus/qdbusutil_p.h b/src/dbus/qdbusutil_p.h index b5f92f2e47..8f5ae922db 100644 --- a/src/dbus/qdbusutil_p.h +++ b/src/dbus/qdbusutil_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2015 Intel Corporation. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtDBus module of the Qt Toolkit. @@ -51,6 +52,8 @@ #include <QtDBus/qdbusmacros.h> #include <QtDBus/qdbuserror.h> +#include "qdbus_symbols_p.h" + #ifndef QT_NO_DBUS QT_BEGIN_NAMESPACE @@ -147,6 +150,25 @@ namespace QDBusUtil *error = QDBusError(QDBusError::InvalidInterface, QString::fromLatin1("Invalid error name: %1").arg(name)); return false; } + + inline QString dbusService() + { return QStringLiteral(DBUS_SERVICE_DBUS); } + inline QString dbusPath() + { return QStringLiteral(DBUS_PATH_DBUS); } + inline QString dbusInterface() + { + // it's the same string, but just be sure + Q_ASSERT(dbusService() == QLatin1String(DBUS_INTERFACE_DBUS)); + return dbusService(); + } + inline QString dbusInterfaceProperties() + { return QStringLiteral(DBUS_INTERFACE_PROPERTIES); } + inline QString dbusInterfaceIntrospectable() + { return QStringLiteral(DBUS_INTERFACE_INTROSPECTABLE); } + inline QString nameOwnerChanged() + { return QStringLiteral("NameOwnerChanged"); } + inline QString disconnectedErrorMessage() + { return QStringLiteral("Not connected to D-Bus server"); } } QT_END_NAMESPACE |