From 054a38b9d027a74cbf17f2c626d6bc8851455f9a Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 11 Jul 2014 19:51:42 +0200 Subject: [PATCH] --runtime warnings --- src/plasma/private/timetracker.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/plasma/private/timetracker.cpp b/src/plasma/private/timetracker.cpp index bb809a597..cdfe94bdd 100644 --- a/src/plasma/private/timetracker.cpp +++ b/src/plasma/private/timetracker.cpp @@ -127,11 +127,15 @@ void TimeTracker::propertyChanged() QMetaProperty prop = mo->property(i); if (prop.notifySignalIndex() == senderSignalIndex()) { QString val; - QVariant var = prop.read(parent()); - if(var.canConvert()) { - val = var.toString(); - } else { - val = QString("").arg(var.typeName()); + if (prop.type() < QVariant::UserType) { + QVariant var = prop.read(parent()); + if(var.canConvert()) { + val = var.toString(); + } + } + + if (val.isEmpty()) { + val = QString("").arg(prop.typeName()); } m_history.events.append(TimeEvent { QDateTime::currentDateTime(), QString("property %1 changed to %2").arg(prop.name()).arg(val)}); break;