From 3d22c1ed4ea89b214b3a787cabf1dc0a35fea998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sun, 10 Mar 2019 09:07:02 +0100 Subject: [PATCH] Fix dumb things that aren't necessarily lethal but are eyesores --- src/client/Client.cpp | 21 +++++++++++---------- src/gui/preview/PreviewModel.cpp | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/client/Client.cpp b/src/client/Client.cpp index ec6ae7dd8..80de2cd10 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -732,7 +732,7 @@ bool Client::CheckUpdate(http::Request *updateRequest, bool checkSession) } else if(data.size()) { - std::istringstream dataStream(data.c_str()); + std::istringstream dataStream(data); try { @@ -912,14 +912,6 @@ void Client::WritePrefs() } void Client::Shutdown() -{ - http::RequestManager::Ref().Shutdown(); - - //Save config - WritePrefs(); -} - -Client::~Client() { if (versionCheckRequest) { @@ -929,6 +921,15 @@ Client::~Client() { alternateVersionCheckRequest->Cancel(); } + + http::RequestManager::Ref().Shutdown(); + + //Save config + WritePrefs(); +} + +Client::~Client() +{ } @@ -1254,7 +1255,7 @@ LoginStatus Client::Login(ByteString username, ByteString password, User & user) { try { - std::istringstream dataStream(data.c_str()); + std::istringstream dataStream(data); Json::Value objDocument; dataStream >> objDocument; diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp index 2537f0a54..8485ab0dc 100644 --- a/src/gui/preview/PreviewModel.cpp +++ b/src/gui/preview/PreviewModel.cpp @@ -199,7 +199,7 @@ bool PreviewModel::ParseSaveInfo(ByteString &saveInfoResponse) try { - std::istringstream dataStream(saveInfoResponse.c_str()); + std::istringstream dataStream(saveInfoResponse); Json::Value objDocument; dataStream >> objDocument; @@ -257,7 +257,7 @@ bool PreviewModel::ParseComments(ByteString &commentsResponse) saveComments = new std::vector(); try { - std::istringstream dataStream(commentsResponse.c_str()); + std::istringstream dataStream(commentsResponse); Json::Value commentsArray; dataStream >> commentsArray;