Stop Exporting Names Through Usings in GUI and Voronoi Headers (#16223)

Each of these headers put a using or namespace alias at global or
namespace scope, which every includer inherited:

- BBLTopbar.hpp: "using namespace Slic3r::GUI;" at global scope, reached
  through MainFrame.hpp. Seven source files used GUI names unqualified
  outside the namespace because of it, one of them as "::RadioBox".
- IMSlider.hpp and TickCode.hpp: "using namespace CustomGCode;" inside
  Slic3r.
- ProjectTask.hpp, Jobs/PrintJob.hpp and ConfigWizard_private.hpp:
  "namespace fs = boost::filesystem;". PresetBundle.cpp and GUI_App.cpp
  had no alias of their own.
- VoronoiUtils.hpp: "using VD = Slic3r::Geometry::VoronoiDiagram;" at
  global scope.

The headers now spell the names out. Source files that used them get
the qualifier, or a using of their own where there are many uses.
This commit is contained in:
HanifKoh
2026-10-07 14:22:45 +08:00
committed by GitHub
parent 23546e71ce
commit f02292f163
24 changed files with 81 additions and 81 deletions
+8 -9
View File
@@ -7,7 +7,6 @@
#include <vector>
namespace Slic3r {
using namespace CustomGCode;
namespace GUI {
struct TickCode
@@ -16,7 +15,7 @@ struct TickCode
bool operator>(const TickCode& other) const { return other.tick < this->tick; }
int tick = 0;
Type type = ColorChange;
CustomGCode::Type type = CustomGCode::ColorChange;
int extruder = 0;
std::string color;
std::string extra;
@@ -31,22 +30,22 @@ class TickCodeInfo
std::vector<std::string>* m_colors{ nullptr };// reference to IMSlider::m_extruder_colors
std::string get_color_for_tick(TickCode tick, Type type, const int extruder);
std::string get_color_for_tick(TickCode tick, CustomGCode::Type type, const int extruder);
public:
std::set<TickCode> ticks{};
Mode mode = Undef;
CustomGCode::Mode mode = CustomGCode::Undef;
bool empty() const { return ticks.empty(); }
void set_pause_print_msg(const std::string& message) { pause_print_msg = message; }
bool add_tick(const int tick, Type type, int extruder, double print_z);
bool add_tick(const int tick, CustomGCode::Type type, int extruder, double print_z);
bool edit_tick(std::set<TickCode>::iterator it, double print_z);
void switch_code(Type type_from, Type type_to);
bool switch_code_for_tick(std::set<TickCode>::iterator it, Type type_to, const int extruder);
void erase_all_ticks_with_code(Type type);
void switch_code(CustomGCode::Type type_from, CustomGCode::Type type_to);
bool switch_code_for_tick(std::set<TickCode>::iterator it, CustomGCode::Type type_to, const int extruder);
void erase_all_ticks_with_code(CustomGCode::Type type);
bool has_tick_with_code(Type type);
bool has_tick_with_code(CustomGCode::Type type);
bool has_tick(int tick);
void suppress_plus(bool suppress) { m_suppress_plus = suppress; }