mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Reverted a previous commit. Transfer lists refreshers aren't in separate threads anymore: too buggy
This commit is contained in:
parent
95fc9e3a72
commit
4e4b0ed9ff
6 changed files with 13 additions and 99 deletions
32
src/GUI.h
32
src/GUI.h
|
@ -23,9 +23,7 @@
|
|||
#define GUI_H
|
||||
|
||||
#include <QProcess>
|
||||
#include <QThread>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QMutex>
|
||||
#include <libtorrent/torrent_handle.hpp>
|
||||
|
||||
#include "ui_MainWindow.h"
|
||||
|
@ -47,7 +45,6 @@ class about;
|
|||
class previewSelect;
|
||||
class options_imp;
|
||||
class QStandardItemModel;
|
||||
class DownloadListRefresher;
|
||||
|
||||
using namespace libtorrent;
|
||||
namespace fs = boost::filesystem;
|
||||
|
@ -67,6 +64,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||
// GUI related
|
||||
options_imp *options;
|
||||
createtorrent *createWindow;
|
||||
QTimer *refresher;
|
||||
QSystemTrayIcon *myTrayIcon;
|
||||
QMenu *myTrayIconMenu;
|
||||
about *aboutdlg;
|
||||
|
@ -79,8 +77,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||
bool force_exit;
|
||||
bool delayedSorting;
|
||||
Qt::SortOrder delayedSortingOrder;
|
||||
DownloadListRefresher *refresher;
|
||||
QMutex DLListAccess;
|
||||
// Keyboard shortcuts
|
||||
QShortcut *createShortcut;
|
||||
QShortcut *openShortcut;
|
||||
|
@ -115,6 +111,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
|
||||
void on_actionAbout_triggered();
|
||||
void setInfoBar(QString info, QString color="black");
|
||||
void updateDlList(bool force=false);
|
||||
void on_actionCreate_torrent_triggered();
|
||||
void on_actionClearLog_triggered();
|
||||
void on_actionWebsite_triggered();
|
||||
|
@ -193,7 +190,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||
void setTabText(int index, QString text);
|
||||
void updateFileSize(QString hash);
|
||||
void sortProgressColumnDelayed();
|
||||
void updateDlList(bool force=false);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
@ -206,30 +202,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||
// Methods
|
||||
int getRowFromHash(QString hash) const;
|
||||
QPoint screenCenter();
|
||||
int getCurrentTab() const;
|
||||
};
|
||||
|
||||
class DownloadListRefresher : public QThread {
|
||||
private:
|
||||
GUI* parent;
|
||||
bool abort;
|
||||
public:
|
||||
DownloadListRefresher(GUI* parent){
|
||||
this->parent = parent;
|
||||
abort = false;
|
||||
}
|
||||
~DownloadListRefresher(){
|
||||
abort = true;
|
||||
wait();
|
||||
}
|
||||
protected:
|
||||
void run(){
|
||||
forever{
|
||||
if(abort) return;
|
||||
((GUI*)parent)->updateDlList();
|
||||
msleep(1500);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue