| 11 | } |
| 12 | |
| 13 | void ComicsRemover::process() |
| 14 | { |
| 15 | QString currentComicPath; |
| 16 | QListIterator<QModelIndex> i(indexList); |
| 17 | QListIterator<QString> i2(paths); |
| 18 | i.toBack(); |
| 19 | i2.toBack(); |
| 20 | |
| 21 | while (i.hasPrevious() && i2.hasPrevious()) { |
| 22 | QModelIndex mi = i.previous(); |
| 23 | currentComicPath = i2.previous(); |
| 24 | if (QFile::moveToTrash(currentComicPath)) |
| 25 | emit remove(mi.row()); |
| 26 | else if (QFile::remove(currentComicPath)) |
| 27 | emit remove(mi.row()); |
| 28 | else |
| 29 | emit removeError(); |
| 30 | } |
| 31 | |
| 32 | emit finished(); |
| 33 | emit removedItemsFromFolder(parentId); |
| 34 | } |
| 35 | |
| 36 | FoldersRemover::FoldersRemover(QModelIndexList &il, QList<QString> &ps, QObject *parent) |
| 37 | : QObject(parent), indexList(il), paths(ps) |
no test coverage detected