Browse Source

proper qt version check

import_zecw
Aditya Kulkarni 6 years ago
parent
commit
af4d99aa27
  1. 4
      .gitignore
  2. 5
      src/main.cpp
  3. 2
      src/precompiled.h

4
.gitignore

@ -22,3 +22,7 @@ zec-qt-wallet_resource*
workspace.code-workspace
*.zip
*.tar.gz
*.xcsettings
.DS_Store
*.mak
*.plist

5
src/main.cpp

@ -19,14 +19,17 @@ int main(int argc, char *argv[])
#endif
// QRandomGenerator generates a secure random number, which we use to seed.
#if QT_VERSION >= 0x051000
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
unsigned int seed = QRandomGenerator::securelySeeded().generate();
qDebug() << "yes" << QT_VERSION;
#else
// This will be used only during debugging for compatibility reasons
unsigned int seed = std::time(0);
qDebug() << "no" << QT_VERSION;
#endif
std::srand(seed);
Settings::init();
Settings::getInstance()->setExecName(argv[0]);

2
src/precompiled.h

@ -9,7 +9,7 @@
#include <QtGlobal>
#if QT_VERSION >= 0x051000
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator>
#endif

Loading…
Cancel
Save