mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Drop QThread::msleep wrapper
This commit is contained in:
parent
d5d946dd66
commit
335443e6a0
@ -31,6 +31,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QScopedPointer>
|
||||
#include <QThread>
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
// GUI-only includes
|
||||
@ -168,7 +169,7 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
qDebug("qBittorrent is already running for this user.");
|
||||
|
||||
Utils::Misc::msleep(300);
|
||||
QThread::msleep(300);
|
||||
app->sendParams(params.torrents);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include <QDebug>
|
||||
#include <QProcess>
|
||||
#include <QRegularExpression>
|
||||
#include <QThread>
|
||||
#include <QSysInfo>
|
||||
#include <boost/version.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
@ -641,24 +640,6 @@ QSize Utils::Misc::largeIconSize()
|
||||
}
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
namespace
|
||||
{
|
||||
// Trick to get a portable sleep() function
|
||||
class SleeperThread: public QThread
|
||||
{
|
||||
public:
|
||||
static void msleep(unsigned long msecs)
|
||||
{
|
||||
QThread::msleep(msecs);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void Utils::Misc::msleep(unsigned long msecs)
|
||||
{
|
||||
SleeperThread::msleep(msecs);
|
||||
}
|
||||
|
||||
QString Utils::Misc::osName()
|
||||
{
|
||||
// static initialization for usage in signal handler
|
||||
|
@ -98,8 +98,6 @@ namespace Utils
|
||||
QList<int> intListfromStringList(const QStringList &l);
|
||||
QList<bool> boolListfromStringList(const QStringList &l);
|
||||
|
||||
void msleep(unsigned long msecs);
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
void openPath(const QString& absolutePath);
|
||||
void openFolderSelect(const QString& absolutePath);
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <QMenu>
|
||||
#include <QFileDialog>
|
||||
#include <QBitArray>
|
||||
#include <QThread>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/preferences.h"
|
||||
@ -780,7 +781,7 @@ void PropertiesWidget::renameSelectedFile()
|
||||
int timeout = 10;
|
||||
while (!QDir().rmpath(old_folder.absolutePath()) && timeout > 0) {
|
||||
// FIXME: We should not sleep here (freezes the UI for 1 second)
|
||||
Utils::Misc::msleep(100);
|
||||
QThread::msleep(100);
|
||||
--timeout;
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QSignalMapper>
|
||||
#include <QThread>
|
||||
|
||||
#include <libtorrent/session_status.hpp>
|
||||
|
||||
@ -40,7 +41,6 @@
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/sessionstatus.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/utils/misc.h"
|
||||
|
||||
ComboBoxMenuButton::ComboBoxMenuButton(QWidget *parent, QMenu *menu)
|
||||
: QComboBox(parent)
|
||||
@ -152,7 +152,7 @@ void SpeedWidget::update()
|
||||
m_plot->pushPoint(point);
|
||||
|
||||
QMetaObject::invokeMethod(this, "graphUpdate", Qt::QueuedConnection);
|
||||
Utils::Misc::msleep(1000);
|
||||
QThread::msleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user