Console: rename PascalCase named methods to camelCase

This commit is contained in:
bofdahof
2025-03-30 00:50:27 +10:00
committed by Kacper Donat
parent 1dbc0638c3
commit ba2c2ca5ad
497 changed files with 2423 additions and 2425 deletions

View File

@@ -662,7 +662,7 @@ public:
}
catch (const boost::exception&) {
// reported by code analyzers
Base::Console().Warning("~DocOpenGuard: Unexpected boost exception\n");
Base::Console().warning("~DocOpenGuard: Unexpected boost exception\n");
}
}
}
@@ -799,7 +799,7 @@ std::vector<Document*> Application::openDocuments(const std::vector<std::string>
if (errs && isMainDoc)
(*errs)[count] = e.what();
else
Base::Console().Error("Exception opening file: %s [%s]\n", name.c_str(), e.what());
Base::Console().error("Exception opening file: %s [%s]\n", name.c_str(), e.what());
}
catch (const std::exception &e) {
if (!errs && isMainDoc)
@@ -807,7 +807,7 @@ std::vector<Document*> Application::openDocuments(const std::vector<std::string>
if (errs && isMainDoc)
(*errs)[count] = e.what();
else
Base::Console().Error("Exception opening file: %s [%s]\n", name.c_str(), e.what());
Base::Console().error("Exception opening file: %s [%s]\n", name.c_str(), e.what());
}
catch (...) {
if (errs) {
@@ -1091,7 +1091,7 @@ Application::TransactionSignaller::~TransactionSignaller() {
}
catch (const boost::exception&) {
// reported by code analyzers
Base::Console().Warning("~TransactionSignaller: Unexpected boost exception\n");
Base::Console().warning("~TransactionSignaller: Unexpected boost exception\n");
}
}
}
@@ -1701,21 +1701,21 @@ void Application::destruct()
{
// saving system parameter
if (_pcSysParamMngr->IgnoreSave()) {
Base::Console().Warning("Discard system parameter\n");
Base::Console().warning("Discard system parameter\n");
}
else {
Base::Console().Log("Saving system parameter...\n");
Base::Console().log("Saving system parameter...\n");
_pcSysParamMngr->SaveDocument();
Base::Console().Log("Saving system parameter...done\n");
Base::Console().log("Saving system parameter...done\n");
}
// saving the User parameter
if (_pcUserParamMngr->IgnoreSave()) {
Base::Console().Warning("Discard user parameter\n");
Base::Console().warning("Discard user parameter\n");
}
else {
Base::Console().Log("Saving user parameter...\n");
Base::Console().log("Saving user parameter...\n");
_pcUserParamMngr->SaveDocument();
Base::Console().Log("Saving user parameter...done\n");
Base::Console().log("Saving user parameter...done\n");
}
// now save all other parameter files
@@ -1723,9 +1723,9 @@ void Application::destruct()
for (const auto &it : paramMgr) {
if ((it.second != _pcSysParamMngr) && (it.second != _pcUserParamMngr)) {
if (it.second->HasSerializer() && !it.second->IgnoreSave()) {
Base::Console().Log("Saving %s...\n", it.first.c_str());
Base::Console().log("Saving %s...\n", it.first.c_str());
it.second->SaveDocument();
Base::Console().Log("Saving %s...done\n", it.first.c_str());
Base::Console().log("Saving %s...done\n", it.first.c_str());
}
}
}
@@ -1760,12 +1760,12 @@ void Application::destruct()
void Application::destructObserver()
{
if ( _pConsoleObserverFile ) {
Base::Console().DetachObserver(_pConsoleObserverFile);
Base::Console().detachObserver(_pConsoleObserverFile);
delete _pConsoleObserverFile;
_pConsoleObserverFile = nullptr;
}
if ( _pConsoleObserverStd ) {
Base::Console().DetachObserver(_pConsoleObserverStd);
Base::Console().detachObserver(_pConsoleObserverStd);
delete _pConsoleObserverStd;
_pConsoleObserverStd = nullptr;
}
@@ -1902,7 +1902,7 @@ void my_se_translator_filter(unsigned int code, EXCEPTION_POINTERS* pExp)
throw Base::AccessViolation();
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
case EXCEPTION_INT_DIVIDE_BY_ZERO:
Base::Console().Error("SEH exception (%u): Division by zero\n", code);
Base::Console().error("SEH exception (%u): Division by zero\n", code);
return;
}
@@ -2365,7 +2365,7 @@ void parseProgramOptions(int ac, char ** av, const std::string& exe, boost::prog
// Load the file and tokenize it
std::ifstream ifs(vm["response-file"].as<std::string>().c_str());
if (!ifs) {
Base::Console().Error("Could no open the response file\n");
Base::Console().error("Could no open the response file\n");
std::stringstream str;
str << "Could no open the response file: '"
<< vm["response-file"].as<std::string>() << "'" << '\n';
@@ -2629,7 +2629,7 @@ void Application::initConfig(int argc, char ** argv)
if (!pythonpath.empty())
mConfig["PythonSearchPath"] = pythonpath;
else
Base::Console().Warning("Encoding of Python paths failed\n");
Base::Console().warning("Encoding of Python paths failed\n");
// Handle the options that have impact on the init process
processProgramOptions(vm, mConfig);
@@ -2637,7 +2637,7 @@ void Application::initConfig(int argc, char ** argv)
// Init console ===========================================================
Base::PyGILStateLocker lock;
_pConsoleObserverStd = new Base::ConsoleObserverStd();
Base::Console().AttachObserver(_pConsoleObserverStd);
Base::Console().attachObserver(_pConsoleObserverStd);
if (mConfig["LoggingConsole"] != "1") {
_pConsoleObserverStd->bMsg = false;
_pConsoleObserverStd->bLog = false;
@@ -2648,7 +2648,7 @@ void Application::initConfig(int argc, char ** argv)
// file logging Init ===========================================================
if (mConfig["LoggingFile"] == "1") {
_pConsoleObserverFile = new Base::ConsoleObserverFile(mConfig["LoggingFileName"].c_str());
Base::Console().AttachObserver(_pConsoleObserverFile);
Base::Console().attachObserver(_pConsoleObserverFile);
}
else
_pConsoleObserverFile = nullptr;
@@ -2658,7 +2658,7 @@ void Application::initConfig(int argc, char ** argv)
// Remove banner if FreeCAD is invoked via the -c command as regular
// Python interpreter
if (mConfig["Verbose"] != "Strict")
Base::Console().Message("%s %s, Libs: %s.%s.%s%sR%s\n%s",
Base::Console().message("%s %s, Libs: %s.%s.%s%sR%s\n%s",
mConfig["ExeName"].c_str(),
mConfig["ExeVersion"].c_str(),
mConfig["BuildVersionMajor"].c_str(),
@@ -2668,7 +2668,7 @@ void Application::initConfig(int argc, char ** argv)
mConfig["BuildRevision"].c_str(),
mConfig["CopyrightInfo"].c_str());
else
Base::Console().Message("%s %s, Libs: %s.%s.%s%sR%s\n",
Base::Console().message("%s %s, Libs: %s.%s.%s%sR%s\n",
mConfig["ExeName"].c_str(),
mConfig["ExeVersion"].c_str(),
mConfig["BuildVersionMajor"].c_str(),
@@ -2678,7 +2678,7 @@ void Application::initConfig(int argc, char ** argv)
mConfig["BuildRevision"].c_str());
if (SafeMode::SafeModeEnabled()) {
Base::Console().Message("FreeCAD is running in _SAFE_MODE_.\n"
Base::Console().message("FreeCAD is running in _SAFE_MODE_.\n"
"Safe mode temporarily disables your configurations and "
"addons. Restart the application to exit safe mode.\n\n");
}
@@ -2693,7 +2693,7 @@ void Application::initConfig(int argc, char ** argv)
#ifndef FC_DEBUG
if (v.second>=0) {
hasDefault = true;
Base::Console().SetDefaultLogLevel(v.second);
Base::Console().setDefaultLogLevel(v.second);
}
#endif
}
@@ -2701,20 +2701,20 @@ void Application::initConfig(int argc, char ** argv)
#ifdef FC_DEBUG
if (v.second>=0) {
hasDefault = true;
Base::Console().SetDefaultLogLevel(static_cast<int>(v.second));
Base::Console().setDefaultLogLevel(static_cast<int>(v.second));
}
#endif
}
else {
*Base::Console().GetLogLevel(v.first.c_str()) = static_cast<int>(v.second);
*Base::Console().getLogLevel(v.first.c_str()) = static_cast<int>(v.second);
}
}
if (!hasDefault) {
#ifdef FC_DEBUG
loglevelParam->SetInt("DebugDefault", Base::Console().LogLevel(-1));
loglevelParam->SetInt("DebugDefault", Base::Console().logLevel(-1));
#else
loglevelParam->SetInt("Default", Base::Console().LogLevel(-1));
loglevelParam->SetInt("Default", Base::Console().logLevel(-1));
#endif
}
@@ -2789,7 +2789,7 @@ void Application::initApplication()
// creating the application
if (mConfig["Verbose"] != "Strict")
Base::Console().Log("Create Application\n");
Base::Console().log("Create Application\n");
Application::_pcSingleton = new Application(mConfig);
// set up Unit system default
@@ -2801,11 +2801,11 @@ void Application::initApplication()
hGrp->GetInt("FracInch", Base::QuantityFormat::getDefaultDenominator()));
#if defined (_DEBUG)
Base::Console().Log("Application is built with debug information\n");
Base::Console().log("Application is built with debug information\n");
#endif
// starting the init script
Base::Console().Log("Run App init script\n");
Base::Console().log("Run App init script\n");
try {
Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("CMakeVariables"));
Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADInit"));
@@ -2840,11 +2840,11 @@ std::list<std::string> Application::getCmdLineFiles()
std::list<std::string> Application::processFiles(const std::list<std::string>& files)
{
std::list<std::string> processed;
Base::Console().Log("Init: Processing command line files\n");
Base::Console().log("Init: Processing command line files\n");
for (const auto & it : files) {
Base::FileInfo file(it);
Base::Console().Log("Init: Processing file: %s\n",file.filePath().c_str());
Base::Console().log("Init: Processing file: %s\n",file.filePath().c_str());
try {
if (file.hasExtension("fcstd") || file.hasExtension("std")) {
@@ -2880,10 +2880,10 @@ std::list<std::string> Application::processFiles(const std::list<std::string>& f
Base::Interpreter().runStringArg("%s.open(u\"%s\")",mods.front().c_str(),
escapedstr.c_str());
processed.push_back(it);
Base::Console().Log("Command line open: %s.open(u\"%s\")\n",mods.front().c_str(),escapedstr.c_str());
Base::Console().log("Command line open: %s.open(u\"%s\")\n",mods.front().c_str(),escapedstr.c_str());
}
else if (file.exists()) {
Base::Console().Warning("File format not supported: %s \n", file.filePath().c_str());
Base::Console().warning("File format not supported: %s \n", file.filePath().c_str());
}
}
}
@@ -2891,10 +2891,10 @@ std::list<std::string> Application::processFiles(const std::list<std::string>& f
throw; // re-throw to main() function
}
catch (const Base::Exception& e) {
Base::Console().Error("Exception while processing file: %s [%s]\n", file.filePath().c_str(), e.what());
Base::Console().error("Exception while processing file: %s [%s]\n", file.filePath().c_str(), e.what());
}
catch (...) {
Base::Console().Error("Unknown exception while processing file: %s \n", file.filePath().c_str());
Base::Console().error("Unknown exception while processing file: %s \n", file.filePath().c_str());
}
}
@@ -2938,14 +2938,14 @@ void Application::processCmdLineFiles()
,mods.front().c_str(),output.c_str());
}
else {
Base::Console().Warning("File format not supported: %s \n", output.c_str());
Base::Console().warning("File format not supported: %s \n", output.c_str());
}
}
catch (const Base::Exception& e) {
Base::Console().Error("Exception while saving to file: %s [%s]\n", output.c_str(), e.what());
Base::Console().error("Exception while saving to file: %s [%s]\n", output.c_str(), e.what());
}
catch (...) {
Base::Console().Error("Unknown exception while saving to file: %s \n", output.c_str());
Base::Console().error("Unknown exception while saving to file: %s \n", output.c_str());
}
}
}
@@ -2961,15 +2961,15 @@ void Application::runApplication()
}
else if (mConfig["RunMode"] == "Internal") {
// run internal script
Base::Console().Log("Running internal script:\n");
Base::Console().log("Running internal script:\n");
Base::Interpreter().runString(Base::ScriptFactory().ProduceScript(mConfig["ScriptFileName"].c_str()));
}
else if (mConfig["RunMode"] == "Exit") {
// getting out
Base::Console().Log("Exiting on purpose\n");
Base::Console().log("Exiting on purpose\n");
}
else {
Base::Console().Log("Unknown Run mode (%d) in main()?!?\n\n", mConfig["RunMode"].c_str());
Base::Console().log("Unknown Run mode (%d) in main()?!?\n\n", mConfig["RunMode"].c_str());
}
}
@@ -2977,10 +2977,10 @@ void Application::logStatus()
{
const std::string time_str = boost::posix_time::to_simple_string(
boost::posix_time::second_clock::local_time());
Base::Console().Log("Time = %s\n", time_str.c_str());
Base::Console().log("Time = %s\n", time_str.c_str());
for (const auto & It : mConfig) {
Base::Console().Log("%s = %s\n", It.first.c_str(), It.second.c_str());
Base::Console().log("%s = %s\n", It.first.c_str(), It.second.c_str());
}
}
@@ -3004,8 +3004,8 @@ void Application::LoadParameters()
if (_pcSysParamMngr->LoadOrCreateDocument() && mConfig["Verbose"] != "Strict") {
// Configuration file optional when using as Python module
if (!Py_IsInitialized()) {
Base::Console().Warning(" Parameter does not exist, writing initial one\n");
Base::Console().Message(" This warning normally means that FreeCAD is running for the first time\n"
Base::Console().warning(" Parameter does not exist, writing initial one\n");
Base::Console().message(" This warning normally means that FreeCAD is running for the first time\n"
" or the configuration was deleted or moved. FreeCAD is generating the standard\n"
" configuration.\n");
}
@@ -3013,7 +3013,7 @@ void Application::LoadParameters()
}
catch (const Base::Exception& e) {
// try to proceed with an empty XML document
Base::Console().Error("%s in file %s.\n"
Base::Console().error("%s in file %s.\n"
"Continue with an empty configuration.\n",
e.what(), mConfig["SystemParameter"].c_str());
_pcSysParamMngr->CreateDocument();
@@ -3038,8 +3038,8 @@ void Application::LoadParameters()
// Configuration file optional when using as Python module
if (!Py_IsInitialized()) {
Base::Console().Warning(" User settings do not exist, writing initial one\n");
Base::Console().Message(" This warning normally means that FreeCAD is running for the first time\n"
Base::Console().warning(" User settings do not exist, writing initial one\n");
Base::Console().message(" This warning normally means that FreeCAD is running for the first time\n"
" or your configuration was deleted or moved. The system defaults\n"
" will be automatically generated for you.\n");
}
@@ -3047,7 +3047,7 @@ void Application::LoadParameters()
}
catch (const Base::Exception& e) {
// try to proceed with an empty XML document
Base::Console().Error("%s in file %s.\n"
Base::Console().error("%s in file %s.\n"
"Continue with an empty configuration.\n",
e.what(), mConfig["UserParameter"].c_str());
_pcUserParamMngr->CreateDocument();
@@ -3733,7 +3733,7 @@ void Application::getVerboseCommonInfo(QTextStream& str, const std::map<std::str
ifcopenshellVer = Base::Interpreter().getValue(cmd, "version");
}
catch (const Base::Exception& e) {
Base::Console().Log("%s (safe to ignore, unless using the BIM workbench and IFC).\n", e.what());
Base::Console().log("%s (safe to ignore, unless using the BIM workbench and IFC).\n", e.what());
}
if (ifcopenshellVer) {