diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-10 16:30:38 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-10 16:30:38 +0200 |
| commit | dfbb501a928b0eb0dec1582a2e124aea95296a35 (patch) | |
| tree | ef225417cea7a9aa83ce80cda91a621556808d6c /src/base | |
| parent | ca58ee37157f4ae9635ccdf3ab662c31ba0e6904 (diff) | |
| download | qxmpp-dfbb501a928b0eb0dec1582a2e124aea95296a35.tar.gz | |
replace "incrementCounter" by "updateCounter"
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/QXmppLogger.cpp | 27 | ||||
| -rw-r--r-- | src/base/QXmppLogger.h | 8 |
2 files changed, 18 insertions, 17 deletions
diff --git a/src/base/QXmppLogger.cpp b/src/base/QXmppLogger.cpp index 34ff2f2f..4b3ec625 100644 --- a/src/base/QXmppLogger.cpp +++ b/src/base/QXmppLogger.cpp @@ -62,12 +62,12 @@ static QString formatted(QXmppLogger::MessageType type, const QString& text) static void relaySignals(QXmppLoggable *from, QXmppLoggable *to) { - QObject::connect(from, SIGNAL(incrementCounter(QString)), - 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))); + QObject::connect(from, SIGNAL(updateCounter(QString,qint64)), + to, SIGNAL(updateCounter(QString,qint64))); } /// Constructs a new QXmppLoggable. @@ -93,12 +93,12 @@ void QXmppLoggable::childEvent(QChildEvent *event) if (event->added()) { relaySignals(child, this); } else if (event->removed()) { - disconnect(child, SIGNAL(incrementCounter(QString)), - 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))); + disconnect(child, SIGNAL(updateCounter(QString,qint64)), + this, SIGNAL(updateCounter(QString,qint64))); } } /// \endcond @@ -192,15 +192,6 @@ void QXmppLogger::setMessageTypes(QXmppLogger::MessageTypes types) d->messageTypes = types; } -/// Increments the given \a counter. -/// -/// NOTE: the base implementation does nothing. - -void QXmppLogger::incrementCounter(const QString &counter) -{ - Q_UNUSED(counter); -} - /// Add a logging message. /// /// \param type @@ -242,6 +233,16 @@ void QXmppLogger::setGauge(const QString &gauge, double value) Q_UNUSED(value); } +/// Updates the given \a counter by \a amount. +/// +/// NOTE: the base implementation does nothing. + +void QXmppLogger::updateCounter(const QString &counter, qint64 amount) +{ + Q_UNUSED(counter); + Q_UNUSED(amount); +} + /// 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 b6181b96..9ccef8f5 100644 --- a/src/base/QXmppLogger.h +++ b/src/base/QXmppLogger.h @@ -89,8 +89,8 @@ public: void setMessageTypes(QXmppLogger::MessageTypes types); public slots: - virtual void incrementCounter(const QString &counter); virtual void setGauge(const QString &gauge, double value); + virtual void updateCounter(const QString &counter, qint64 amount); void log(QXmppLogger::MessageType type, const QString& text); void reopen(); @@ -166,14 +166,14 @@ protected: } 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); + + /// Updates the given \a counter by \a amount. + void updateCounter(const QString &counter, qint64 amount = 1); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QXmppLogger::MessageTypes) |
