File indexing completed on 2025-01-19 04:22:43

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstractcommand.h"
0010 
0011 namespace Git
0012 {
0013 
0014 class LIBKOMMIT_EXPORT CommandClean : public AbstractCommand
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     enum CleanupType { AllUntrackedFiles, NonIgnoredUntrackedFiles, IgnoredFiles };
0020     CommandClean();
0021 
0022     Q_REQUIRED_RESULT QStringList generateArgs() const override;
0023 
0024     Q_REQUIRED_RESULT bool dryRun() const;
0025     void setDryRun(bool newDryRun);
0026     Q_REQUIRED_RESULT CleanupType getType() const;
0027     void setType(CleanupType newType);
0028     Q_REQUIRED_RESULT bool removeUntrackedDirectories() const;
0029     void setRemoveUntrackedDirectories(bool newRemoveUntrackedDirectories);
0030 
0031 private:
0032     bool mDryRun{false};
0033     CleanupType type{NonIgnoredUntrackedFiles};
0034     bool mRemoveUntrackedDirectories{false};
0035 };
0036 
0037 }