Feature: persist file manager transfer history
History used to jump to the last directory merely visited, and lived only in memory. Now it is recorded only when a transfer actually starts (the four copy/transfer handlers) and persisted as an MRU list of the last 10 directories in THIS_CFG [file_history], keyed "local" plus one key per clientID. Paths are stored verbatim; '|' joins the list. The history handlers read the head of that list; the rest is kept for the future dropdown. Also translated the four zh_TW status messages, which were still simplified copies. Server-only; no protocol or client change. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
ca4e85826f
commit
ab83f5d685
3 files changed
+87
-45
No files matched your search
@@ -289,10 +289,12 @@ private:
|
||||
void CollectFilesRecursive(const std::string& dirPath, std::vector<std::string>& files);
|
||||
float m_fScalingFactor;
|
||||
|
||||
// 历史路径记录(静态,跨实例共享)
|
||||
static CString s_strLocalHistoryPath;
|
||||
static std::map<uint64_t, CString> s_mapRemoteHistoryPath;
|
||||
static CLock s_lockHistory; // 保护历史路径的锁
|
||||
// 传输目录历史:持久化在 THIS_CFG 的 [file_history] 节,MRU 列表最多 kTransferHistoryMax 条。
|
||||
// 只有真正发起过文件传输的目录才记录(单纯浏览目录不算),见 RecordTransferHistory。
|
||||
enum { kTransferHistoryMax = 10 };
|
||||
static std::vector<CString> LoadTransferHistory(bool bLocal, uint64_t clientID);
|
||||
static void PushTransferHistory(bool bLocal, uint64_t clientID, const CString& path);
|
||||
void RecordTransferHistory();
|
||||
|
||||
// 获取有效的客户端ID(优先用 m_ClientID,否则通过 IP 找主连接)
|
||||
uint64_t GetClientID() const;
|
||||
|
||||
Reference in new issue
Block a user