Revert "Fix Compile Warnings (#5963)"

This reverts commit b83e16dbdd.

Found regressions like auto orientation didn't work anymore after this change, revert it
This commit is contained in:
SoftFever 2024-08-12 00:00:20 +08:00
parent 0286c36f42
commit 7082e945b1
184 changed files with 1091 additions and 461 deletions

View file

@ -893,13 +893,13 @@ bool GuideFrame::apply_config(AppConfig *app_config, PresetBundle *preset_bundle
}
std::string first_added_filament;
/*auto get_first_added_material_preset = [this, app_config](const std::string& section_name, std::string& first_added_preset) {
auto get_first_added_material_preset = [this, app_config](const std::string& section_name, std::string& first_added_preset) {
if (m_appconfig_new.has_section(section_name)) {
// get first of new added preset names
const std::map<std::string, std::string>& old_presets = app_config->has_section(section_name) ? app_config->get_section(section_name) : std::map<std::string, std::string>();
first_added_preset = get_first_added_preset(old_presets, m_appconfig_new.get_section(section_name));
}
};*/
};
// Not switch filament
//get_first_added_material_preset(AppConfig::SECTION_FILAMENTS, first_added_filament);
@ -960,6 +960,7 @@ bool GuideFrame::run()
BOOST_LOG_TRIVIAL(info) << "GuideFrame cancelled";
if (app.preset_bundle->printers.only_default_printers()) {
//we install the default here
bool apply_keeped_changes = false;
//clear filament section and use default materials
app.app_config->set_variant(PresetBundle::BBL_BUNDLE,
PresetBundle::BBL_DEFAULT_PRINTER_MODEL, PresetBundle::BBL_DEFAULT_PRINTER_VARIANT, "true");
@ -1139,7 +1140,7 @@ int GuideFrame::LoadProfile()
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
strVendor = strVendor.AfterLast( '\\');
strVendor = strVendor.AfterLast('/');
strVendor = strVendor.AfterLast('\/');
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
if (w2s(strVendor) == PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json") == 0)
@ -1158,7 +1159,7 @@ int GuideFrame::LoadProfile()
//cout << iter->path().string() << endl;
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
strVendor = strVendor.AfterLast( '\\');
strVendor = strVendor.AfterLast('/');
strVendor = strVendor.AfterLast('\/');
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
if (w2s(strVendor) != PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json")==0)
@ -1543,6 +1544,9 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Vendor: " << strVendor <<", tFilaList Add: " << s1;
}
int nFalse = 0;
int nModel = 0;
int nFinish = 0;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% filaments") % nsize;
for (int n = 0; n < nsize; n++) {
json OneFF = pFilament.at(n);
@ -1652,7 +1656,7 @@ std::string GuideFrame::w2s(wxString sSrc)
void GuideFrame::GetStardardFilePath(std::string &FilePath) {
StrReplace(FilePath, "\\", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
StrReplace(FilePath, "/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
StrReplace(FilePath, "\/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
}
bool GuideFrame::LoadFile(std::string jPath, std::string &sContent)