浏览代码

Added possibility to set network proxy for the XNAT connection

Andreas Fetzer 9 年之前
父节点
当前提交
1a12299713
共有 2 个文件被更改,包括 19 次插入0 次删除
  1. 9 0
      Libs/XNAT/Core/ctkXnatSession.cpp
  2. 10 0
      Libs/XNAT/Core/ctkXnatSession.h

+ 9 - 0
Libs/XNAT/Core/ctkXnatSession.cpp

@@ -44,6 +44,7 @@
 #include <QStringBuilder>
 #include <QNetworkCookie>
 
+
 #include <ctkXnatAPI_p.h>
 #include <qRestResult.h>
 
@@ -735,3 +736,11 @@ void ctkXnatSession::emitTimeOut()
     emit timedOut();
   }
 }
+
+//----------------------------------------------------------------------------
+void ctkXnatSession::setHttpNetworkProxy(const QNetworkProxy& proxy)
+{
+  Q_D(ctkXnatSession);
+
+  d->xnat->setHttpNetworkProxy(proxy);
+}

+ 10 - 0
Libs/XNAT/Core/ctkXnatSession.h

@@ -32,6 +32,7 @@
 #include <QUuid>
 
 class QDateTime;
+class QNetworkProxy;
 
 class ctkXnatSessionPrivate;
 
@@ -160,6 +161,15 @@ public:
   void setDefaultDownloadDir(const QString& path);
 
   /**
+    * @brief Sets a network proxy that will be used to connect with XNAT
+    *
+    * Tells the qRestAPI to use a network proxy for the connection to XNAT
+    *
+    * @param proxy the network proxy that will be set
+    */
+  void setHttpNetworkProxy(const QNetworkProxy& proxy);
+
+  /**
     * @brief returns the default download location
     * @return the default download directory as string
     */