Console: rename PascalCase named methods to camelCase
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -984,19 +984,19 @@ PyObject* Application::sSetLogLevel(PyObject* /*self*/, PyObject* args)
|
||||
if (strcmp(tag, "Default") == 0) {
|
||||
#ifndef FC_DEBUG
|
||||
if (l >= 0) {
|
||||
Base::Console().SetDefaultLogLevel(l);
|
||||
Base::Console().setDefaultLogLevel(l);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(tag, "DebugDefault") == 0) {
|
||||
#ifdef FC_DEBUG
|
||||
if (l >= 0) {
|
||||
Base::Console().SetDefaultLogLevel(l);
|
||||
Base::Console().setDefaultLogLevel(l);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
*Base::Console().GetLogLevel(tag) = l;
|
||||
*Base::Console().getLogLevel(tag) = l;
|
||||
}
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
@@ -1025,11 +1025,11 @@ PyObject* Application::sGetLogLevel(PyObject* /*self*/, PyObject* args)
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
int* pl = Base::Console().GetLogLevel(tag, false);
|
||||
int* pl = Base::Console().getLogLevel(tag, false);
|
||||
l = pl ? *pl : -1;
|
||||
}
|
||||
// For performance reason, we only output integer value
|
||||
return Py_BuildValue("i", Base::Console().LogLevel(l));
|
||||
return Py_BuildValue("i", Base::Console().logLevel(l));
|
||||
}
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
@@ -765,7 +765,7 @@ void Document::onChanged(const Property* prop)
|
||||
if (!TransDirNew.exists()) {
|
||||
if (TransDirOld.exists()) {
|
||||
if (!TransDirOld.renameFile(new_dir.c_str())) {
|
||||
Base::Console().Warning("Failed to rename '%s' to '%s'\n",
|
||||
Base::Console().warning("Failed to rename '%s' to '%s'\n",
|
||||
old_dir.c_str(),
|
||||
new_dir.c_str());
|
||||
}
|
||||
@@ -775,7 +775,7 @@ void Document::onChanged(const Property* prop)
|
||||
}
|
||||
else {
|
||||
if (!TransDirNew.createDirectories()) {
|
||||
Base::Console().Warning("Failed to create '%s'\n", new_dir.c_str());
|
||||
Base::Console().warning("Failed to create '%s'\n", new_dir.c_str());
|
||||
}
|
||||
else {
|
||||
this->TransientDir.setValue(new_dir);
|
||||
@@ -788,7 +788,7 @@ void Document::onChanged(const Property* prop)
|
||||
// make sure that the uuid is unique
|
||||
std::string uuid = this->Uid.getValueStr();
|
||||
Base::Uuid id;
|
||||
Base::Console().Warning("Document with the UUID '%s' already exists, change to '%s'\n",
|
||||
Base::Console().warning("Document with the UUID '%s' already exists, change to '%s'\n",
|
||||
uuid.c_str(),
|
||||
id.getValue().c_str());
|
||||
// recursive call of onChanged()
|
||||
@@ -846,7 +846,7 @@ Document::Document(const char* documentName)
|
||||
d->DocumentPythonObject = Py::Object(new DocumentPy(this), true);
|
||||
|
||||
#ifdef FC_LOGUPDATECHAIN
|
||||
Console().Log("+App::Document: %p\n", this);
|
||||
Console().log("+App::Document: %p\n", this);
|
||||
#endif
|
||||
std::string CreationDateString = Base::Tools::currentDateTimeString();
|
||||
std::string Author = App::GetApplication()
|
||||
@@ -942,7 +942,7 @@ Document::Document(const char* documentName)
|
||||
Document::~Document()
|
||||
{
|
||||
#ifdef FC_LOGUPDATECHAIN
|
||||
Console().Log("-App::Document: %s %p\n", getName(), this);
|
||||
Console().log("-App::Document: %s %p\n", getName(), this);
|
||||
#endif
|
||||
|
||||
try {
|
||||
@@ -952,7 +952,7 @@ Document::~Document()
|
||||
}
|
||||
|
||||
#ifdef FC_LOGUPDATECHAIN
|
||||
Console().Log("-Delete Features of %s \n", getName());
|
||||
Console().log("-Delete Features of %s \n", getName());
|
||||
#endif
|
||||
|
||||
d->clearDocument();
|
||||
@@ -1092,7 +1092,7 @@ void Document::Restore(Base::XMLReader& reader)
|
||||
addObject(type.c_str(), name.c_str(), /*isNew=*/false);
|
||||
}
|
||||
catch (Base::Exception&) {
|
||||
Base::Console().Message("Cannot create object '%s'\n", name.c_str());
|
||||
Base::Console().message("Cannot create object '%s'\n", name.c_str());
|
||||
}
|
||||
}
|
||||
reader.readEndElement("Features");
|
||||
@@ -1128,7 +1128,7 @@ void Document::Restore(Base::XMLReader& reader)
|
||||
void DocumentP::checkStringHasher(const Base::XMLReader& reader)
|
||||
{
|
||||
if (reader.hasReadFailed("StringHasher.Table.txt")) {
|
||||
Base::Console().Error(QT_TRANSLATE_NOOP(
|
||||
Base::Console().error(QT_TRANSLATE_NOOP(
|
||||
"Notifications",
|
||||
"\nIt is recommended that the user right-click the root of "
|
||||
"the document and select Mark to recompute.\n"
|
||||
@@ -1528,7 +1528,7 @@ std::vector<App::DocumentObject*> Document::readObjects(Base::XMLReader& reader)
|
||||
}
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("Cannot create object '%s': (%s)\n", name.c_str(), e.what());
|
||||
Base::Console().error("Cannot create object '%s': (%s)\n", name.c_str(), e.what());
|
||||
}
|
||||
}
|
||||
if (!testStatus(Status::Importing)) {
|
||||
@@ -1575,7 +1575,7 @@ std::vector<App::DocumentObject*> Document::readObjects(Base::XMLReader& reader)
|
||||
pObj->setStatus(ObjectStatus::Restore, false);
|
||||
|
||||
if (reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestoreInDocumentObject)) {
|
||||
Base::Console().Error("Object \"%s\" was subject to a partial restore. As a result "
|
||||
Base::Console().error("Object \"%s\" was subject to a partial restore. As a result "
|
||||
"geometry may have changed or be incomplete.\n",
|
||||
name.c_str());
|
||||
reader.clearPartialRestoreDocumentObject();
|
||||
@@ -1861,7 +1861,7 @@ private:
|
||||
}
|
||||
|
||||
if (!fi.renameFile(fn.c_str())) {
|
||||
Base::Console().Warning("Cannot rename project file to backup file\n");
|
||||
Base::Console().warning("Cannot rename project file to backup file\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1941,13 +1941,13 @@ private:
|
||||
try {
|
||||
if (!it.deleteFile()) {
|
||||
backupManagementError = true;
|
||||
Base::Console().Warning("Cannot remove backup file : %s\n",
|
||||
Base::Console().warning("Cannot remove backup file : %s\n",
|
||||
it.fileName().c_str());
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
backupManagementError = true;
|
||||
Base::Console().Warning("Cannot remove backup file : %s\n",
|
||||
Base::Console().warning("Cannot remove backup file : %s\n",
|
||||
it.fileName().c_str());
|
||||
}
|
||||
}
|
||||
@@ -2009,7 +2009,7 @@ private:
|
||||
}
|
||||
|
||||
if (ext >= numberOfFiles + 10) {
|
||||
Base::Console().Error(
|
||||
Base::Console().error(
|
||||
"File not saved: Cannot rename project file to backup file\n");
|
||||
// throw Base::FileException("File not saved: Cannot rename project file to
|
||||
// backup file", fi);
|
||||
@@ -2021,7 +2021,7 @@ private:
|
||||
fi.deleteFile();
|
||||
}
|
||||
catch (...) {
|
||||
Base::Console().Warning("Cannot remove backup file: %s\n",
|
||||
Base::Console().warning("Cannot remove backup file: %s\n",
|
||||
fi.fileName().c_str());
|
||||
backupManagementError = true;
|
||||
}
|
||||
@@ -2320,7 +2320,7 @@ void Document::restore(const char* filename,
|
||||
Document::Restore(reader);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("Invalid Document.xml: %s\n", e.what());
|
||||
Base::Console().error("Invalid Document.xml: %s\n", e.what());
|
||||
setStatus(Document::RestoreError, true);
|
||||
}
|
||||
|
||||
@@ -2338,7 +2338,7 @@ void Document::restore(const char* filename,
|
||||
|
||||
if (reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestore)) {
|
||||
setStatus(Document::PartialRestore, true);
|
||||
Base::Console().Error("There were errors while loading the file. Some data might have been "
|
||||
Base::Console().error("There were errors while loading the file. Some data might have been "
|
||||
"modified or not recovered at all. Look above for more specific "
|
||||
"information about the objects involved.\n");
|
||||
}
|
||||
@@ -3100,7 +3100,7 @@ int Document::recompute(const std::vector<App::DocumentObject*>& objs,
|
||||
if (it->isError()) {
|
||||
const char* text = getErrorDescription(it);
|
||||
if (text) {
|
||||
Base::Console().Error("%s: %s\n", it->Label.getValue(), text);
|
||||
Base::Console().error("%s: %s\n", it->Label.getValue(), text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ void DocumentObject::printInvalidLinks() const
|
||||
scopenames.pop_back();
|
||||
}
|
||||
|
||||
Base::Console().Warning("%s: Link(s) to object(s) '%s' go out of the allowed scope '%s'. "
|
||||
Base::Console().warning("%s: Link(s) to object(s) '%s' go out of the allowed scope '%s'. "
|
||||
"Instead, the linked object(s) reside within '%s'.\n",
|
||||
getTypeId().getName(),
|
||||
objnames.c_str(),
|
||||
|
||||
@@ -397,17 +397,17 @@ void ExtensionContainer::saveExtensions(Base::Writer& writer) const
|
||||
ext->extensionSave(writer);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const char* e) {
|
||||
Base::Console().Error("%s\n", e);
|
||||
Base::Console().error("%s\n", e);
|
||||
}
|
||||
#ifndef FC_DEBUG
|
||||
catch (...) {
|
||||
Base::Console().Error(
|
||||
Base::Console().error(
|
||||
"ExtensionContainer::Save: Unknown C++ exception thrown. Try to continue...\n");
|
||||
}
|
||||
#endif
|
||||
@@ -469,17 +469,17 @@ void ExtensionContainer::restoreExtensions(Base::XMLReader& reader)
|
||||
throw; // re-throw
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const char* e) {
|
||||
Base::Console().Error("%s\n", e);
|
||||
Base::Console().error("%s\n", e);
|
||||
}
|
||||
#ifndef FC_DEBUG
|
||||
catch (...) {
|
||||
Base::Console().Error("ExtensionContainer::Restore: Unknown C++ exception thrown\n");
|
||||
Base::Console().error("ExtensionContainer::Restore: Unknown C++ exception thrown\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ FeatureTestAttribute::~FeatureTestAttribute()
|
||||
}
|
||||
catch (Py::Exception& e) {
|
||||
e.clear();
|
||||
Base::Console().Error("Unexpected exception in ~FeatureTestRemoval()\n");
|
||||
Base::Console().error("Unexpected exception in ~FeatureTestRemoval()\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -290,17 +290,17 @@ void PropertyContainer::Save (Base::Writer &writer) const
|
||||
it.second->Save(writer);
|
||||
}
|
||||
catch (const Base::Exception &e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const char* e) {
|
||||
Base::Console().Error("%s\n", e);
|
||||
Base::Console().error("%s\n", e);
|
||||
}
|
||||
#ifndef FC_DEBUG
|
||||
catch (...) {
|
||||
Base::Console().Error("PropertyContainer::Save: Unknown C++ exception thrown. Try to continue...\n");
|
||||
Base::Console().error("PropertyContainer::Save: Unknown C++ exception thrown. Try to continue...\n");
|
||||
}
|
||||
#endif
|
||||
writer.decInd(); // indentation for the actual property
|
||||
@@ -373,7 +373,7 @@ void PropertyContainer::Restore(Base::XMLReader &reader)
|
||||
}
|
||||
|
||||
if (reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestoreInProperty)) {
|
||||
Base::Console().Error("Property %s of type %s was subject to a partial restore.\n",PropName.c_str(),TypeName.c_str());
|
||||
Base::Console().error("Property %s of type %s was subject to a partial restore.\n",PropName.c_str(),TypeName.c_str());
|
||||
reader.clearPartialRestoreProperty();
|
||||
}
|
||||
}
|
||||
@@ -383,20 +383,20 @@ void PropertyContainer::Restore(Base::XMLReader &reader)
|
||||
catch (const Base::RestoreError &) {
|
||||
reader.setPartialRestore(true);
|
||||
reader.clearPartialRestoreProperty();
|
||||
Base::Console().Error("Property %s of type %s was subject to a partial restore.\n",PropName.c_str(),TypeName.c_str());
|
||||
Base::Console().error("Property %s of type %s was subject to a partial restore.\n",PropName.c_str(),TypeName.c_str());
|
||||
}
|
||||
catch (const Base::Exception &e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (const char* e) {
|
||||
Base::Console().Error("%s\n", e);
|
||||
Base::Console().error("%s\n", e);
|
||||
}
|
||||
#ifndef FC_DEBUG
|
||||
catch (...) {
|
||||
Base::Console().Error("PropertyContainer::Restore: Unknown C++ exception thrown\n");
|
||||
Base::Console().error("PropertyContainer::Restore: Unknown C++ exception thrown\n");
|
||||
}
|
||||
#endif
|
||||
reader.readEndElement("Property");
|
||||
|
||||
@@ -509,7 +509,7 @@ Property* PropertyFileIncluded::Copy() const
|
||||
}
|
||||
|
||||
// remember the new name for the Undo
|
||||
Base::Console().Log("Copy '%s' to '%s'\n", _cValue.c_str(), newName.filePath().c_str());
|
||||
Base::Console().log("Copy '%s' to '%s'\n", _cValue.c_str(), newName.filePath().c_str());
|
||||
prop->_cValue = newName.filePath().c_str();
|
||||
|
||||
// make backup files writable to avoid copying them again on undo/redo
|
||||
|
||||
@@ -788,14 +788,14 @@ void PropertyLink::Restore(Base::XMLReader& reader)
|
||||
DocumentObject* object = document ? document->getObject(name.c_str()) : nullptr;
|
||||
if (!object) {
|
||||
if (reader.isVerbose()) {
|
||||
Base::Console().Warning("Lost link to '%s' while loading, maybe "
|
||||
Base::Console().warning("Lost link to '%s' while loading, maybe "
|
||||
"an object was not loaded correctly\n",
|
||||
name.c_str());
|
||||
}
|
||||
}
|
||||
else if (parent == object) {
|
||||
if (reader.isVerbose()) {
|
||||
Base::Console().Warning("Object '%s' links to itself, nullify it\n", name.c_str());
|
||||
Base::Console().warning("Object '%s' links to itself, nullify it\n", name.c_str());
|
||||
}
|
||||
object = nullptr;
|
||||
}
|
||||
@@ -2878,7 +2878,7 @@ void PropertyLinkSubList::Restore(Base::XMLReader& reader)
|
||||
}
|
||||
}
|
||||
else if (reader.isVerbose()) {
|
||||
Base::Console().Warning("Lost link to '%s' while loading, maybe "
|
||||
Base::Console().warning("Lost link to '%s' while loading, maybe "
|
||||
"an object was not loaded correctly\n",
|
||||
name.c_str());
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ PropertyPythonObject::~PropertyPythonObject()
|
||||
try {
|
||||
this->object = Py::Object();
|
||||
} catch (Py::TypeError &) {
|
||||
Base::Console().Warning("Py::TypeError Exception caught while destroying PropertyPythonObject\n");
|
||||
Base::Console().warning("Py::TypeError Exception caught while destroying PropertyPythonObject\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ std::string PropertyPythonObject::toString() const
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Py::String typestr(this->object.type().str());
|
||||
Base::Console().Error("PropertyPythonObject::toString(): failed for %s\n",
|
||||
Base::Console().error("PropertyPythonObject::toString(): failed for %s\n",
|
||||
typestr.as_string().c_str());
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.reportException();
|
||||
@@ -293,10 +293,10 @@ void PropertyPythonObject::restoreObject(Base::XMLReader& reader)
|
||||
e.clear();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
Base::Console().error("%s\n", e.what());
|
||||
}
|
||||
catch (...) {
|
||||
Base::Console().Error("Critical error in PropertyPythonObject::restoreObject\n");
|
||||
Base::Console().error("Critical error in PropertyPythonObject::restoreObject\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ void PropertyPythonObject::Restore(Base::XMLReader& reader)
|
||||
this->loadPickle(buffer);
|
||||
}
|
||||
else if (!load_failed) {
|
||||
Base::Console().Warning(
|
||||
Base::Console().warning(
|
||||
"PropertyPythonObject::Restore: unsupported serialisation: %s\n",
|
||||
buffer.c_str());
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ void PropertyEnumeration::Restore(Base::XMLReader& reader)
|
||||
if (val < 0) {
|
||||
// If the enum is empty at this stage do not print a warning
|
||||
if (_enum.hasEnums()) {
|
||||
Base::Console().DeveloperWarning(std::string("PropertyEnumeration"),
|
||||
Base::Console().developerWarning(std::string("PropertyEnumeration"),
|
||||
"Enumeration index %d is out of range, ignore it\n",
|
||||
val);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user