From 00ce73dc451955389d5ee80832eebdf484394cdc Mon Sep 17 00:00:00 2001 From: bofdahof <172177156+bofdahof@users.noreply.github.com> Date: Sat, 8 Mar 2025 13:13:38 +1000 Subject: [PATCH 1/6] remove using namespace Base --- src/App/Application.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 00185b3e66..edae6a5961 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -171,7 +171,7 @@ FC_LOG_LEVEL_INIT("App", true, true) using namespace App; -using namespace Base; +//using namespace Base; using namespace std; using namespace boost; using namespace boost::program_options; @@ -406,19 +406,19 @@ void Application::setupPythonException(PyObject* module) return exception; }; - PyExc_FC_GeneralError = setup("FreeCADError", PyExc_RuntimeError); - PyExc_FC_FreeCADAbort = setup("FreeCADAbort", PyExc_BaseException); - PyExc_FC_XMLBaseException = setup("XMLBaseException", PyExc_Exception); - PyExc_FC_XMLParseException = setup("XMLParseException", PyExc_FC_XMLBaseException); - PyExc_FC_XMLAttributeError = setup("XMLAttributeError", PyExc_FC_XMLBaseException); - PyExc_FC_UnknownProgramOption = setup("UnknownProgramOption", PyExc_BaseException); - PyExc_FC_BadFormatError = setup("BadFormatError", PyExc_FC_GeneralError); - PyExc_FC_BadGraphError = setup("BadGraphError", PyExc_FC_GeneralError); - PyExc_FC_ExpressionError = setup("ExpressionError", PyExc_FC_GeneralError); - PyExc_FC_ParserError = setup("ParserError", PyExc_FC_GeneralError); - PyExc_FC_CADKernelError = setup("CADKernelError", PyExc_FC_GeneralError); - PyExc_FC_PropertyError = setup("PropertyError", PyExc_AttributeError); - PyExc_FC_AbortIOException = setup("AbortIOException", PyExc_BaseException); + Base::PyExc_FC_GeneralError = setup("FreeCADError", PyExc_RuntimeError); + Base::PyExc_FC_FreeCADAbort = setup("FreeCADAbort", PyExc_BaseException); + Base::PyExc_FC_XMLBaseException = setup("XMLBaseException", PyExc_Exception); + Base::PyExc_FC_XMLParseException = setup("XMLParseException", Base::PyExc_FC_XMLBaseException); + Base::PyExc_FC_XMLAttributeError = setup("XMLAttributeError", Base::PyExc_FC_XMLBaseException); + Base::PyExc_FC_UnknownProgramOption = setup("UnknownProgramOption", PyExc_BaseException); + Base::PyExc_FC_BadFormatError = setup("BadFormatError", Base::PyExc_FC_GeneralError); + Base::PyExc_FC_BadGraphError = setup("BadGraphError", Base::PyExc_FC_GeneralError); + Base::PyExc_FC_ExpressionError = setup("ExpressionError", Base::PyExc_FC_GeneralError); + Base::PyExc_FC_ParserError = setup("ParserError", Base::PyExc_FC_GeneralError); + Base::PyExc_FC_CADKernelError = setup("CADKernelError", Base::PyExc_FC_GeneralError); + Base::PyExc_FC_PropertyError = setup("PropertyError", PyExc_AttributeError); + Base::PyExc_FC_AbortIOException = setup("AbortIOException", PyExc_BaseException); } //************************************************************************** @@ -434,7 +434,7 @@ void Application::renameDocument(const char *OldName, const char *NewName) Document* Application::newDocument(const char * proposedName, const char * proposedLabel, DocumentInitFlags CreateFlags) { - bool isUsingDefaultName = Tools::isNullOrEmpty(proposedName); + bool isUsingDefaultName = Base::Tools::isNullOrEmpty(proposedName); // get a valid name anyway! if (isUsingDefaultName) { proposedName = "Unnamed"; @@ -451,7 +451,7 @@ Document* Application::newDocument(const char * proposedName, const char * propo // Determine the document's Label std::string label; - if (!Tools::isNullOrEmpty(proposedLabel)) { + if (!Base::Tools::isNullOrEmpty(proposedLabel)) { // If a label is supplied it is used even if not unique label = proposedLabel; } @@ -2807,8 +2807,8 @@ void Application::initApplication() // set up Unit system default ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath ("User parameter:BaseApp/Preferences/Units"); - UnitsApi::setSchema(static_cast(hGrp->GetInt("UserSchema", 0))); - UnitsApi::setDecimals(static_cast(hGrp->GetInt("Decimals", UnitsApi::getDecimals()))); + Base::UnitsApi::setSchema(static_cast(hGrp->GetInt("UserSchema", 0))); + Base::UnitsApi::setDecimals(static_cast(hGrp->GetInt("Decimals", Base::UnitsApi::getDecimals()))); // In case we are using fractional inches, get user setting for min unit int denom = static_cast(hGrp->GetInt("FracInch", Base::QuantityFormat::getDefaultDenominator())); From f66561b23a12601c152edb2a2c99ceef9b6bd895 Mon Sep 17 00:00:00 2001 From: bofdahof <172177156+bofdahof@users.noreply.github.com> Date: Sat, 8 Mar 2025 13:14:35 +1000 Subject: [PATCH 2/6] remove using namespace boost --- src/App/Application.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index edae6a5961..3412f7dbc4 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -173,7 +173,7 @@ FC_LOG_LEVEL_INIT("App", true, true) using namespace App; //using namespace Base; using namespace std; -using namespace boost; +//using namespace boost; using namespace boost::program_options; using Base::FileInfo; namespace sp = std::placeholders; @@ -2373,8 +2373,8 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v stringstream ss; ss << ifs.rdbuf(); // Split the file content - char_separator sep(" \n\r"); - tokenizer > tok(ss.str(), sep); + boost::char_separator sep(" \n\r"); + boost::tokenizer > tok(ss.str(), sep); vector args2; copy(tok.begin(), tok.end(), back_inserter(args2)); // Parse the file and store the options From 00173ebe02a0ae520ee7b10d9763817664d5856a Mon Sep 17 00:00:00 2001 From: bofdahof <172177156+bofdahof@users.noreply.github.com> Date: Sat, 8 Mar 2025 13:18:06 +1000 Subject: [PATCH 3/6] remove using namespace std --- src/App/Application.cpp | 112 ++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 3412f7dbc4..2c956013ae 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -172,7 +172,7 @@ FC_LOG_LEVEL_INIT("App", true, true) using namespace App; //using namespace Base; -using namespace std; +//using namespace std; //using namespace boost; using namespace boost::program_options; using Base::FileInfo; @@ -1639,7 +1639,7 @@ void Application::slotBeforeRecompute(const Document& doc) this->signalBeforeRecomputeDocument(doc); } -void Application::slotOpenTransaction(const Document &doc, string name) +void Application::slotOpenTransaction(const Document &doc, std::string name) { this->signalOpenTransaction(doc, std::move(name)); } @@ -2215,7 +2215,7 @@ void Application::initTypes() namespace { -void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& vm) +void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_map& vm) { // Declare a group of options that will be // allowed only on the command line @@ -2225,10 +2225,10 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v ("verbose", "Prints verbose version string") ("help,h", "Prints help message") ("console,c", "Starts in console mode") - ("response-file", value(),"Can be specified with '@name', too") + ("response-file", value(),"Can be specified with '@name', too") ("dump-config", "Dumps configuration") - ("get-config", value(), "Prints the value of the requested configuration key") - ("set-config", value< vector >()->multitoken(), "Sets the value of a configuration key") + ("get-config", value(), "Prints the value of the requested configuration key") + ("set-config", value< std::vector >()->multitoken(), "Sets the value of a configuration key") ("keep-deprecated-paths", "If set then config files are kept on the old location") ; @@ -2240,18 +2240,18 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v boost::program_options::options_description config("Configuration"); config.add_options() ("write-log,l", descr.str().c_str()) - ("log-file", value(), "Unlike --write-log this allows logging to an arbitrary file") - ("user-cfg,u", value(),"User config file to load/save user settings") - ("system-cfg,s", value(),"System config file to load/save system settings") - ("run-test,t", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.") - ("run-open,r", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete.") - ("module-path,M", value< vector >()->composing(),"Additional module paths") - ("macro-path,E", value< vector >()->composing(),"Additional macro paths") - ("python-path,P", value< vector >()->composing(),"Additional python paths") - ("disable-addon", value< vector >()->composing(),"Disable a given addon.") + ("log-file", value(), "Unlike --write-log this allows logging to an arbitrary file") + ("user-cfg,u", value(),"User config file to load/save user settings") + ("system-cfg,s", value(),"System config file to load/save system settings") + ("run-test,t", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.") + ("run-open,r", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete.") + ("module-path,M", value< std::vector >()->composing(),"Additional module paths") + ("macro-path,E", value< std::vector >()->composing(),"Additional macro paths") + ("python-path,P", value< std::vector >()->composing(),"Additional python paths") + ("disable-addon", value< std::vector >()->composing(),"Disable a given addon.") ("single-instance", "Allow to run a single instance of the application") ("safe-mode", "Force enable safe mode") - ("pass", value< vector >()->multitoken(), "Ignores the following arguments and pass them through to be used by a script") + ("pass", value< std::vector >()->multitoken(), "Ignores the following arguments and pass them through to be used by a script") ; @@ -2259,33 +2259,33 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v // in the config file, but will not be shown to the user. boost::program_options::options_description hidden("Hidden options"); hidden.add_options() - ("input-file", boost::program_options::value< vector >(), "input file") - ("output", boost::program_options::value(),"output file") + ("input-file", boost::program_options::value< std::vector >(), "input file") + ("output", boost::program_options::value(),"output file") ("hidden", "don't show the main window") // this are to ignore for the window system (QApplication) - ("style", boost::program_options::value< string >(), "set the application GUI style") - ("stylesheet", boost::program_options::value< string >(), "set the application stylesheet") - ("session", boost::program_options::value< string >(), "restore the application from an earlier session") + ("style", boost::program_options::value< std::string >(), "set the application GUI style") + ("stylesheet", boost::program_options::value< std::string >(), "set the application stylesheet") + ("session", boost::program_options::value< std::string >(), "restore the application from an earlier session") ("reverse", "set the application's layout direction from right to left") ("widgetcount", "print debug messages about widgets") - ("graphicssystem", boost::program_options::value< string >(), "backend to be used for on-screen widgets and pixmaps") - ("display", boost::program_options::value< string >(), "set the X-Server") - ("geometry ", boost::program_options::value< string >(), "set the X-Window geometry") - ("font", boost::program_options::value< string >(), "set the X-Window font") - ("fn", boost::program_options::value< string >(), "set the X-Window font") - ("background", boost::program_options::value< string >(), "set the X-Window background color") - ("bg", boost::program_options::value< string >(), "set the X-Window background color") - ("foreground", boost::program_options::value< string >(), "set the X-Window foreground color") - ("fg", boost::program_options::value< string >(), "set the X-Window foreground color") - ("button", boost::program_options::value< string >(), "set the X-Window button color") - ("btn", boost::program_options::value< string >(), "set the X-Window button color") - ("name", boost::program_options::value< string >(), "set the X-Window name") - ("title", boost::program_options::value< string >(), "set the X-Window title") - ("visual", boost::program_options::value< string >(), "set the X-Window to color scheme") + ("graphicssystem", boost::program_options::value< std::string >(), "backend to be used for on-screen widgets and pixmaps") + ("display", boost::program_options::value< std::string >(), "set the X-Server") + ("geometry ", boost::program_options::value< std::string >(), "set the X-Window geometry") + ("font", boost::program_options::value< std::string >(), "set the X-Window font") + ("fn", boost::program_options::value< std::string >(), "set the X-Window font") + ("background", boost::program_options::value< std::string >(), "set the X-Window background color") + ("bg", boost::program_options::value< std::string >(), "set the X-Window background color") + ("foreground", boost::program_options::value< std::string >(), "set the X-Window foreground color") + ("fg", boost::program_options::value< std::string >(), "set the X-Window foreground color") + ("button", boost::program_options::value< std::string >(), "set the X-Window button color") + ("btn", boost::program_options::value< std::string >(), "set the X-Window button color") + ("name", boost::program_options::value< std::string >(), "set the X-Window name") + ("title", boost::program_options::value< std::string >(), "set the X-Window title") + ("visual", boost::program_options::value< std::string >(), "set the X-Window to color scheme") ("ncols", boost::program_options::value< int >(), "set the X-Window to color scheme") ("cmap", "set the X-Window to color scheme") #if defined(FC_OS_MACOSX) - ("psn", boost::program_options::value< string >(), "process serial number") + ("psn", boost::program_options::value< std::string >(), "process serial number") #endif ; @@ -2361,21 +2361,21 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v if (vm.count("response-file")) { // Load the file and tokenize it - std::ifstream ifs(vm["response-file"].as().c_str()); + std::ifstream ifs(vm["response-file"].as().c_str()); if (!ifs) { Base::Console().Error("Could no open the response file\n"); std::stringstream str; str << "Could no open the response file: '" - << vm["response-file"].as() << "'" << '\n'; + << vm["response-file"].as() << "'" << '\n'; throw Base::UnknownProgramOption(str.str()); } // Read the whole file into a string - stringstream ss; + std::stringstream ss; ss << ifs.rdbuf(); // Split the file content boost::char_separator sep(" \n\r"); boost::tokenizer > tok(ss.str(), sep); - vector args2; + std::vector args2; copy(tok.begin(), tok.end(), back_inserter(args2)); // Parse the file and store the options store( boost::program_options::command_line_parser(args2). @@ -2411,8 +2411,8 @@ void processProgramOptions(const variables_map& vm, std::map >(); - string temp; + auto Mods = vm["module-path"].as< std::vector >(); + std::string temp; for (const auto & It : Mods) temp += It + ";"; temp.erase(temp.end()-1); @@ -2420,8 +2420,8 @@ void processProgramOptions(const variables_map& vm, std::map Macros = vm["macro-path"].as< vector >(); - string temp; + std::vector Macros = vm["macro-path"].as< std::vector >(); + std::string temp; for (const auto & It : Macros) temp += It + ";"; temp.erase(temp.end()-1); @@ -2429,14 +2429,14 @@ void processProgramOptions(const variables_map& vm, std::map >(); + auto Paths = vm["python-path"].as< std::vector >(); for (const auto & It : Paths) Base::Interpreter().addPythonPath(It.c_str()); } if (vm.count("disable-addon")) { - auto Addons = vm["disable-addon"].as< vector >(); - string temp; + auto Addons = vm["disable-addon"].as< std::vector >(); + std::string temp; for (const auto & It : Addons) { temp += It + ";"; } @@ -2445,7 +2445,7 @@ void processProgramOptions(const variables_map& vm, std::map >()); + auto files(vm["input-file"].as< std::vector >()); int OpenFileCount=0; for (const auto & It : files) { @@ -2460,7 +2460,7 @@ void processProgramOptions(const variables_map& vm, std::map(); + mConfig["SaveFile"] = vm["output"].as(); } if (vm.count("hidden")) { @@ -2474,19 +2474,19 @@ void processProgramOptions(const variables_map& vm, std::map(); + mConfig["LoggingFileName"] = vm["log-file"].as(); } if (vm.count("user-cfg")) { - mConfig["UserParameter"] = vm["user-cfg"].as(); + mConfig["UserParameter"] = vm["user-cfg"].as(); } if (vm.count("system-cfg")) { - mConfig["SystemParameter"] = vm["system-cfg"].as(); + mConfig["SystemParameter"] = vm["system-cfg"].as(); } if (vm.count("run-test") || vm.count("run-open")) { - string testCase = vm.count("run-open") ? vm["run-open"].as() : vm["run-test"].as(); + std::string testCase = vm.count("run-open") ? vm["run-open"].as() : vm["run-test"].as(); if ( "0" == testCase) { testCase = "TestApp.All"; @@ -2513,7 +2513,7 @@ void processProgramOptions(const variables_map& vm, std::map(); + auto configKey = vm["get-config"].as(); std::stringstream str; std::map::iterator pos; pos = mConfig.find(configKey); @@ -3080,9 +3080,9 @@ void Application::LoadParameters() // A helper function to simplify the main part. template -ostream& operator<<(ostream& os, const vector& v) +std::ostream& operator<<(std::ostream& os, const std::vector& v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); + copy(v.begin(), v.end(), std::ostream_iterator(std::cout, " ")); return os; } From 65619fae39de16b548e14f9923e644ef2866f258 Mon Sep 17 00:00:00 2001 From: bofdahof <172177156+bofdahof@users.noreply.github.com> Date: Sat, 8 Mar 2025 13:20:32 +1000 Subject: [PATCH 4/6] remove using namespace boost::program_options --- src/App/Application.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 2c956013ae..8751ea2d87 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -174,7 +174,7 @@ using namespace App; //using namespace Base; //using namespace std; //using namespace boost; -using namespace boost::program_options; +//using namespace boost::program_options; using Base::FileInfo; namespace sp = std::placeholders; @@ -2215,20 +2215,20 @@ void Application::initTypes() namespace { -void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_map& vm) +void parseProgramOptions(int ac, char ** av, const std::string& exe, boost::program_options::variables_map& vm) { // Declare a group of options that will be // allowed only on the command line - options_description generic("Generic options"); + boost::program_options::options_description generic("Generic options"); generic.add_options() ("version,v", "Prints version string") ("verbose", "Prints verbose version string") ("help,h", "Prints help message") ("console,c", "Starts in console mode") - ("response-file", value(),"Can be specified with '@name', too") + ("response-file", boost::program_options::value(),"Can be specified with '@name', too") ("dump-config", "Dumps configuration") - ("get-config", value(), "Prints the value of the requested configuration key") - ("set-config", value< std::vector >()->multitoken(), "Sets the value of a configuration key") + ("get-config", boost::program_options::value(), "Prints the value of the requested configuration key") + ("set-config", boost::program_options::value< std::vector >()->multitoken(), "Sets the value of a configuration key") ("keep-deprecated-paths", "If set then config files are kept on the old location") ; @@ -2240,18 +2240,18 @@ void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_m boost::program_options::options_description config("Configuration"); config.add_options() ("write-log,l", descr.str().c_str()) - ("log-file", value(), "Unlike --write-log this allows logging to an arbitrary file") - ("user-cfg,u", value(),"User config file to load/save user settings") - ("system-cfg,s", value(),"System config file to load/save system settings") - ("run-test,t", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.") - ("run-open,r", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete.") - ("module-path,M", value< std::vector >()->composing(),"Additional module paths") - ("macro-path,E", value< std::vector >()->composing(),"Additional macro paths") - ("python-path,P", value< std::vector >()->composing(),"Additional python paths") - ("disable-addon", value< std::vector >()->composing(),"Disable a given addon.") + ("log-file", boost::program_options::value(), "Unlike --write-log this allows logging to an arbitrary file") + ("user-cfg,u", boost::program_options::value(),"User config file to load/save user settings") + ("system-cfg,s", boost::program_options::value(),"System config file to load/save system settings") + ("run-test,t", boost::program_options::value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.") + ("run-open,r", boost::program_options::value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete.") + ("module-path,M", boost::program_options::value< std::vector >()->composing(),"Additional module paths") + ("macro-path,E", boost::program_options::value< std::vector >()->composing(),"Additional macro paths") + ("python-path,P", boost::program_options::value< std::vector >()->composing(),"Additional python paths") + ("disable-addon", boost::program_options::value< std::vector >()->composing(),"Disable a given addon.") ("single-instance", "Allow to run a single instance of the application") ("safe-mode", "Force enable safe mode") - ("pass", value< std::vector >()->multitoken(), "Ignores the following arguments and pass them through to be used by a script") + ("pass", boost::program_options::value< std::vector >()->multitoken(), "Ignores the following arguments and pass them through to be used by a script") ; @@ -2318,7 +2318,7 @@ void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_m // 0000659: SIGABRT on startup in boost::program_options (Boost 1.49) // Add some text to the constructor - options_description cmdline_options("Command-line options"); + boost::program_options::options_description cmdline_options("Command-line options"); cmdline_options.add(generic).add(config).add(hidden); boost::program_options::options_description config_file_options("Config"); @@ -2383,7 +2383,7 @@ void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_m } } -void processProgramOptions(const variables_map& vm, std::map& mConfig) +void processProgramOptions(const boost::program_options::variables_map& vm, std::map& mConfig) { if (vm.count("version")) { std::stringstream str; @@ -2582,7 +2582,7 @@ void Application::initConfig(int argc, char ** argv) } } - variables_map vm; + boost::program_options::variables_map vm; { BOOST_SCOPE_EXIT_ALL(&) { // console-mode needs to be set (if possible) also in case parseProgramOptions From ae9eec20a67877e8c838eb2ff3b929aac6f78d24 Mon Sep 17 00:00:00 2001 From: bofdahof <172177156+bofdahof@users.noreply.github.com> Date: Sat, 8 Mar 2025 13:22:49 +1000 Subject: [PATCH 5/6] remove using namespace Base::FileInfo --- src/App/Application.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 8751ea2d87..8a690b5d87 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -175,7 +175,7 @@ using namespace App; //using namespace std; //using namespace boost; //using namespace boost::program_options; -using Base::FileInfo; +//using Base::FileInfo; namespace sp = std::placeholders; //========================================================================== @@ -534,7 +534,7 @@ bool Application::closeDocument(const char* name) setActiveDocument(static_cast(nullptr)); std::unique_ptr delDoc (pos->second); DocMap.erase( pos ); - DocFileMap.erase(FileInfo(delDoc->FileName.getValue()).filePath()); + DocFileMap.erase(Base::FileInfo(delDoc->FileName.getValue()).filePath()); _objCount = -1; @@ -684,17 +684,17 @@ Document *Application::getDocumentByPath(const char *path, PathMatchMode checkCa for(const auto &v : DocMap) { const auto &file = v.second->FileName.getStrValue(); if(!file.empty()) - DocFileMap[FileInfo(file.c_str()).filePath()] = v.second; + DocFileMap[Base::FileInfo(file.c_str()).filePath()] = v.second; } } - auto it = DocFileMap.find(FileInfo(path).filePath()); + auto it = DocFileMap.find(Base::FileInfo(path).filePath()); if(it != DocFileMap.end()) return it->second; if (checkCanonical == PathMatchMode::MatchAbsolute) return nullptr; - std::string filepath = FileInfo(path).filePath(); + std::string filepath = Base::FileInfo(path).filePath(); QString canonicalPath = QFileInfo(QString::fromUtf8(path)).canonicalFilePath(); for (const auto &v : DocMap) { QFileInfo fi(QString::fromUtf8(v.second->FileName.getValue())); @@ -922,7 +922,7 @@ Document* Application::openDocumentPrivate(const char * FileName, bool isMainDoc, DocumentInitFlags initFlags, std::vector &&objNames) { - FileInfo File(FileName); + Base::FileInfo File(FileName); if (!File.exists()) { std::stringstream str; @@ -983,7 +983,7 @@ Document* Application::openDocumentPrivate(const char * FileName, std::string name; if(propFileName != FileName) { - FileInfo fi(propFileName); + Base::FileInfo fi(propFileName); name = fi.fileNamePure(); }else name = File.fileNamePure(); @@ -1002,7 +1002,7 @@ Document* Application::openDocumentPrivate(const char * FileName, // read the document newDoc->restore(File.filePath().c_str(),true,objNames); if(!DocFileMap.empty()) - DocFileMap[FileInfo(newDoc->FileName.getValue()).filePath()] = newDoc; + DocFileMap[Base::FileInfo(newDoc->FileName.getValue()).filePath()] = newDoc; return newDoc; } // if the project file itself is corrupt then From 2d3f0d714d4285ec532577cf86586632c88c7fb6 Mon Sep 17 00:00:00 2001 From: bofdahof <172177156+bofdahof@users.noreply.github.com> Date: Sat, 8 Mar 2025 13:23:28 +1000 Subject: [PATCH 6/6] cleanup commented lines --- src/App/Application.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 8a690b5d87..4904750e9c 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -171,11 +171,6 @@ FC_LOG_LEVEL_INIT("App", true, true) using namespace App; -//using namespace Base; -//using namespace std; -//using namespace boost; -//using namespace boost::program_options; -//using Base::FileInfo; namespace sp = std::placeholders; //==========================================================================