From 266376639ddbac9f03b02370424c57f71b9a3dfd Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Fri, 5 Jun 2009 15:05:39 +0000 Subject: [PATCH] Expose the addRedirection method. svn path=/branches/work/~ervin/qtjolie/; revision=977871 --- private/qtjolie-branch/qtjolie/metaservice.cpp | 15 +++++++++++++++ private/qtjolie-branch/qtjolie/metaservice.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/private/qtjolie-branch/qtjolie/metaservice.cpp b/private/qtjolie-branch/qtjolie/metaservice.cpp index 90bd8b853..856dbc099 100644 --- a/private/qtjolie-branch/qtjolie/metaservice.cpp +++ b/private/qtjolie-branch/qtjolie/metaservice.cpp @@ -104,3 +104,18 @@ void MetaService::unloadService(const QString &name) client.call(message); } + +QString Jolie::MetaService::addRedirection(const QString &name, const QString &url, const QString &inProtocol, const QString &outProtocol) +{ + Client client(QString::fromUtf8("localhost"), 9000); + Message message("/", "addRedirection"); + Value value; + value.children("resourcePrefix") << Value(name.toUtf8()); + value.children("location") << Value(url.toUtf8()); + value.children("protocol") << Value(inProtocol.toUtf8()); + value.children("exposedProtocol") << Value(outProtocol.toUtf8()); + message.setData(value); + + Message reply = client.call(message); + return QString::fromUtf8(reply.data().toByteArray()); +} diff --git a/private/qtjolie-branch/qtjolie/metaservice.h b/private/qtjolie-branch/qtjolie/metaservice.h index 723c0f3b0..70b14b2ac 100644 --- a/private/qtjolie-branch/qtjolie/metaservice.h +++ b/private/qtjolie-branch/qtjolie/metaservice.h @@ -42,6 +42,8 @@ public: QStringList loadedServices() const; void unloadService(const QString &name); + QString addRedirection(const QString &name, const QString &url, const QString &inProtocol, const QString &outProtocol); + private: MetaServicePrivate * const d; };