From fd5b84b6ebaa51a981ca976f665109fad0f37539 Mon Sep 17 00:00:00 2001 From: kasenvr <52365539+kasenvr@users.noreply.github.com> Date: Wed, 16 Sep 2020 19:57:58 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: David Rowe --- libraries/networking/src/AccountManager.cpp | 6 +++--- libraries/networking/src/MetaverseAPI.cpp | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 916e8aa01c..9e4cb01e45 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -695,7 +695,7 @@ void AccountManager::setAccessTokens(const QString& response) { } else { // clear the path from the response URL so we have the right root URL for this access token QUrl rootURL = rootObject.contains("url") ? rootObject["url"].toString() : _authURL; - rootURL.setPath(getMetaverseServerURLPath() + ""); + rootURL.setPath(getMetaverseServerURLPath()); qCDebug(networking) << "Storing an account with access-token for" << qPrintable(rootURL.toString()); @@ -730,7 +730,7 @@ void AccountManager::requestAccessTokenFinished() { } else { // clear the path from the response URL so we have the right root URL for this access token QUrl rootURL = requestReply->url(); - rootURL.setPath(getMetaverseServerURLPath() + ""); + rootURL.setPath(getMetaverseServerURLPath()); qCDebug(networking) << "Storing an account with access-token for" << qPrintable(rootURL.toString()); @@ -766,7 +766,7 @@ void AccountManager::refreshAccessTokenFinished() { } else { // clear the path from the response URL so we have the right root URL for this access token QUrl rootURL = requestReply->url(); - rootURL.setPath(getMetaverseServerURLPath() + ""); + rootURL.setPath(getMetaverseServerURLPath()); qCDebug(networking) << "Storing an account with a refreshed access-token for" << qPrintable(rootURL.toString()); diff --git a/libraries/networking/src/MetaverseAPI.cpp b/libraries/networking/src/MetaverseAPI.cpp index 068baed931..290267d96d 100644 --- a/libraries/networking/src/MetaverseAPI.cpp +++ b/libraries/networking/src/MetaverseAPI.cpp @@ -39,11 +39,7 @@ namespace MetaverseAPI { QString getCurrentMetaverseServerURLPath(bool appendForwardSlash){ QString path = getCurrentMetaverseServerURL().path(); - if (path.isEmpty()) { - return path; - } - - if (appendForwardSlash) { + if (!path.isEmpty() && appendForwardSlash) { path.append("/"); }