aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-09-10 14:58:49 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-09-10 14:58:49 +0200
commitca58ee37157f4ae9635ccdf3ab662c31ba0e6904 (patch)
treefe4201a74d7f445c1a8cdd0c1ac4a69343094646 /src/base
parent858c95cd64794ae78bf3f39805b933c6289bd84d (diff)
downloadqxmpp-ca58ee37157f4ae9635ccdf3ab662c31ba0e6904.tar.gz
add counters
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppLogger.cpp14
-rw-r--r--src/base/QXmppLogger.h5
2 files changed, 19 insertions, 0 deletions
diff --git a/src/base/QXmppLogger.cpp b/src/base/QXmppLogger.cpp
index 2bce8690..34ff2f2f 100644
--- a/src/base/QXmppLogger.cpp
+++ b/src/base/QXmppLogger.cpp
@@ -66,6 +66,8 @@ static void relaySignals(QXmppLoggable *from, QXmppLoggable *to)
to, SIGNAL(incrementCounter(QString)));
QObject::connect(from, SIGNAL(logMessage(QXmppLogger::MessageType,QString)),
to, SIGNAL(logMessage(QXmppLogger::MessageType,QString)));
+ QObject::connect(from, SIGNAL(setGauge(QString,double)),
+ to, SIGNAL(setGauge(QString,double)));
}
/// Constructs a new QXmppLoggable.
@@ -95,6 +97,8 @@ void QXmppLoggable::childEvent(QChildEvent *event)
this, SIGNAL(incrementCounter(QString)));
disconnect(child, SIGNAL(logMessage(QXmppLogger::MessageType,QString)),
this, SIGNAL(logMessage(QXmppLogger::MessageType,QString)));
+ disconnect(child, SIGNAL(setGauge(QString,double)),
+ this, SIGNAL(setGauge(QString,double)));
}
}
/// \endcond
@@ -228,6 +232,16 @@ void QXmppLogger::log(QXmppLogger::MessageType type, const QString& text)
}
}
+/// Sets the given \a gauge to \a value.
+///
+/// NOTE: the base implementation does nothing.
+
+void QXmppLogger::setGauge(const QString &gauge, double value)
+{
+ Q_UNUSED(gauge);
+ Q_UNUSED(value);
+}
+
/// Returns the path to which logging messages should be written.
///
/// \sa loggingType()
diff --git a/src/base/QXmppLogger.h b/src/base/QXmppLogger.h
index 7178d960..b6181b96 100644
--- a/src/base/QXmppLogger.h
+++ b/src/base/QXmppLogger.h
@@ -90,6 +90,8 @@ public:
public slots:
virtual void incrementCounter(const QString &counter);
+ virtual void setGauge(const QString &gauge, double value);
+
void log(QXmppLogger::MessageType type, const QString& text);
void reopen();
@@ -167,6 +169,9 @@ signals:
/// Increment the given \a counter.
void incrementCounter(const QString &counter);
+ /// Sets the given \a gauge to \a value.
+ void setGauge(const QString &gauge, double value);
+
/// This signal is emitted to send logging messages.
void logMessage(QXmppLogger::MessageType type, const QString &msg);
};