Apply suggestions from code review

Co-authored-by: David Rowe <david@ctrlaltstudio.com>
This commit is contained in:
kasenvr 2020-09-16 19:57:58 -04:00 committed by GitHub
parent 3610446150
commit fd5b84b6eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

@ -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());

View file

@ -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("/");
}