aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-03-10 08:23:18 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-03-10 08:23:18 +0000
commit15fa3fe871c749802d8a9d3322fe7f517e7d7d25 (patch)
tree5dda70b9d5018f218c8af07fe84bb9a3d3b65733
parent519d53a7e8ce3057a3cacc4b5dd6737efb17f5d0 (diff)
downloadqxmpp-15fa3fe871c749802d8a9d3322fe7f517e7d7d25.tar.gz
only emit message if logging type is "SIGNAL"
-rw-r--r--source/QXmppLogger.cpp8
-rw-r--r--source/QXmppLogger.h8
2 files changed, 6 insertions, 10 deletions
diff --git a/source/QXmppLogger.cpp b/source/QXmppLogger.cpp
index dc34a36d..d67ff047 100644
--- a/source/QXmppLogger.cpp
+++ b/source/QXmppLogger.cpp
@@ -79,7 +79,6 @@ QXmppLogger::LoggingType QXmppLogger::loggingType()
void QXmppLogger::log(QXmppLogger::MessageType type, const QString& str)
{
- bool emitMessageSignal = true;
switch(m_loggingType)
{
case QXmppLogger::FILE:
@@ -95,15 +94,12 @@ void QXmppLogger::log(QXmppLogger::MessageType type, const QString& str)
case QXmppLogger::STDOUT:
std::cout << typeName(type) << " " << qPrintable(str) << std::endl;
break;
- case QXmppLogger::SIGNALONLY:
- emitMessageSignal = true;
+ case QXmppLogger::SIGNAL:
+ emit message(type, str);
break;
default:
- emitMessageSignal = false;
break;
}
- if(emitMessageSignal)
- emit message(type, str);
}
QXmppLogger::LoggingType QXmppLogger::getLoggingType()
diff --git a/source/QXmppLogger.h b/source/QXmppLogger.h
index cf8f9290..0629e1fe 100644
--- a/source/QXmppLogger.h
+++ b/source/QXmppLogger.h
@@ -34,10 +34,10 @@ class QXmppLogger : public QObject
public:
enum LoggingType
{
- NONE = 0,
- FILE,
- STDOUT,
- SIGNALONLY
+ NONE = 0, ///< Log messages are discarded
+ FILE, ///< Log messages are written to a file
+ STDOUT, ///< Log messages are written to the standard output
+ SIGNAL, ///< Log messages are emitted as a signal
};
enum MessageType