From 26edd5a3b127c09ade9e75c45e5271113da81064 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 29 Dec 2014 20:36:17 -0200 Subject: 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 --- src/dbus/qdbusutil_p.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/dbus/qdbusutil_p.h') 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 #include +#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 -- cgit v1.2.3