org.freedesktop.DBus.Error.InvalidSignature
org.freedesktop.DBus.Error.UnknownInterface
org.freedesktop.DBus.Error.UnknownObject
+org.freedesktop.DBus.Error.UnknownProperty
+org.freedesktop.DBus.Error.PropertyReadOnly
org.qtproject.QtDBus.Error.InternalError
org.qtproject.QtDBus.Error.InvalidService
org.qtproject.QtDBus.Error.InvalidObjectPath
"org.freedesktop.DBus.Error.InvalidSignature\0"
"org.freedesktop.DBus.Error.UnknownInterface\0"
"org.freedesktop.DBus.Error.UnknownObject\0"
+ "org.freedesktop.DBus.Error.UnknownProperty\0"
+ "org.freedesktop.DBus.Error.PropertyReadOnly\0"
"org.qtproject.QtDBus.Error.InternalError\0"
"org.qtproject.QtDBus.Error.InvalidService\0"
"org.qtproject.QtDBus.Error.InvalidObjectPath\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, -1
+ 581, 617, 661, 705, 746, 789, 833, 874,
+ 916, 961, 1005, -1
};
static const int errorMessages_count = sizeof errorMessages_indices /
(\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 UnknownProperty The property does not exist in this interface
+ (\c org.freedesktop.DBus.Error.UnknownProperty)
+ \value PropertyReadOnly The property set failed because the property is read-only
+ (\c org.freedesktop.DBus.Error.PropertyReadOnly)
\value InternalError An internal error occurred
static inline QDBusMessage
propertyNotFoundError(const QDBusMessage &msg, const QString &interface_name, const QByteArray &property_name)
{
- return msg.createErrorReply(QDBusError::InvalidArgs,
+ return msg.createErrorReply(QDBusError::UnknownProperty,
QString::fromLatin1("Property %1%2%3 was not found in object %4")
.arg(interface_name,
QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
PropertyWriteSuccess = 0,
PropertyNotFound,
PropertyTypeMismatch,
+ PropertyReadOnly,
PropertyWriteFailed
};
.arg(interface_name,
QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
QString::fromLatin1(property_name)));
+ case PropertyReadOnly:
+ return msg.createErrorReply(QDBusError::PropertyReadOnly,
+ QString::fromLatin1("Property %1%2%3 is read-only")
+ .arg(interface_name,
+ QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
+ QString::fromLatin1(property_name)));
case PropertyWriteFailed:
return msg.createErrorReply(QDBusError::InternalError,
QString::fromLatin1("Internal error"));
QMetaProperty mp = mo->property(pidx);
+ // check if this property is writable
+ if (!mp.isWritable())
+ return PropertyReadOnly;
+
// check if this property is exported
bool isScriptable = mp.isScriptable();
if (!(propFlags & QDBusConnection::ExportScriptableProperties) && isScriptable)