summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mpris2/interfacetest.cpp10
-rw-r--r--mpris2/interfacetest.h7
2 files changed, 11 insertions, 6 deletions
diff --git a/mpris2/interfacetest.cpp b/mpris2/interfacetest.cpp
index 4df0d59..12dfca9 100644
--- a/mpris2/interfacetest.cpp
+++ b/mpris2/interfacetest.cpp
@@ -132,8 +132,6 @@ bool InterfaceTest::checkPropValid(const QString& propName, QVariant::Type expTy
} else if (oldProps.contains(propName)) {
// FIXME: QVariant equality only works for builtin types
if (props[propName] != oldProps[propName]) {
- qDebug() << "Old value:" << oldProps[propName];
- qDebug() << "New value:" << props[propName];
outOfDateProperties.insert(propName, props[propName]);
props[propName] = oldProps[propName];
}
@@ -211,7 +209,13 @@ void InterfaceTest::delayedIncrementalCheck()
{
QVariantMap::const_iterator i = outOfDateProperties.constBegin();
while (i != outOfDateProperties.constEnd()) {
- emit interfaceWarning(Property, i.key(), "Property was not updated via PropertiesChanged signal");
+ int warningsSoFar = propertyUpdateWarningCount.value(i.key());
+ if (warningsSoFar < 4) {
+ emit interfaceWarning(Property, i.key(), "Property was not updated via PropertiesChanged signal");
+ } else if (warningsSoFar == 4) {
+ emit interfaceWarning(Property, i.key(), "Property was not updated via PropertiesChanged signal [further warnings for this property suppressed]");
+ }
+ propertyUpdateWarningCount.insert(i.key(), warningsSoFar + 1);
props[i.key()] = i.value();
++i;
}
diff --git a/mpris2/interfacetest.h b/mpris2/interfacetest.h
index 0d2da75..c400fec 100644
--- a/mpris2/interfacetest.h
+++ b/mpris2/interfacetest.h
@@ -129,9 +129,10 @@ namespace Mpris2
QVariantMap props;
private:
- QDBusInterface* propsIface;
- QVariantMap outOfDateProperties; // prop name -> new value
- QTimer* delayedCheckTimer;
+ QDBusInterface* propsIface;
+ QVariantMap outOfDateProperties; // prop name -> new value
+ QTimer* delayedCheckTimer;
+ QMap<QString,uint> propertyUpdateWarningCount;
};
}