diff options
Diffstat (limited to 'tqdbusdatalist.cpp')
-rw-r--r-- | tqdbusdatalist.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tqdbusdatalist.cpp b/tqdbusdatalist.cpp index ccf9a39..23f60a5 100644 --- a/tqdbusdatalist.cpp +++ b/tqdbusdatalist.cpp @@ -23,6 +23,7 @@ #include "tqdbusdatalist.h" #include "tqdbusobjectpath.h" +#include "tqdbusunixfd.h" #include "tqdbusvariant.h" #include <tqstringlist.h> @@ -281,6 +282,21 @@ TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQT_DBusObjectPath>& other) } } +TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQT_DBusUnixFd>& other) + : d(new Private()) +{ + d->type = TQT_DBusData::UnixFd; + + if (other.isEmpty()) return; + + TQValueList<TQT_DBusUnixFd>::const_iterator it = other.begin(); + TQValueList<TQT_DBusUnixFd>::const_iterator endIt = other.end(); + for (; it != endIt; ++it) + { + d->list << TQT_DBusData::fromUnixFd(*it); + } +} + TQT_DBusDataList::~TQT_DBusDataList() { delete d; @@ -725,6 +741,28 @@ TQValueList<TQT_DBusObjectPath> TQT_DBusDataList::toObjectPathList(bool* ok) con return result; } +TQValueList<TQT_DBusUnixFd> TQT_DBusDataList::toUnixFdList(bool* ok) const +{ + if (d->type != TQT_DBusData::UnixFd) + { + if (ok != 0) *ok = false; + return TQValueList<TQT_DBusUnixFd>(); + } + + TQValueList<TQT_DBusUnixFd> result; + + TQValueList<TQT_DBusData>::const_iterator it = d->list.begin(); + TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end(); + for (; it != endIt; ++it) + { + result << (*it).toUnixFd(); + } + + if (ok != 0) *ok = true; + + return result; +} + TQValueList<TQT_DBusVariant> TQT_DBusDataList::toVariantList(bool* ok) const { if (d->type != TQT_DBusData::Variant) |