mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 00:45:46 +08:00
refs #336 Renaming.
This commit is contained in:
@@ -46,20 +46,20 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogCategoryHandler *CLogHandler::handlerForCategory(const QString &category)
|
CLogCategoryHandler *CLogHandler::handlerForCategoryPrefix(const QString &category)
|
||||||
{
|
{
|
||||||
if (! m_categoryHandlers.contains(category))
|
if (! m_categoryPrefixHandlers.contains(category))
|
||||||
{
|
{
|
||||||
m_categoryHandlers[category] = new CLogCategoryHandler(this, m_enableFallThrough);
|
m_categoryPrefixHandlers[category] = new CLogCategoryHandler(this, m_enableFallThrough);
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_categoryHandlers[category];
|
return m_categoryPrefixHandlers[category];
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<CLogCategoryHandler *> CLogHandler::handlersForCategory(const QString &category) const
|
QList<CLogCategoryHandler *> CLogHandler::handlersForCategory(const QString &category) const
|
||||||
{
|
{
|
||||||
QList<CLogCategoryHandler *> m_handlers;
|
QList<CLogCategoryHandler *> m_handlers;
|
||||||
for (auto i = m_categoryHandlers.begin(); i != m_categoryHandlers.end(); ++i)
|
for (auto i = m_categoryPrefixHandlers.begin(); i != m_categoryPrefixHandlers.end(); ++i)
|
||||||
{
|
{
|
||||||
if (category.startsWith(i.key()))
|
if (category.startsWith(i.key()))
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ namespace BlackMisc
|
|||||||
void CLogHandler::enableConsoleOutput(bool enable)
|
void CLogHandler::enableConsoleOutput(bool enable)
|
||||||
{
|
{
|
||||||
m_enableFallThrough = enable;
|
m_enableFallThrough = enable;
|
||||||
for (auto *handler : m_categoryHandlers.values())
|
for (auto *handler : m_categoryPrefixHandlers.values())
|
||||||
{
|
{
|
||||||
handler->enableConsoleOutput(enable);
|
handler->enableConsoleOutput(enable);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ namespace BlackMisc
|
|||||||
//! Tell the CLogHandler to install itself with qInstallMessageHandler.
|
//! Tell the CLogHandler to install itself with qInstallMessageHandler.
|
||||||
void install();
|
void install();
|
||||||
|
|
||||||
//! Return a category handler for subscribing to all messages whose category string starts with the given prefix.
|
//! Return a category handler for subscribing to all messages with a category starting with the given prefix.
|
||||||
CLogCategoryHandler *handlerForCategory(const QString &prefix);
|
CLogCategoryHandler *handlerForCategoryPrefix(const QString &prefix);
|
||||||
|
|
||||||
//! Enable or disable the default Qt handler.
|
//! Enable or disable the default Qt handler.
|
||||||
void enableConsoleOutput(bool enable);
|
void enableConsoleOutput(bool enable);
|
||||||
@@ -66,7 +66,7 @@ namespace BlackMisc
|
|||||||
QtMessageHandler m_oldHandler = nullptr;
|
QtMessageHandler m_oldHandler = nullptr;
|
||||||
bool m_enableFallThrough = true;
|
bool m_enableFallThrough = true;
|
||||||
bool isFallThroughEnabled(const QList<CLogCategoryHandler *> &handlers) const;
|
bool isFallThroughEnabled(const QList<CLogCategoryHandler *> &handlers) const;
|
||||||
QMap<QString, CLogCategoryHandler *> m_categoryHandlers;
|
QMap<QString, CLogCategoryHandler *> m_categoryPrefixHandlers;
|
||||||
QList<CLogCategoryHandler *> handlersForCategory(const QString &category) const;
|
QList<CLogCategoryHandler *> handlersForCategory(const QString &category) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user