mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 10:50:38 +02:00
trying to solve unittest crash ( adding more checks )
fixed cppcheck warning
This commit is contained in:
parent
79cebf9130
commit
443a76e50f
@ -26,14 +26,26 @@ void ColnodAPI::downloadData(const Timestamp &time)
|
||||
auto login = requestLogin();
|
||||
connect(login.get(), &serversdk::Request::finished, this, [=](){
|
||||
// Get login token
|
||||
if (!checkRequest(login)) {
|
||||
if (login->status() != 200) {
|
||||
emit downloadDataFinished(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
AuthToken token;
|
||||
token.fromJson(login->responseData());
|
||||
auto responseData = login->responseData();
|
||||
if (responseData.isEmpty()) {
|
||||
qCWarning(colnod) << "empty response data when logging in";
|
||||
emit downloadDataFinished(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
token.fromJson(responseData);
|
||||
authToken = token.id();
|
||||
if (authToken.isEmpty()) {
|
||||
qCCritical(colnod) << "Token uuid is empty";
|
||||
emit downloadDataFinished(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
auto data = std::make_shared<Data>();
|
||||
|
||||
|
||||
@ -43,12 +43,11 @@ struct PreparedData
|
||||
{
|
||||
public:
|
||||
PreparedData() = default;
|
||||
PreparedData(std::shared_ptr<Data> database, std::shared_ptr<Data> colnod)
|
||||
PreparedData(const std::shared_ptr<Data> &database, const std::shared_ptr<Data> &colnod)
|
||||
:databaseData(std::move(database)), colnodData(std::move(colnod))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// TODO: make unique_ptr ( neeed because of ColnodAPI )
|
||||
std::shared_ptr<Data> databaseData;
|
||||
std::shared_ptr<Data> colnodData;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user