Fix FTBFS on Ubuntu 18.04

This commit is contained in:
Laurent Trinques
2020-06-14 08:26:52 +02:00
parent 22e619d6b9
commit 496b8f302a

View File

@@ -25,8 +25,10 @@
#include <QtCore/QDateTime>
#include <QtCore/QByteArray>
#include <QtCore/QSharedMemory>
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) // ### Qt 6: remove
#else
#include <QRandomGenerator>
#endif
#include "singleapplication.h"
#include "singleapplication_p.h"
@@ -100,7 +102,7 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
d->memory->unlock();
// Random sleep here limits the probability of a collision between two racing apps
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) // ### Qt 6: remove
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) // ### Qt 6: remove
qsrand( QDateTime::currentMSecsSinceEpoch() % std::numeric_limits<uint>::max() );
QThread::sleep( 8 + static_cast <unsigned long>( static_cast <float>( qrand() ) / RAND_MAX * 10 ) );
#else