diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-07-07 01:11:52 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2015-07-07 01:11:52 +0200 |
commit | 28af9a55c39e44305b7f6234d83597ad75ea6775 (patch) | |
tree | 15992491a7fef5b476e3ffe4e23079c7714a6923 /util.cpp | |
parent | b13216157165c801ba493588df0a409178db9519 (diff) |
cleanup
Diffstat (limited to 'util.cpp')
-rw-r--r-- | util.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -4,7 +4,9 @@ #include <QString> #include <QDir> #include "util.h" - +#ifdef Q_OS_WIN +#include <windows.h> +#endif QProcessEnvironment Util::_env; bool Util::_envInitialised; @@ -112,3 +114,18 @@ bool Util::checkConfig(QString passStore, QString passExecutable, QString gpgExe { return !QFile(passStore + ".gpg-id").exists() || (!QFile(passExecutable).exists() && !QFile(gpgExecutable).exists()); } + + +/** + * @brief Util::qSleep + * @param ms + */\ +void Util::qSleep(int ms) +{ +#ifdef Q_OS_WIN + Sleep(uint(ms)); +#else + struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; + nanosleep(&ts, NULL); +#endif +} |