diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-08-14 00:11:51 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-08-14 00:11:51 +0200 |
commit | 758cec1a767c056aaf9da36fd411cdf4a8fba32e (patch) | |
tree | 341cb8705e2e6c02d713860c8403ac8a3630a78a /testnotification | |
parent | 542d3489f45111aaca5514495af3847cf39e335b (diff) | |
download | sowatch-758cec1a767c056aaf9da36fd411cdf4a8fba32e.tar.gz sowatch-758cec1a767c056aaf9da36fd411cdf4a8fba32e.zip |
rewrite live notifications handling using models
Diffstat (limited to 'testnotification')
-rw-r--r-- | testnotification/testnotification.cpp | 5 | ||||
-rw-r--r-- | testnotification/testnotificationprovider.cpp | 4 |
2 files changed, 7 insertions, 2 deletions
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. } - - diff --git a/testnotification/testnotificationprovider.cpp b/testnotification/testnotificationprovider.cpp index f66ae89..230237f 100644 --- a/testnotification/testnotificationprovider.cpp +++ b/testnotification/testnotificationprovider.cpp @@ -13,6 +13,10 @@ TestNotificationProvider::TestNotificationProvider(QObject *parent) : QTimer::singleShot(1200, this, SLOT(generateNotification())); QTimer::singleShot(1400, this, SLOT(generateNotification())); QTimer::singleShot(1600, this, SLOT(generateNotification())); + QTimer::singleShot(1800, this, SLOT(generateNotification())); + QTimer::singleShot(2000, this, SLOT(generateNotification())); + QTimer::singleShot(2200, this, SLOT(generateNotification())); + QTimer::singleShot(2400, this, SLOT(generateInitialNotification())); connect(_timer, SIGNAL(timeout()), SLOT(generateNotification())); _timer->setInterval(60000); //_timer->start(); |