Remove empty folders on torrent soft deletion

Code clean up
This commit is contained in:
Christophe Dumez 2010-12-29 20:29:55 +00:00
parent 20d90e0e0c
commit cc4e1c5bbe
4 changed files with 16 additions and 19 deletions

View file

@ -640,7 +640,8 @@ void PropertiesWidget::renameSelectedFile() {
// Remove old folder
const QDir old_folder(h.save_path()+"/"+old_path);
int timeout = 10;
while(!misc::removeEmptyTree(old_folder.absolutePath()) && timeout > 0) {
while(!QDir().rmpath(old_folder.absolutePath()) && timeout > 0) {
// XXX: We should not sleep here (freezes the UI for 1 second)
SleeperThread::msleep(100);
--timeout;
}