diff --git a/common/settings/json_settings.cpp b/common/settings/json_settings.cpp index 8e78dae033..11edc53465 100644 --- a/common/settings/json_settings.cpp +++ b/common/settings/json_settings.cpp @@ -158,7 +158,8 @@ bool JSON_SETTINGS::LoadFromFile( const std::string& aDirectory ) else { wxString dir( aDirectory.c_str(), wxConvUTF8 ); - path.Assign( dir, m_filename, getFileExt() ); + wxString name( m_filename.c_str(), wxConvUTF8 ); + path.Assign( dir, name, getFileExt() ); } if( !path.Exists() ) diff --git a/include/settings/settings_manager.h b/include/settings/settings_manager.h index 59c3849c29..3934d35017 100644 --- a/include/settings/settings_manager.h +++ b/include/settings/settings_manager.h @@ -80,7 +80,8 @@ public: AppSettings* ret = nullptr; auto it = std::find_if( m_settings.begin(), m_settings.end(), - []( const std::unique_ptr& aSettings ) { + []( const std::unique_ptr& aSettings ) + { return dynamic_cast( aSettings.get() ); } ); @@ -105,12 +106,13 @@ public: { std::vector ret; - for( const auto& el : m_color_settings ) - ret.push_back( el.second ); + for( const std::pair& entry : m_color_settings ) + ret.push_back( entry.second ); - std::sort( ret.begin(), ret.end(), []( COLOR_SETTINGS* a, COLOR_SETTINGS* b ) { - return a->GetName() < b->GetName(); - } ); + std::sort( ret.begin(), ret.end(), []( COLOR_SETTINGS* a, COLOR_SETTINGS* b ) + { + return a->GetName() < b->GetName(); + } ); return ret; }