From 758cec1a767c056aaf9da36fd411cdf4a8fba32e Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Tue, 14 Aug 2012 00:11:51 +0200 Subject: rewrite live notifications handling using models --- testnotification/testnotification.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'testnotification/testnotification.cpp') diff --git a/testnotification/testnotification.cpp b/testnotification/testnotification.cpp index fa904b9..d541287 100644 --- a/testnotification/testnotification.cpp +++ b/testnotification/testnotification.cpp @@ -8,6 +8,9 @@ TestNotification::TestNotification(Type type, const QString &title, const QStrin _time(QDateTime::currentDateTime()), _title(title), _body(body) { + const int high = 30000, low = 10000; + int rand = qrand() % ((high + 1) - low) + low; + QTimer::singleShot(rand, this, SIGNAL(dismissed())); } Notification::Type TestNotification::type() const @@ -44,5 +47,3 @@ void TestNotification::dismiss() { deleteLater(); // We do not want to keep those around. } - - -- cgit v1.2.3