[FarGroup/FarManager] master: Refactoring (cee7e76f5)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Jul 18, 2026, 10:30:56 AM (10 days ago) Jul 18
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/cee7e76f56ebe8104e02f362f406d3a51ce10276

>---------------------------------------------------------------

commit cee7e76f56ebe8104e02f362f406d3a51ce10276
Author: Alex Alabuzhev <alab...@gmail.com>
Date: Sat Jul 18 15:21:12 2026 +0100

Refactoring


>---------------------------------------------------------------

cee7e76f56ebe8104e02f362f406d3a51ce10276
far/changelog | 5 +++++
far/filelist.cpp | 10 ++++------
far/filelist.hpp | 2 +-
far/filesystemwatcher.cpp | 9 ++++-----
far/filesystemwatcher.hpp | 3 +--
far/vbuild.m4 | 2 +-
6 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/far/changelog b/far/changelog
index d0b3001e2..7761aaa42 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,3 +1,8 @@
+--------------------------------------------------------------------------------
+drkns 2026-07-18 15:20:22+01:00 - build 6721
+
+1. Refactoring.
+
--------------------------------------------------------------------------------
drkns 2026-07-18 14:20:26+01:00 - build 6720

diff --git a/far/filelist.cpp b/far/filelist.cpp
index 61e418972..c14bc3555 100644
--- a/far/filelist.cpp
+++ b/far/filelist.cpp
@@ -2940,7 +2940,7 @@ bool FileList::ChangeDir(string_view const NewDir, bool IsParent, bool ResolvePa
{
Global->CtrlObject->FolderHistory->AddToHistory(m_CurDir);
if (!IsPopPlugin)
- InitFSWatcher(false);
+ InitFSWatcher();
}
};

@@ -3616,7 +3616,7 @@ void FileList::OnSortingChange()
void FileList::InitCurDir(string_view CurDir)
{
Panel::InitCurDir(CurDir);
- InitFSWatcher(false);
+ InitFSWatcher();
}

bool FileList::GoToFile(long idxItem)
@@ -5379,8 +5379,6 @@ void FileList::CountDirSize(bool IsRealNames)
SortFileList(true);
ShowFileList();
Parent()->Redraw();
-
- InitFSWatcher(true);
}


@@ -7304,7 +7302,7 @@ void FileList::UpdateIfChanged(bool Changed)
Update(UPDATE_KEEP_SELECTION);
}

-void FileList::InitFSWatcher(bool CheckTree)
+void FileList::InitFSWatcher()
{
if (m_PanelMode == panel_mode::PLUGIN_PANEL)
return;
@@ -7321,7 +7319,7 @@ void FileList::InitFSWatcher(bool CheckTree)

if (Global->Opt->AutoUpdateRemoteDrive || (!Global->Opt->AutoUpdateRemoteDrive && DriveType != DRIVE_REMOTE) || Type == root_type::volume)
{
- FSWatcher.emplace(m_BackgroundUpdater->event_id(), m_CurDir, CheckTree);
+ FSWatcher.emplace(m_BackgroundUpdater->event_id(), m_CurDir);
}
}

diff --git a/far/filelist.hpp b/far/filelist.hpp
index b74083c03..8cac9f4d8 100644
--- a/far/filelist.hpp
+++ b/far/filelist.hpp
@@ -310,7 +310,7 @@ private:
void ReadSortGroups(bool UpdateFilterCurrentTime = true);
int ProcessOneHostFile(const FileListItem* Item);
void HighlightBorder(int Level, int ListPos) const;
- void InitFSWatcher(bool CheckTree);
+ void InitFSWatcher();
bool IsColumnDisplayed(function_ref<bool(const column&)> Compare) const;
void UpdateHeight();
enum direction
diff --git a/far/filesystemwatcher.cpp b/far/filesystemwatcher.cpp
index c2f4a0313..da47d6910 100644
--- a/far/filesystemwatcher.cpp
+++ b/far/filesystemwatcher.cpp
@@ -208,10 +208,9 @@ static os::handle open(const string_view Directory)
return DirectoryHandle;
}

-FileSystemWatcher::FileSystemWatcher(const string_view EventId, const string_view Directory, const bool WatchSubtree):
+FileSystemWatcher::FileSystemWatcher(const string_view EventId, const string_view Directory):
m_EventId(EventId),
- m_Directory(nt_path(Directory)),
- m_WatchSubtree(WatchSubtree)
+ m_Directory(nt_path(Directory))
{
m_Overlapped.hEvent = m_Event.native_handle();
background_watcher::instance().add(this);
@@ -278,13 +277,13 @@ bool FileSystemWatcher::open_directory()

void FileSystemWatcher::read_async()
{
- LOGDEBUG(L"Start monitoring {} {}"sv, m_Directory, m_WatchSubtree? L"tree"sv : L"directory"sv);
+ LOGDEBUG(L"Start monitoring {} directory"sv, m_Directory);

if (!ReadDirectoryChangesW(
m_DirectoryHandle.native_handle(),
&Buffer,
sizeof(Buffer),
- m_WatchSubtree,
+ FALSE,
FILE_NOTIFY_CHANGE_FILE_NAME |
FILE_NOTIFY_CHANGE_DIR_NAME |
FILE_NOTIFY_CHANGE_ATTRIBUTES |
diff --git a/far/filesystemwatcher.hpp b/far/filesystemwatcher.hpp
index 0edd823f1..d02804130 100644
--- a/far/filesystemwatcher.hpp
+++ b/far/filesystemwatcher.hpp
@@ -51,7 +51,7 @@ class FileSystemWatcher
public:
NONCOPYABLE(FileSystemWatcher);

- FileSystemWatcher(string_view EventId, string_view Directory, bool WatchSubtree);
+ FileSystemWatcher(string_view EventId, string_view Directory);
~FileSystemWatcher();

void restart_if_needed();
@@ -66,7 +66,6 @@ private:

string m_EventId;
string m_Directory;
- bool m_WatchSubtree{};
os::critical_section m_CS;
os::event m_Event{ os::event::type::manual, os::event::state::nonsignaled };
// https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw
diff --git a/far/vbuild.m4 b/far/vbuild.m4
index 2262a4f1b..1d5f5f6f9 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6720
+6721


Reply all
Reply to author
Forward
0 new messages