QDBusMarshaller *beginCommon(int code, const char *signature);
QDBusMarshaller *endCommon();
void open(QDBusMarshaller &sub, int code, const char *signature);
- void close();
void error(const QString &message);
bool appendVariantInternal(const QVariant &arg);
QDBusMarshaller::~QDBusMarshaller()
{
- close();
+ if (ba) {
+ if (closeCode)
+ *ba += closeCode;
+ } else if (parent) {
+ dbus_message_iter_close_container(&parent->iterator, &iterator);
+ }
}
inline QString QDBusMarshaller::currentSignature()
QDBusMarshaller sub(capabilities);
open(sub, DBUS_TYPE_VARIANT, signature);
- bool isOk = sub.appendVariantInternal(value);
- // don't call sub.close(): it auto-closes
-
- return isOk;
+ return sub.appendVariantInternal(value);
}
inline void QDBusMarshaller::append(const QStringList &arg)
QStringList::ConstIterator end = arg.constEnd();
for ( ; it != end; ++it)
sub.append(*it);
- // don't call sub.close(): it auto-closes
}
inline QDBusMarshaller *QDBusMarshaller::beginStructure()
return retval;
}
-void QDBusMarshaller::close()
-{
- if (ba) {
- if (closeCode)
- *ba += closeCode;
- } else if (parent) {
- dbus_message_iter_close_container(&parent->iterator, &iterator);
- }
-}
-
void QDBusMarshaller::error(const QString &msg)
{
ok = false;