Преглед изворни кода

Bug fix: Ad-hoc and Last custom commands were always executed for selected files, even when executed from a context menu of a focused file

Source commit: 05fc617dc9ea09b212654f0c80671fd3a9a7216e
Martin Prikryl пре 9 година
родитељ
комит
075619946e
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      source/forms/CustomScpExplorer.cpp

+ 3 - 3
source/forms/CustomScpExplorer.cpp

@@ -1583,7 +1583,7 @@ bool __fastcall TCustomScpExplorerForm::CustomCommandRemoteAllowed()
 }
 //---------------------------------------------------------------------------
 int __fastcall TCustomScpExplorerForm::CustomCommandState(
-  const TCustomCommandType & Command, bool /*OnFocused*/, TCustomCommandListType ListType)
+  const TCustomCommandType & Command, bool OnFocused, TCustomCommandListType ListType)
 {
   int Result;
 
@@ -1614,7 +1614,7 @@ int __fastcall TCustomScpExplorerForm::CustomCommandState(
     {
       if ((ListType == ccltAll) || (ListType == ccltFile))
       {
-        Result = ((FCurrentSide == osRemote) && EnableSelectedOperation[osRemote]) ? AllowedState : 0;
+        Result = ((FCurrentSide == osRemote) && DirView(osRemote)->AnyFileSelected(OnFocused, false, true)) ? AllowedState : 0;
       }
       else
       {
@@ -1655,7 +1655,7 @@ int __fastcall TCustomScpExplorerForm::CustomCommandState(
     {
       if ((ListType == ccltAll) || (ListType == ccltFile))
       {
-        Result = EnableSelectedOperation[FCurrentSide] ? 1 : 0;
+        Result = DirView(FCurrentSide)->AnyFileSelected(OnFocused, false, true) ? 1 : 0;
       }
       else
       {