mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 05:35:59 +08:00
Fixed couple of compiler warnings
This commit is contained in:
parent
4eb408fe4e
commit
c16f2f1c1e
@ -24,7 +24,7 @@ void read_file(const char* input_file, pt::ptree& tree)
|
||||
try {
|
||||
pt::read_xml(ifs, tree);
|
||||
}
|
||||
catch (const boost::property_tree::xml_parser::xml_parser_error& err) {
|
||||
catch (const boost::property_tree::xml_parser::xml_parser_error&) {
|
||||
throw Slic3r::RuntimeError("Failed reading PrintRequest file. File format is corrupt.");
|
||||
}
|
||||
}
|
||||
|
@ -2703,7 +2703,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->category = L("Layers and Perimeters");
|
||||
def->tooltip = L("Maximal length of any scarf joint segment.");
|
||||
def->sidetext = L("mm");
|
||||
def->min = 0.15;
|
||||
def->min = 0.15f;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(1.0));
|
||||
|
||||
|
@ -295,7 +295,7 @@ void DSForLayers::draw_ruler(const ImRect& slideable_region)
|
||||
const float tick_width = float(int(1.0f * m_scale +0.5f));
|
||||
const float label_height = m_imgui->GetTextureCustomRect(ImGui::PausePrint)->Height;
|
||||
|
||||
const ImU32 tick_clr = IM_COL32(255, 255, 255, 255);
|
||||
constexpr ImU32 tick_clr = IM_COL32(255, 255, 255, 255);
|
||||
|
||||
const float x_center = slideable_region.GetCenter().x;
|
||||
|
||||
@ -328,7 +328,7 @@ void DSForLayers::draw_ruler(const ImRect& slideable_region)
|
||||
ImGui::RenderText(start, label.c_str());
|
||||
};
|
||||
|
||||
auto draw_tick = [tick_clr, x_center, tick_width, inner_x](const float tick_pos, const float outer_x)
|
||||
auto draw_tick = [x_center, tick_width, inner_x](const float tick_pos, const float outer_x)
|
||||
{
|
||||
ImRect tick_right = ImRect(x_center + inner_x, tick_pos - tick_width, x_center + outer_x, tick_pos);
|
||||
ImGui::RenderFrame(tick_right.Min, tick_right.Max, tick_clr, false);
|
||||
|
@ -857,7 +857,7 @@ void GUI_App::post_init()
|
||||
CallAfter([this] {
|
||||
// preset_updater->sync downloads profile updates and than via event checks updates and incompatible presets. We need to run it on startup.
|
||||
// start before cw so it is canceled by cw if needed?
|
||||
this->preset_updater->sync(preset_bundle, this, std::move(plater()->get_preset_archive_database()->get_selected_archive_repositories()));
|
||||
this->preset_updater->sync(preset_bundle, this, plater()->get_preset_archive_database()->get_selected_archive_repositories());
|
||||
bool cw_showed = this->config_wizard_startup();
|
||||
if (! cw_showed) {
|
||||
// The CallAfter is needed as well, without it, GL extensions did not show.
|
||||
|
@ -2710,9 +2710,10 @@ void GLGizmoEmboss::draw_advanced()
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifdef SHOW_FONT_FILE_PROPERTY
|
||||
FontProp &font_prop = m_style_manager.get_font_prop();
|
||||
const FontFile::Info &font_info = get_font_info(*ff.font_file, font_prop);
|
||||
#ifdef SHOW_FONT_FILE_PROPERTY
|
||||
ImGui::SameLine();
|
||||
int cache_size = ff.has_value()? (int)ff.cache->size() : 0;
|
||||
std::string ff_property =
|
||||
|
@ -604,7 +604,6 @@ bool ImGuiControl::draw_slider( int* higher_pos, int* lower_pos,
|
||||
const ImRect& slideable_region = m_selection == ssHigher ? m_regions.higher_slideable_region : m_regions.lower_slideable_region;
|
||||
const ImRect& active_thumb = m_selection == ssHigher ? m_regions.higher_thumb : m_regions.lower_thumb;
|
||||
|
||||
bool show_move_label = false;
|
||||
ImRect mouse_pos_rc = active_thumb;
|
||||
|
||||
std::string move_label = "";
|
||||
@ -617,7 +616,6 @@ bool ImGuiControl::draw_slider( int* higher_pos, int* lower_pos,
|
||||
sl_region.Max.x += m_draw_opts.dummy_sz().x;
|
||||
behavior(id, sl_region, m_min_pos, m_max_pos,
|
||||
&m_mouse_pos, &mouse_pos_rc, m_flags, true);
|
||||
show_move_label = true;
|
||||
move_label = get_label_on_move(m_mouse_pos);
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ void delete_path_recursive(const fs::path& path)
|
||||
fs::remove(path);
|
||||
}
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
catch (const std::exception&) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Failed to delete files at: " << path;
|
||||
}
|
||||
}
|
||||
@ -154,25 +154,6 @@ bool extract_local_archive_repository( ArchiveRepository::RepositoryManifest& ma
|
||||
return true;
|
||||
}
|
||||
|
||||
void deserialize_string(const std::string& opt, std::vector<std::string>& result)
|
||||
{
|
||||
std::string val;
|
||||
for (size_t i = 0; i < opt.length(); i++) {
|
||||
if (std::isspace(opt[i])) {
|
||||
continue;
|
||||
}
|
||||
if (opt[i] != ';') {
|
||||
val += opt[i];
|
||||
}
|
||||
else {
|
||||
result.emplace_back(std::move(val));
|
||||
}
|
||||
}
|
||||
if (!val.empty()) {
|
||||
result.emplace_back(std::move(val));
|
||||
}
|
||||
}
|
||||
|
||||
std::string escape_string(const std::string& unescaped)
|
||||
{
|
||||
std::string ret_val;
|
||||
@ -326,7 +307,6 @@ void LocalArchiveRepository::do_extract()
|
||||
//-------------------------------------PresetArchiveDatabase-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
PresetArchiveDatabase::PresetArchiveDatabase(AppConfig* app_config, wxEvtHandler* evt_handler)
|
||||
: p_evt_handler(evt_handler)
|
||||
{
|
||||
//
|
||||
boost::system::error_code ec;
|
||||
@ -382,7 +362,7 @@ bool PresetArchiveDatabase::set_selected_repositories(const std::vector<std::str
|
||||
bool PresetArchiveDatabase::extract_archives_with_check(std::string &msg)
|
||||
{
|
||||
extract_local_archives();
|
||||
for (const std::pair<std::string, bool>& pair : m_selected_repositories_uuid) {
|
||||
for (const std::pair<const std::string, bool>& pair : m_selected_repositories_uuid) {
|
||||
if (!pair.second) {
|
||||
continue;
|
||||
}
|
||||
|
@ -172,7 +172,6 @@ private:
|
||||
void consolidate_uuid_maps();
|
||||
void extract_local_archives();
|
||||
std::string get_next_uuid();
|
||||
wxEvtHandler* p_evt_handler;
|
||||
boost::filesystem::path m_unq_tmp_path;
|
||||
PrivateArchiveRepositoryVector m_archive_repositories;
|
||||
std::map<std::string, bool> m_selected_repositories_uuid;
|
||||
|
@ -96,7 +96,6 @@ private:
|
||||
bool m_remember_session { true }; // if default is true, on every login Remember me will be checked.
|
||||
|
||||
wxTimer* m_token_timer;
|
||||
wxEvtHandler* m_timer_evt_handler;
|
||||
std::time_t m_next_token_refresh_at{0};
|
||||
|
||||
void wakeup_session_thread();
|
||||
|
@ -26,7 +26,7 @@ std::string parse_tree_for_param(const pt::ptree& tree, const std::string& param
|
||||
return {};
|
||||
}
|
||||
|
||||
void parse_tree_for_param_vector(
|
||||
/*void parse_tree_for_param_vector(
|
||||
const pt::ptree &tree, const std::string& param, std::vector<std::string>& results) {
|
||||
for (const auto §ion : tree) {
|
||||
if (section.first == param) {
|
||||
@ -35,7 +35,7 @@ const pt::ptree &tree, const std::string& param, std::vector<std::string>& resul
|
||||
parse_tree_for_param_vector(section.second, param, results);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
pt::ptree parse_tree_for_subtree(const pt::ptree& tree, const std::string& param) {
|
||||
for (const auto §ion : tree) {
|
||||
@ -324,7 +324,6 @@ std::string get_print_data_from_json(const std::string& json, const std::string&
|
||||
size_t end_of_sub = json.find('}', end_of_filename_data);
|
||||
if (end_of_sub == std::string::npos)
|
||||
return {};
|
||||
size_t size = json.size();
|
||||
std::string result = json.substr(start_of_sub, start_of_filename_data - start_of_sub + 1);
|
||||
result += "%1%";
|
||||
result += json.substr(end_of_filename_data, end_of_sub - end_of_filename_data);
|
||||
|
@ -74,7 +74,7 @@ void copy_file_fix(const fs::path &source, const fs::path &target)
|
||||
static constexpr const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read;
|
||||
fs::permissions(target, perms);
|
||||
}
|
||||
std::string escape_string_url(const std::string& unescaped)
|
||||
/*std::string escape_string_url(const std::string& unescaped)
|
||||
{
|
||||
std::string ret_val;
|
||||
CURL* curl = curl_easy_init();
|
||||
@ -87,7 +87,7 @@ std::string escape_string_url(const std::string& unescaped)
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
wxDEFINE_EVENT(EVT_CONFIG_UPDATER_SYNC_DONE, wxCommandEvent);
|
||||
|
@ -21,7 +21,7 @@ namespace pt = boost::property_tree;
|
||||
namespace Slic3r {
|
||||
namespace
|
||||
{
|
||||
std::string escape_string(const std::string& unescaped)
|
||||
/*std::string escape_string(const std::string& unescaped)
|
||||
{
|
||||
std::string ret_val;
|
||||
CURL* curl = curl_easy_init();
|
||||
@ -45,7 +45,7 @@ std::string escape_path_by_element(const boost::filesystem::path& path)
|
||||
parent = parent.parent_path();
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
}*/
|
||||
|
||||
boost::optional<std::string> get_error_message_from_response_body(const std::string& body)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user