summaryrefslogtreecommitdiffstats
path: root/tqdbusdatalist.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-11-18 21:21:15 +0100
committerSlávek Banko <slavek.banko@axis.cz>2013-11-18 21:21:15 +0100
commit9a134f5699708c76d4abd12da71c9df03830556a (patch)
treeb44367da3f90252d7d9dffd12c71e1160174bd11 /tqdbusdatalist.cpp
parent52933e3b969e8b44f6a94db486cb27ddf5c322d7 (diff)
downloaddbus-1-tqt-9a134f5699708c76d4abd12da71c9df03830556a.tar.gz
dbus-1-tqt-9a134f5699708c76d4abd12da71c9df03830556a.zip
Add support for data type UnixFD
Diffstat (limited to 'tqdbusdatalist.cpp')
-rw-r--r--tqdbusdatalist.cpp38
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)