CommandDelete: Rework deletion logic

Allow deleting files from index which still exist
on the fileystem without passing their path to "qss delete".

Thus: "qss delete --deleted" deletes all files which
don't exist anymore.

Also, fix some bugs in offset calculation.
此提交包含在:
2020-08-30 18:12:42 +02:00
父節點 1455d8ac1b
當前提交 a6f73d724a
共有 2 個檔案被更改,包括 94 行新增76 行删除

查看文件

@@ -5,12 +5,12 @@
class CommandDelete : public Command
{
public:
using Command::Command;
using Command::Command;
int handle(QStringList arguments) override;
int handle(QStringList arguments) override;
private:
int removeNonExistent(bool verbose, bool dryRun, QString pattern);
int removePaths(const QStringList &paths, bool verbose, bool dryRun);
int remove(QString pattern, bool onlyDeleted, bool verbose, bool dryRun);
int removePaths(const QStringList &paths, bool verbose, bool dryRun);
};
#endif // COMMANDDELETE_H