|
@@ -37,11 +37,11 @@
|
|
#include "ctkXnatSubject.h"
|
|
#include "ctkXnatSubject.h"
|
|
#include "ctkXnatDefaultSchemaTypes.h"
|
|
#include "ctkXnatDefaultSchemaTypes.h"
|
|
|
|
|
|
|
|
+#include <QDateTime>
|
|
#include <QDebug>
|
|
#include <QDebug>
|
|
#include <QScopedPointer>
|
|
#include <QScopedPointer>
|
|
#include <QStringBuilder>
|
|
#include <QStringBuilder>
|
|
#include <QNetworkCookie>
|
|
#include <QNetworkCookie>
|
|
-#include <QDateTime>
|
|
|
|
|
|
|
|
#include <ctkXnatAPI_p.h>
|
|
#include <ctkXnatAPI_p.h>
|
|
#include <qRestResult.h>
|
|
#include <qRestResult.h>
|
|
@@ -285,6 +285,17 @@ QList<ctkXnatObject*> ctkXnatSessionPrivate::results(qRestResult* restResult, QS
|
|
object->setProperty(it.key().toLatin1().data(), it.value());
|
|
object->setProperty(it.key().toLatin1().data(), it.value());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ QVariant lastModifiedHeader = restResult->rawHeader("Last-Modified");
|
|
|
|
+ QDateTime lastModifiedTime;
|
|
|
|
+ if (lastModifiedHeader.isValid())
|
|
|
|
+ {
|
|
|
|
+ lastModifiedTime = lastModifiedHeader.toDateTime();
|
|
|
|
+ }
|
|
|
|
+ if (lastModifiedTime.isValid())
|
|
|
|
+ {
|
|
|
|
+ object->setLastModifiedTime(lastModifiedTime);
|
|
|
|
+ }
|
|
|
|
+
|
|
results.push_back(object);
|
|
results.push_back(object);
|
|
}
|
|
}
|
|
return results;
|
|
return results;
|
|
@@ -503,6 +514,26 @@ bool ctkXnatSession::exists(const ctkXnatObject* object)
|
|
}
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
|
+const QMap<QByteArray, QByteArray> ctkXnatSession::httpHeadSync(const QUuid &uuid)
|
|
|
|
+{
|
|
|
|
+ Q_D(ctkXnatSession);
|
|
|
|
+ QScopedPointer<qRestResult> result (d->xnat->takeResult(uuid));
|
|
|
|
+ if (result == NULL)
|
|
|
|
+ {
|
|
|
|
+ d->throwXnatException("Sending HEAD request failed.");
|
|
|
|
+ }
|
|
|
|
+ return result->rawHeaders();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
|
+QUuid ctkXnatSession::httpHead(const QString& resourceUri)
|
|
|
|
+{
|
|
|
|
+ Q_D(ctkXnatSession);
|
|
|
|
+ QUuid queryId = d->xnat->head(resourceUri);
|
|
|
|
+ return queryId;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//----------------------------------------------------------------------------
|
|
void ctkXnatSession::save(ctkXnatObject* object)
|
|
void ctkXnatSession::save(ctkXnatObject* object)
|
|
{
|
|
{
|
|
Q_D(ctkXnatSession);
|
|
Q_D(ctkXnatSession);
|