Skip to content

Commit

Permalink
clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
foodprocessor committed Aug 26, 2024
1 parent 4906b2c commit 24610dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/plugin/settings/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void enableLogging(std::string iniDir)
bool Engine::updateModel(Json::object *model, bool mountSuccessful) const
{
NX_PRINT << "cloudfuse Engine::updateModel";

// prepare the new status item
auto statusJson = mountSuccessful ? kStatusSuccess : kStatusFailure;
std::string error;
Expand All @@ -149,13 +149,13 @@ bool Engine::updateModel(Json::object *model, bool mountSuccessful) const
NX_PRINT << "Failed to parse status JSON with error: " << error;
return false;
}

// find where to put it
auto items = (*model)[kItems];
auto itemsArray = items.array_items();
// find the status banner, if it's already present
auto statusBannerIt = std::find_if(itemsArray.begin(), itemsArray.end(),
[](Json &item) { return item[kName].string_value() == kStatusBannerId; });
[](Json &item) { return item[kName].string_value() == kStatusBannerId; });
// if the banner is not there, add it
if (statusBannerIt == itemsArray.end())
{
Expand Down
6 changes: 4 additions & 2 deletions src/plugin/settings/settings_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ static const std::string kStatusBannerId = "connectionStatus";
static const std::string kStatusSuccess = R"json(
{
"type": "Banner",
"name": ")json" + kStatusBannerId + R"json(",
"name": ")json" + kStatusBannerId +
R"json(",
"icon": "info",
"text": "Cloud storage connected successfully!"
}
Expand All @@ -65,7 +66,8 @@ static const std::string kStatusSuccess = R"json(
static const std::string kStatusFailure = R"json(
{
"type": "Banner",
"name": ")json" + kStatusBannerId + R"json(",
"name": ")json" + kStatusBannerId +
R"json(",
"icon": "warning",
"text": "Cloud storage connection failed!"
}
Expand Down

0 comments on commit 24610dc

Please sign in to comment.