- Move deletion from hard drive to a thread to avoid GUI freezing

This commit is contained in:
Christophe Dumez 2007-02-19 16:34:23 +00:00
parent f017d29359
commit f4be28c014
5 changed files with 19 additions and 5 deletions

View file

@ -14,6 +14,7 @@
- BUGFIX: Force a refresh of download list when the window is shown (avoid delay)
- BUGFIX: Fixed deletion from hard drive (failed for non-empty folders)
- BUGFIX: qBittorrent now identifies its version correctly on the network
- BUGFIX: Preventing GUI from freezing when deleting a download permanently
- COSMETIC: Replaced OSD messages by systray messages
* Tue Nov 28 2006 - Christophe Dumez <chris@qbittorrent.org> - v0.8.0

1
TODO
View file

@ -36,6 +36,5 @@
// In v0.9.0
- Wait for libtorrent v0.12 official release
- Move deletion from hard drive to a thread to avoid GUI freezing
- Should create options dialog only when needed to save up some memory
- Download from RSS feeds

View file

@ -1081,10 +1081,21 @@ void GUI::deletePermanently(){
torrentBackup.remove(fileName+".incremental");
torrentBackup.remove(fileName+".pieces");
torrentBackup.remove(fileName+".savepath");
// Remove from Hard drive TODO
// Remove from Hard drive
qDebug("Removing this on hard drive: %s", qPrintable(savePath+QDir::separator()+fileName));
if(!misc::removePath(savePath+QDir::separator()+fileName)){
qDebug("Couldn't remove the download on the hard drive");
// Deleting in a thread to avoid GUI freeze
deleteThread *deleter = new deleteThread(savePath+QDir::separator()+fileName);
deleters << deleter;
int i = 0;
while(i < deleters.size()){
deleter = deleters.at(i);
if(deleter->isFinished()){
qDebug("Delete thread has finished, deleting it");
deleters.removeAt(i);
delete deleter;
}else{
++i;
}
}
// Update info bar
setInfoBar("'" + fileName +"' "+tr("removed.", "<file> removed."));

View file

@ -43,6 +43,8 @@
#include "about_imp.h"
#include "previewSelect.h"
#include "trackerLogin.h"
#include "deleteThread.h"
#define TIME_TRAY_BALLOON 5000
@ -72,6 +74,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
downloadThread *downloader;
downloadFromURL *downloadFromURLDialog;
bool DHTEnabled;
QList<deleteThread*> deleters;
// GUI related
options_imp *options;
createtorrent *createWindow;

View file

@ -102,7 +102,7 @@ HEADERS += GUI.h misc.h options_imp.h about_imp.h \
PropListDelegate.h previewSelect.h \
PreviewListDelegate.h trackerLogin.h \
downloadThread.h downloadFromURLImp.h \
torrentAddition.h
torrentAddition.h deleteThread.h
FORMS += MainWindow.ui options.ui about.ui \
properties.ui createtorrent.ui preview.ui \
login.ui downloadFromURL.ui addTorrentDialog.ui