Clang tidy/format fixes for color_palette_fallback_warning

This commit is contained in:
AdenKoperczak 2025-02-28 15:49:56 -05:00
parent 8be9cc72de
commit dc3258d149

View file

@ -1865,20 +1865,18 @@ void MapWidgetImpl::RadarProductManagerDisconnect()
void MapWidgetImpl::InitializeNewRadarProductView(
const std::string& colorPalette)
{
boost::asio::post(threadPool_,
boost::asio::post(
threadPool_,
[colorPalette, this]()
{
try
{
auto radarProductView =
context_->radar_product_view();
auto radarProductView = context_->radar_product_view();
auto& paletteSetting =
settings::PaletteSettings::Instance().palette(
colorPalette);
settings::PaletteSettings::Instance().palette(colorPalette);
std::string colorTableFile =
paletteSetting.GetValue();
std::string colorTableFile = paletteSetting.GetValue();
if (colorTableFile.empty())
{
colorTableFile = paletteSetting.GetDefault();
@ -1888,22 +1886,17 @@ void MapWidgetImpl::InitializeNewRadarProductView(
util::OpenFile(colorTableFile);
if (colorTableStream->fail())
{
logger_->warn("Could not open color table {}",
colorTableFile);
colorTableStream =
util::OpenFile(paletteSetting.GetDefault());
logger_->warn("Could not open color table {}", colorTableFile);
colorTableStream = util::OpenFile(paletteSetting.GetDefault());
}
std::shared_ptr<common::ColorTable> colorTable =
common::ColorTable::Load(*colorTableStream);
if (!colorTable->IsValid())
{
logger_->warn("Could not load color table {}",
colorTableFile);
colorTableStream =
util::OpenFile(paletteSetting.GetDefault());
colorTable =
common::ColorTable::Load(*colorTableStream);
logger_->warn("Could not load color table {}", colorTableFile);
colorTableStream = util::OpenFile(paletteSetting.GetDefault());
colorTable = common::ColorTable::Load(*colorTableStream);
}
radarProductView->LoadColorTable(colorTable);