Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove xnat server version from session #885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions Libs/XNAT/Core/ctkXnatSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ static const char* HEADER_AUTHORIZATION = "Authorization";
static const char* HEADER_USER_AGENT = "User-Agent";
static const char* HEADER_COOKIE = "Cookie";

static QString SERVER_VERSION = "version";
static QString SESSION_EXPIRATION_DATE = "expires";

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -90,7 +89,6 @@ class ctkXnatSessionPrivate
void createConnections();
void setDefaultHttpHeaders();
void checkSession() const;
void setSessionProperties();
QDateTime updateExpirationDate(qRestResult* restResult);

void close();
Expand Down Expand Up @@ -185,27 +183,6 @@ void ctkXnatSessionPrivate::checkSession() const
}
}

//----------------------------------------------------------------------------
void ctkXnatSessionPrivate::setSessionProperties()
{
sessionProperties.clear();
QUuid uuid = xnat->get("/data/version");
QScopedPointer<qRestResult> restResult(xnat->takeResult(uuid));
if (restResult)
{
QString version = restResult->result()["content"].toString();
if (version.isEmpty())
{
throw ctkXnatProtocolFailureException("No version information available.");
}
sessionProperties[SERVER_VERSION] = version;
}
else
{
this->throwXnatException("Retrieving session properties failed.");
}
}

//----------------------------------------------------------------------------
QDateTime ctkXnatSessionPrivate::updateExpirationDate(qRestResult* restResult)
{
Expand Down Expand Up @@ -386,7 +363,6 @@ void ctkXnatSession::open()
QString sessionId = restResult->result()["content"].toString();
d->sessionId = sessionId;
d->setDefaultHttpHeaders();
d->setSessionProperties();
d->updateExpirationDate(restResult.data());
}
else
Expand Down Expand Up @@ -417,19 +393,6 @@ bool ctkXnatSession::isOpen() const
return !d->sessionId.isEmpty();
}

//----------------------------------------------------------------------------
QString ctkXnatSession::version() const
{
Q_D(const ctkXnatSession);
if (d->sessionProperties.contains(SERVER_VERSION))
{
return d->sessionProperties[SERVER_VERSION];
}
else
{
return QString::null;
}
}

//----------------------------------------------------------------------------
QDateTime ctkXnatSession::expirationDate() const
Expand Down