[FarGroup/FarManager] master: Improve detection of recycle bin availability (b9f2e01ed)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Jun 8, 2026, 4:00:56 PM (9 days ago) Jun 8
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/b9f2e01edfd2ff79285dd00cdf66a499903a60f0

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

commit b9f2e01edfd2ff79285dd00cdf66a499903a60f0
Author: Alex Alabuzhev <alab...@gmail.com>
Date: Mon Jun 8 20:47:49 2026 +0100

Improve detection of recycle bin availability


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

b9f2e01edfd2ff79285dd00cdf66a499903a60f0
far/changelog | 5 +++++
far/delete.cpp | 10 ++++++++--
far/vbuild.m4 | 2 +-
3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/far/changelog b/far/changelog
index 72af3008f..1f06b9834 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,3 +1,8 @@
+--------------------------------------------------------------------------------
+drkns 2026-06-08 20:46:53+01:00 - build 6695
+
+1. Improve detection of recycle bin availability.
+
--------------------------------------------------------------------------------
drkns 2026-06-06 21:58:45+01:00 - build 6694

diff --git a/far/delete.cpp b/far/delete.cpp
index b63034006..98f5a9471 100644
--- a/far/delete.cpp
+++ b/far/delete.cpp
@@ -716,8 +716,14 @@ ShellDelete::ShellDelete(panel_ptr SrcPanel, delete_type const Type):
if (!SrcPanel->get_first_selected(SingleSelData))
return;

- if (m_DeleteType == delete_type::recycle && os::fs::drive::get_type(GetPathRoot(ConvertNameToFull(SingleSelData.FileName))) != DRIVE_FIXED)
- m_DeleteType = delete_type::remove;
+ if (m_DeleteType == delete_type::recycle)
+ {
+ if (SHQUERYRBINFO Info{ sizeof(Info) }; FAILED(SHQueryRecycleBin(GetPathRoot(SrcPanel->GetCurDir()).c_str(), &Info)))
+ {
+ // If we can't query recycle bin for the given path, we likely won't be able to move into it, so update the action accordingly
+ m_DeleteType = delete_type::remove;
+ }
+ }

show_confirmation(SrcPanel, m_DeleteType, SelCount, SingleSelData);

diff --git a/far/vbuild.m4 b/far/vbuild.m4
index 985eda800..cbcb5352e 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6694
+6695


Reply all
Reply to author
Forward
0 new messages