use portable QTimer to initialize the rand function.

This commit is contained in:
Klaas Freitag 2012-03-13 15:42:29 +01:00
parent 753be4d2bc
commit 1a20d42424

View file

@ -35,7 +35,7 @@ Folder::Folder(const QString &alias, const QString &path, QObject *parent)
_online(false), _online(false),
_enabled(true) _enabled(true)
{ {
qsrand(time(0)); qsrand(QTime::currentTime().msec());
_pollTimer->setSingleShot(true); _pollTimer->setSingleShot(true);
int polltime = DEFAULT_POLL_INTERVAL_SEC - 2000+ (int)( 4000.0*qrand()/(RAND_MAX+1.0)); int polltime = DEFAULT_POLL_INTERVAL_SEC - 2000+ (int)( 4000.0*qrand()/(RAND_MAX+1.0));