aboutsummaryrefslogtreecommitdiff
path: root/lib/converters.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-28 18:57:29 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-28 18:57:29 +0900
commit941cfdf8b591bf14002f28e99e06c200dc5bcc84 (patch)
tree6c02e8817b02a8e1fffeb70d30013565c7ae856f /lib/converters.h
parent53521f42d15d2553028bae09f1cd12206bc32955 (diff)
downloadlibquotient-941cfdf8b591bf14002f28e99e06c200dc5bcc84.tar.gz
libquotient-941cfdf8b591bf14002f28e99e06c200dc5bcc84.zip
csapi/third_party_lookup.*: Properly pass a variadic (aka exploded) parameters
Most of the actual change was in the API definition files (thanks to @anoadragon453), plus a converter from a QJsonObject map to the URL query string.
Diffstat (limited to 'lib/converters.h')
-rw-r--r--lib/converters.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/converters.h b/lib/converters.h
index 1a8f3cfa..1e828393 100644
--- a/lib/converters.h
+++ b/lib/converters.h
@@ -331,6 +331,12 @@ namespace QMatrixClient
q.addQueryItem(k, v);
}
+ inline void addTo(QUrlQuery& q, const QString&, const QJsonObject& vals)
+ {
+ for (auto it = vals.begin(); it != vals.end(); ++it)
+ q.addQueryItem(it.key(), it.value().toString());
+ }
+
// This one is for types that don't have isEmpty()
template <typename ValT, bool Force = true, typename = bool>
struct AddNode