mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 09:43:07 -07:00
Remove inclusion of <QThread> from misc.h
This commit is contained in:
parent
be338b969c
commit
5ea1a4c3cc
3 changed files with 19 additions and 11 deletions
16
src/misc.cpp
16
src/misc.cpp
|
@ -41,6 +41,7 @@
|
|||
#include <QProcess>
|
||||
#include <QSettings>
|
||||
#include <QLocale>
|
||||
#include <QThread>
|
||||
|
||||
#ifdef DISABLE_GUI
|
||||
#include <QCoreApplication>
|
||||
|
@ -631,3 +632,18 @@ QString misc::accurateDoubleToString(const double &n, const int &precision, bool
|
|||
else
|
||||
return QString::number(std::floor(n*prec)/prec, 'f', precision);
|
||||
}
|
||||
|
||||
namespace {
|
||||
// Trick to get a portable sleep() function
|
||||
class SleeperThread : public QThread {
|
||||
public:
|
||||
static void msleep(unsigned long msecs)
|
||||
{
|
||||
QThread::msleep(msecs);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void misc::msleep(unsigned long msecs) {
|
||||
SleeperThread::msleep(msecs);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue