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

@@ -185,11 +185,11 @@ ConsoleSingleton::~ConsoleSingleton()
* switches off warnings and error messages and restore the state before the modification.
* If the observer \a sObs doesn't exist then nothing happens.
*/
ConsoleMsgFlags ConsoleSingleton::SetEnabledMsgType(const char* sObs,
ConsoleMsgFlags ConsoleSingleton::setEnabledMsgType(const char* sObs,
const ConsoleMsgFlags type,
const bool on) const
{
if (ILogger* pObs = Get(sObs)) {
if (ILogger* pObs = get(sObs)) {
ConsoleMsgFlags flags = 0;
if (type & MsgType_Err) {
@@ -235,9 +235,9 @@ ConsoleMsgFlags ConsoleSingleton::SetEnabledMsgType(const char* sObs,
return 0;
}
bool ConsoleSingleton::IsMsgTypeEnabled(const char* sObs, const FreeCAD_ConsoleMsgType type) const
bool ConsoleSingleton::isMsgTypeEnabled(const char* sObs, const FreeCAD_ConsoleMsgType type) const
{
if (const ILogger* pObs = Get(sObs)) {
if (const ILogger* pObs = get(sObs)) {
switch (type) {
case MsgType_Txt:
return pObs->bMsg;
@@ -259,7 +259,7 @@ bool ConsoleSingleton::IsMsgTypeEnabled(const char* sObs, const FreeCAD_ConsoleM
return false;
}
void ConsoleSingleton::SetConnectionMode(const ConnectionMode mode)
void ConsoleSingleton::setConnectionMode(const ConnectionMode mode)
{
connectionMode = mode;
@@ -278,7 +278,7 @@ void ConsoleSingleton::SetConnectionMode(const ConnectionMode mode)
* be forwarded to it.
* @see ILogger
*/
void ConsoleSingleton::AttachObserver(ILogger* pcObserver)
void ConsoleSingleton::attachObserver(ILogger* pcObserver)
{
// double insert !!
assert(!_aclObservers.contains(pcObserver));
@@ -291,7 +291,7 @@ void ConsoleSingleton::AttachObserver(ILogger* pcObserver)
* After detaching you can destruct the Observer or reinsert it later.
* @see ILogger
*/
void ConsoleSingleton::DetachObserver(ILogger* pcObserver)
void ConsoleSingleton::detachObserver(ILogger* pcObserver)
{
_aclObservers.erase(pcObserver);
}
@@ -304,7 +304,7 @@ void ConsoleSingleton::notifyPrivate(const LogStyle category,
{
for (ILogger* Iter : _aclObservers) {
if (Iter->isActive(category)) {
Iter->SendLog(notifiername,
Iter->sendLog(notifiername,
msg,
category,
recipient,
@@ -323,11 +323,11 @@ void ConsoleSingleton::postEvent(const FreeCAD_ConsoleMsgType type,
new ConsoleEvent(type, recipient, content, notifiername, msg));
}
ILogger* ConsoleSingleton::Get(const char* Name) const
ILogger* ConsoleSingleton::get(const char* Name) const
{
const char* OName {};
for (ILogger* Iter : _aclObservers) {
OName = Iter->Name(); // get the name
OName = Iter->name(); // get the name
if (OName && strcmp(OName, Name) == 0) {
return Iter;
}
@@ -335,7 +335,7 @@ ILogger* ConsoleSingleton::Get(const char* Name) const
return nullptr;
}
int* ConsoleSingleton::GetLogLevel(const char* tag, const bool create)
int* ConsoleSingleton::getLogLevel(const char* tag, const bool create)
{
if (!tag) {
tag = "";
@@ -351,14 +351,14 @@ int* ConsoleSingleton::GetLogLevel(const char* tag, const bool create)
return &ret;
}
void ConsoleSingleton::Refresh() const
void ConsoleSingleton::refresh() const
{
if (_bCanRefresh) {
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
}
}
void ConsoleSingleton::EnableRefresh(const bool enable)
void ConsoleSingleton::enableRefresh(const bool enable)
{
_bCanRefresh = enable;
}
@@ -376,7 +376,7 @@ void ConsoleSingleton::Destruct()
_pcSingleton = nullptr;
}
ConsoleSingleton& ConsoleSingleton::Instance()
ConsoleSingleton& ConsoleSingleton::instance()
{
// not initialized?
if (!_pcSingleton) {
@@ -552,8 +552,8 @@ PyObject* ConsoleSingleton::sPyMessage(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance()
.Send<LogStyle::Message, IntendedRecipient::Developer, ContentType::Untranslatable>(
instance()
.send<LogStyle::Message, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
@@ -565,7 +565,7 @@ PyObject* ConsoleSingleton::sPyWarning(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance().Warning(notifier, "%s", msg);
instance().warning(notifier, "%s", msg);
},
args);
}
@@ -574,8 +574,8 @@ PyObject* ConsoleSingleton::sPyDeveloperWarning(PyObject* /*self*/, PyObject* ar
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance()
.Send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
instance()
.send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
@@ -587,7 +587,7 @@ PyObject* ConsoleSingleton::sPyUserWarning(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance().Send<LogStyle::Warning, IntendedRecipient::User, ContentType::Untranslated>(
instance().send<LogStyle::Warning, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
"%s",
msg);
@@ -599,7 +599,7 @@ PyObject* ConsoleSingleton::sPyTranslatedUserWarning(PyObject* /*self*/, PyObjec
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance().Send<LogStyle::Warning, IntendedRecipient::User, ContentType::Translated>(
instance().send<LogStyle::Warning, IntendedRecipient::User, ContentType::Translated>(
notifier,
"%s",
msg);
@@ -611,7 +611,7 @@ PyObject* ConsoleSingleton::sPyError(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance().Send<LogStyle::Error, IntendedRecipient::All, ContentType::Untranslated>(
instance().send<LogStyle::Error, IntendedRecipient::All, ContentType::Untranslated>(
notifier,
"%s",
msg);
@@ -623,8 +623,8 @@ PyObject* ConsoleSingleton::sPyDeveloperError(PyObject* /*self*/, PyObject* args
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance()
.Send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
instance()
.send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
@@ -636,7 +636,7 @@ PyObject* ConsoleSingleton::sPyUserError(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance().Send<LogStyle::Error, IntendedRecipient::User, ContentType::Untranslated>(
instance().send<LogStyle::Error, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
"%s",
msg);
@@ -648,7 +648,7 @@ PyObject* ConsoleSingleton::sPyTranslatedUserError(PyObject* /*self*/, PyObject*
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance().Send<LogStyle::Error, IntendedRecipient::User, ContentType::Translated>(
instance().send<LogStyle::Error, IntendedRecipient::User, ContentType::Translated>(
notifier,
"%s",
msg);
@@ -660,8 +660,8 @@ PyObject* ConsoleSingleton::sPyLog(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance()
.Send<LogStyle::Log, IntendedRecipient::Developer, ContentType::Untranslatable>(
instance()
.send<LogStyle::Log, IntendedRecipient::Developer, ContentType::Untranslatable>(
notifier,
"%s",
msg);
@@ -673,7 +673,7 @@ PyObject* ConsoleSingleton::sPyCritical(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance().Send<LogStyle::Critical, IntendedRecipient::All, ContentType::Untranslated>(
instance().send<LogStyle::Critical, IntendedRecipient::All, ContentType::Untranslated>(
notifier,
"%s",
msg);
@@ -685,8 +685,8 @@ PyObject* ConsoleSingleton::sPyNotification(PyObject* /*self*/, PyObject* args)
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance()
.Send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
instance()
.send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
notifier,
"%s",
msg);
@@ -698,8 +698,8 @@ PyObject* ConsoleSingleton::sPyTranslatedNotification(PyObject* /*self*/, PyObje
{
return FC_PYCONSOLE_MSG(
[](const std::string& notifier, const char* msg) {
Instance()
.Send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
instance()
.send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
notifier,
"%s",
msg);
@@ -718,7 +718,7 @@ PyObject* ConsoleSingleton::sPyGetStatus(PyObject* /*self*/, PyObject* args)
PY_TRY
{
bool b = false;
const ILogger* pObs = Instance().Get(pstr1);
const ILogger* pObs = instance().get(pstr1);
if (!pObs) {
Py_Return;
}
@@ -764,7 +764,7 @@ PyObject* ConsoleSingleton::sPySetStatus(PyObject* /*self*/, PyObject* args)
PY_TRY
{
const bool status = asBoolean(pyStatus);
if (ILogger* pObs = Instance().get(pstr1)) {
if (ILogger* pObs = instance().get(pstr1)) {
if (strcmp(pstr2, "Log") == 0) {
pObs->bLog = status;
}
@@ -806,8 +806,8 @@ PyObject* ConsoleSingleton::sPyGetObservers(PyObject* /*self*/, PyObject* args)
PY_TRY
{
Py::List list;
for (const auto i : Instance()._aclObservers) {
list.append(Py::String(i->Name() ? i->Name() : ""));
for (const auto i : instance()._aclObservers) {
list.append(Py::String(i->name() ? i->name() : ""));
}
return new_reference_to(list);