From eb2b859a2890715dcff16e2a520c0c713fe4daf5 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 27 Nov 2010 14:27:50 +0100 Subject: Allow removing non existant files If a file didn't exist on the FS it wasn't possible to remove it. The checks were too zealous. --- filestreemodel.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'filestreemodel.cpp') diff --git a/filestreemodel.cpp b/filestreemodel.cpp index db16d95..35ae8bc 100644 --- a/filestreemodel.cpp +++ b/filestreemodel.cpp @@ -413,11 +413,6 @@ bool FilesTreeModel::addFile(const QString &fullPath, int type, int quality, int } bool FilesTreeModel::deleteFile(const QModelIndex &file){ - QString fullPath = file.data(FullPathRole).toString(); - QFileInfo fi(fullPath); - if(!fi.exists()){ - return false; - } QVariant fileId = file.data(FilesIdRole); mDb.transaction(); mDeleteFileQuery->bindValue(":id", fileId); @@ -425,10 +420,6 @@ bool FilesTreeModel::deleteFile(const QModelIndex &file){ mDb.rollback(); return false; } - if(!QFile::remove(fullPath)){ - mDb.rollback(); - return false; - } removeRows(file.row(), 1, file.parent()); mDb.commit(); return true; -- cgit v1.2.3-70-g09d2