Commit ec97b696 authored by Paweł Wegner's avatar Paweł Wegner

cloudbrowser: check if creating provider succeeded.

parent 616bda0d
...@@ -106,11 +106,11 @@ CloudContext::CloudContext(QObject* parent) ...@@ -106,11 +106,11 @@ CloudContext::CloudContext(QObject* parent)
for (auto j : providers) { for (auto j : providers) {
auto obj = j.toMap(); auto obj = j.toMap();
auto label = obj["label"].toString().toStdString(); auto label = obj["label"].toString().toStdString();
user_provider_model_.add( auto provider =
{label, this->provider(obj["type"].toString().toStdString(), label,
this->provider(obj["type"].toString().toStdString(), label, Token{obj["token"].toString().toStdString(),
Token{obj["token"].toString().toStdString(), obj["access_token"].toString().toStdString()});
obj["access_token"].toString().toStdString()})}); if (provider) user_provider_model_.add({label, std::move(provider)});
} }
for (auto p : ICloudStorage::create()->providers()) { for (auto p : ICloudStorage::create()->providers()) {
auth_server_.push_back(http_server_factory_->create( auth_server_.push_back(http_server_factory_->create(
...@@ -130,6 +130,7 @@ CloudContext::CloudContext(QObject* parent) ...@@ -130,6 +130,7 @@ CloudContext::CloudContext(QObject* parent)
CloudContext::~CloudContext() { CloudContext::~CloudContext() {
save(); save();
thread_pool_ = nullptr;
util::log_stream(util::make_unique<std::ostream>(std::cerr.rdbuf())); util::log_stream(util::make_unique<std::ostream>(std::cerr.rdbuf()));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment