Fix stuffs
This commit is contained in:
@@ -41,6 +41,7 @@ public:
|
||||
FilePath& RemoveFileName();
|
||||
FilePath& MakeAbsolute();
|
||||
FilePath& SkipRoot();
|
||||
FilePath& StripToFileName();
|
||||
|
||||
public:
|
||||
FilePath& operator=(const FilePath& filePath);
|
||||
|
@@ -18,7 +18,6 @@ public:
|
||||
enum class _UploadStatus : unsigned
|
||||
{
|
||||
NotFound,
|
||||
Copying,
|
||||
Queued,
|
||||
Modified,
|
||||
Uploading,
|
||||
@@ -53,17 +52,11 @@ public:
|
||||
private:
|
||||
SQLite::Database _uploadDatabase;
|
||||
std::mutex _uploadMutex;
|
||||
CAutoThread _fileThread;
|
||||
std::mutex _fileQueueMutex;
|
||||
std::mutex _fileActionMutex;
|
||||
SString _activeSiaPath;
|
||||
std::deque<std::function<void()>> _fileQueue;
|
||||
|
||||
private:
|
||||
void FileAction(const CSiaCurl& siaCurl, const SString& siaPath, const SString& filePath, const SString& tempSourcePath, const SString& siaDriveFilePath, const bool& remove);
|
||||
void FileThreadCallback(const CSiaCurl& siaCurl, CSiaDriveConfig* siaDriveConfig);
|
||||
void HandleFileRemove(const CSiaCurl& siaCurl, const SString& siaPath, const SString& siaDriveFilePath);
|
||||
void HandleAddFile(const SString& siaPath, const SString& filePath, const SString& tempSourcePath, const SString& siaDriveFilePath);
|
||||
bool CreateSiaDriveFile(const SString& siaPath, const SString& filePath, const SString& tempSourcePath, const SString& siaDriveFilePath);
|
||||
void UpdateFileQueueOnStartup();
|
||||
void DeleteFilesRemovedFromSia(const CSiaCurl& siaCurl, CSiaDriveConfig* siaDriveConfig, const bool& isStartup = false);
|
||||
|
||||
@@ -121,9 +114,10 @@ class UploadAddedToQueue :
|
||||
public CEvent
|
||||
{
|
||||
public:
|
||||
UploadAddedToQueue(const SString& siaPath, const SString& filePath) :
|
||||
UploadAddedToQueue(const SString& siaPath, const SString& filePath, const SString& siaDriveFilePath) :
|
||||
_siaPath(siaPath),
|
||||
_filePath(filePath)
|
||||
_filePath(filePath),
|
||||
_siaDriveFilePath(siaDriveFilePath)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -136,16 +130,17 @@ public:
|
||||
private:
|
||||
const SString _siaPath;
|
||||
const SString _filePath;
|
||||
const SString _siaDriveFilePath;
|
||||
|
||||
public:
|
||||
virtual SString GetSingleLineMessage() const override
|
||||
{
|
||||
return L"UploadAddedToQueue|SP|" + _siaPath + L"|FP|" + _filePath;
|
||||
return L"UploadAddedToQueue|SP|" + _siaPath + L"|FP|" + _filePath + "|SFP|" + _siaDriveFilePath;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<CEvent> Clone() const override
|
||||
{
|
||||
return std::shared_ptr<CEvent>(new UploadAddedToQueue(_siaPath, _filePath));
|
||||
return std::shared_ptr<CEvent>(new UploadAddedToQueue(_siaPath, _filePath, _siaDriveFilePath));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -751,40 +746,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class NewFileAdded :
|
||||
public CEvent
|
||||
{
|
||||
public:
|
||||
NewFileAdded(const SString& siaPath, const SString& filePath, const SString& siaDriveFilePath) :
|
||||
_siaPath(siaPath),
|
||||
_filePath(filePath),
|
||||
_siaDriveFilePath(siaDriveFilePath)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~NewFileAdded()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
const SString _siaPath;
|
||||
const SString _filePath;
|
||||
const SString _siaDriveFilePath;
|
||||
|
||||
public:
|
||||
virtual SString GetSingleLineMessage() const override
|
||||
{
|
||||
return L"NewFileAdded|SP|" + _siaPath + L"|FP|" + _filePath + L"|SDP|" + _siaDriveFilePath;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<CEvent> Clone() const override
|
||||
{
|
||||
return std::shared_ptr<CEvent>(new NewFileAdded(_siaPath, _filePath, _siaDriveFilePath));
|
||||
}
|
||||
};
|
||||
|
||||
class FileRemoveAdded :
|
||||
public CEvent
|
||||
{
|
||||
|
Reference in New Issue
Block a user