mirror of
https://github.com/transmission/transmission.git
synced 2025-12-27 13:41:17 +00:00
fix: only append '.added' suffix to watchdir files (#5705)
This commit is contained in:
23
qt/AddData.h
23
qt/AddData.h
@@ -14,6 +14,14 @@
|
||||
class AddData
|
||||
{
|
||||
public:
|
||||
// what to do with the source file after adding the torrent
|
||||
enum class FilenameDisposal
|
||||
{
|
||||
NoAction,
|
||||
Delete,
|
||||
Rename
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NONE,
|
||||
@@ -36,6 +44,18 @@ public:
|
||||
QString readableName() const;
|
||||
QString readableShortName() const;
|
||||
|
||||
void disposeSourceFile() const;
|
||||
|
||||
constexpr void setFileDisposal(FilenameDisposal disposal)
|
||||
{
|
||||
disposal_ = disposal;
|
||||
}
|
||||
|
||||
constexpr auto& fileDisposal() const noexcept
|
||||
{
|
||||
return disposal_;
|
||||
}
|
||||
|
||||
static std::optional<AddData> create(QString const& str)
|
||||
{
|
||||
if (auto ret = AddData{ str }; ret.type != NONE)
|
||||
@@ -51,4 +71,7 @@ public:
|
||||
QString filename;
|
||||
QString magnet;
|
||||
QUrl url;
|
||||
|
||||
private:
|
||||
std::optional<FilenameDisposal> disposal_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user