summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-03-29 09:53:06 -0300
committerQt by Nokia <qt-info@nokia.com>2012-04-16 00:07:25 +0200
commit65e75acd05b16fea11d85f3a6a330d50c8ce7c5d (patch)
tree60e8b8eb1c60910ecea4dde2d0a35cdac16e93e3
parent51fecf80b7643035159bf79970231ee2f4017af5 (diff)
Update the error codes in QtDBus
Change the old com.trolltech ones to org.qtproject and introduce Use the alternate domain name for the Qt Project because the dash character is not valid in interface and error names. Task-number: QTBUG-23274 Change-Id: Iac1699e70525d67f983c10560932acff6b2ecde6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
-rw-r--r--src/dbus/qdbuserror.cpp37
-rw-r--r--src/dbus/qdbuserror.h2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp14
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp12
4 files changed, 33 insertions, 32 deletions
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp
index 713ef75a93..9b21adee45 100644
--- a/src/dbus/qdbuserror.cpp
+++ b/src/dbus/qdbuserror.cpp
@@ -93,12 +93,12 @@ org.freedesktop.DBus.Error.UnknownMethod
org.freedesktop.DBus.Error.TimedOut
org.freedesktop.DBus.Error.InvalidSignature
org.freedesktop.DBus.Error.UnknownInterface
-com.trolltech.QtDBus.Error.InternalError
org.freedesktop.DBus.Error.UnknownObject
-com.trolltech.QtDBus.Error.InvalidService
-com.trolltech.QtDBus.Error.InvalidObjectPath
-com.trolltech.QtDBus.Error.InvalidInterface
-com.trolltech.QtDBus.Error.InvalidMember
+org.qtproject.QtDBus.Error.InternalError
+org.qtproject.QtDBus.Error.InvalidService
+org.qtproject.QtDBus.Error.InvalidObjectPath
+org.qtproject.QtDBus.Error.InvalidInterface
+org.qtproject.QtDBus.Error.InvalidMember
*/
// in the same order as KnownErrors!
@@ -122,19 +122,19 @@ static const char errorMessages_string[] =
"org.freedesktop.DBus.Error.TimedOut\0"
"org.freedesktop.DBus.Error.InvalidSignature\0"
"org.freedesktop.DBus.Error.UnknownInterface\0"
- "com.trolltech.QtDBus.Error.InternalError\0"
"org.freedesktop.DBus.Error.UnknownObject\0"
- "com.trolltech.QtDBus.Error.InvalidService\0"
- "com.trolltech.QtDBus.Error.InvalidObjectPath\0"
- "com.trolltech.QtDBus.Error.InvalidInterface\0"
- "com.trolltech.QtDBus.Error.InvalidMember\0"
+ "org.qtproject.QtDBus.Error.InternalError\0"
+ "org.qtproject.QtDBus.Error.InvalidService\0"
+ "org.qtproject.QtDBus.Error.InvalidObjectPath\0"
+ "org.qtproject.QtDBus.Error.InvalidInterface\0"
+ "org.qtproject.QtDBus.Error.InvalidMember\0"
"\0";
static const int errorMessages_indices[] = {
- 0, 6, 40, 76, 118, 153, 191, 231,
- 273, 313, 349, 384, 421, 461, 501, 540,
- 581, 617, 661, 705, 746, 787, 829, 874,
- 918, 0
+ 0, 6, 40, 76, 118, 153, 191, 231,
+ 273, 313, 349, 384, 421, 461, 501, 540,
+ 581, 617, 661, 705, 746, 787, 829, 874,
+ 918, -1
};
static const int errorMessages_count = sizeof errorMessages_indices /
@@ -226,9 +226,12 @@ static inline QDBusError::ErrorType get(const char *name)
(\c org.freedesktop.DBus.Error.TimedOut)
\value InvalidSignature The type signature is not valid or compatible
(\c org.freedesktop.DBus.Error.InvalidSignature)
- \value UnknownInterface The interface is not known
+ \value UnknownInterface The interface is not known in this object
+ (\c org.freedesktop.DBus.Error.UnknownInterface)
+ \value UnknownObject The object path points to an object that does not exist
+ (\c org.freedesktop.DBus.Error.UnknownObject)
+
\value InternalError An internal error occurred
- (\c com.trolltech.QtDBus.Error.InternalError)
\value InvalidObjectPath The object path provided is invalid.
@@ -237,8 +240,6 @@ static inline QDBusError::ErrorType get(const char *name)
\value InvalidMember The member is invalid.
\value InvalidInterface The interface is invalid.
-
- \value UnknownObject The remote object could not be found.
*/
#ifndef QT_BOOTSTRAPPED
diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h
index b73ad34db1..a79e66cc04 100644
--- a/src/dbus/qdbuserror.h
+++ b/src/dbus/qdbuserror.h
@@ -80,8 +80,8 @@ public:
TimedOut,
InvalidSignature,
UnknownInterface,
- InternalError,
UnknownObject,
+ InternalError,
InvalidService,
InvalidObjectPath,
InvalidInterface,
diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
index b696294005..7ac5cd3c6c 100644
--- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
@@ -1034,9 +1034,9 @@ void tst_QDBusAbstractInterface::createErrors_data()
QTest::addColumn<QString>("path");
QTest::addColumn<QString>("errorName");
- QTest::newRow("invalid-service") << "this isn't valid" << "/" << "com.trolltech.QtDBus.Error.InvalidService";
+ QTest::newRow("invalid-service") << "this isn't valid" << "/" << "org.qtproject.QtDBus.Error.InvalidService";
QTest::newRow("invalid-path") << QDBusConnection::sessionBus().baseService() << "this isn't valid"
- << "com.trolltech.QtDBus.Error.InvalidObjectPath";
+ << "org.qtproject.QtDBus.Error.InvalidObjectPath";
}
void tst_QDBusAbstractInterface::createErrors()
@@ -1055,7 +1055,7 @@ void tst_QDBusAbstractInterface::createErrorsPeer_data()
QTest::addColumn<QString>("path");
QTest::addColumn<QString>("errorName");
- QTest::newRow("invalid-path") << "this isn't valid" << "com.trolltech.QtDBus.Error.InvalidObjectPath";
+ QTest::newRow("invalid-path") << "this isn't valid" << "org.qtproject.QtDBus.Error.InvalidObjectPath";
}
void tst_QDBusAbstractInterface::createErrorsPeer()
@@ -1071,10 +1071,10 @@ void tst_QDBusAbstractInterface::createErrorsPeer()
void tst_QDBusAbstractInterface::callErrors_data()
{
createErrors_data();
- QTest::newRow("service-wildcard") << QString() << "/" << "com.trolltech.QtDBus.Error.InvalidService";
+ QTest::newRow("service-wildcard") << QString() << "/" << "org.qtproject.QtDBus.Error.InvalidService";
QTest::newRow("path-wildcard") << QDBusConnection::sessionBus().baseService() << QString()
- << "com.trolltech.QtDBus.Error.InvalidObjectPath";
- QTest::newRow("full-wildcard") << QString() << QString() << "com.trolltech.QtDBus.Error.InvalidService";
+ << "org.qtproject.QtDBus.Error.InvalidObjectPath";
+ QTest::newRow("full-wildcard") << QString() << QString() << "org.qtproject.QtDBus.Error.InvalidService";
}
void tst_QDBusAbstractInterface::callErrors()
@@ -1113,7 +1113,7 @@ void tst_QDBusAbstractInterface::asyncCallErrors()
void tst_QDBusAbstractInterface::callErrorsPeer_data()
{
createErrorsPeer_data();
- QTest::newRow("path-wildcard") << QString() << "com.trolltech.QtDBus.Error.InvalidObjectPath";
+ QTest::newRow("path-wildcard") << QString() << "org.qtproject.QtDBus.Error.InvalidObjectPath";
}
void tst_QDBusAbstractInterface::callErrorsPeer()
diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
index 13f3bd2060..57d7f82c1f 100644
--- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -928,26 +928,26 @@ void tst_QDBusMarshall::sendCallErrors_data()
<< "Method \"ping\" with signature \"\" on interface \"com.trolltech.autotests.qpong\" doesn't exist\n" << (const char*)0;
QTest::newRow("invalid-service") << "this isn't valid" << objectPath << interfaceName << "ping" << QVariantList()
- << "com.trolltech.QtDBus.Error.InvalidService"
+ << "org.qtproject.QtDBus.Error.InvalidService"
<< "Invalid service name: this isn't valid" << "";
QTest::newRow("empty-path") << serviceName << "" << interfaceName << "ping" << QVariantList()
- << "com.trolltech.QtDBus.Error.InvalidObjectPath"
+ << "org.qtproject.QtDBus.Error.InvalidObjectPath"
<< "Object path cannot be empty" << "";
QTest::newRow("invalid-path") << serviceName << "//" << interfaceName << "ping" << QVariantList()
- << "com.trolltech.QtDBus.Error.InvalidObjectPath"
+ << "org.qtproject.QtDBus.Error.InvalidObjectPath"
<< "Invalid object path: //" << "";
// empty interfaces are valid
QTest::newRow("invalid-interface") << serviceName << objectPath << "this isn't valid" << "ping" << QVariantList()
- << "com.trolltech.QtDBus.Error.InvalidInterface"
+ << "org.qtproject.QtDBus.Error.InvalidInterface"
<< "Invalid interface class: this isn't valid" << "";
QTest::newRow("empty-method") << serviceName << objectPath << interfaceName << "" << QVariantList()
- << "com.trolltech.QtDBus.Error.InvalidMember"
+ << "org.qtproject.QtDBus.Error.InvalidMember"
<< "method name cannot be empty" << "";
QTest::newRow("invalid-method") << serviceName << objectPath << interfaceName << "this isn't valid" << QVariantList()
- << "com.trolltech.QtDBus.Error.InvalidMember"
+ << "org.qtproject.QtDBus.Error.InvalidMember"
<< "Invalid method name: this isn't valid" << "";
QTest::newRow("invalid-variant1") << serviceName << objectPath << interfaceName << "ping"