diff options
author | Arno <am@disconnect.de> | 2010-11-27 14:27:50 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-11-27 14:27:50 +0100 |
commit | eb2b859a2890715dcff16e2a520c0c713fe4daf5 (patch) | |
tree | 9db8ef1e52725140d72939c0d3ed5ff72a206cd8 | |
parent | 6b75aa15325b75128c3bae6bf7eb4c9ac57e4c5f (diff) | |
download | SheMov-eb2b859a2890715dcff16e2a520c0c713fe4daf5.tar.gz SheMov-eb2b859a2890715dcff16e2a520c0c713fe4daf5.tar.bz2 SheMov-eb2b859a2890715dcff16e2a520c0c713fe4daf5.zip |
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.
-rw-r--r-- | filestreemodel.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
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; |