@@ -93,7 +93,7 @@ struct total_items
9393class ShellDelete : noncopyable
9494{
9595public:
96- ShellDelete (panel_ptr SrcPanel, delete_type Type, bool UpdateDiz );
96+ ShellDelete (panel_ptr SrcPanel, delete_type Type);
9797
9898 struct progress
9999 {
@@ -718,11 +718,18 @@ void ShellDelete::process_item(
718718
719719}
720720
721- ShellDelete::ShellDelete (panel_ptr SrcPanel, delete_type const Type, bool const UpdateDiz ):
721+ ShellDelete::ShellDelete (panel_ptr SrcPanel, delete_type const Type):
722722 m_DeleteFolders(!Global->Opt->Confirm.DeleteFolder),
723- m_UpdateDiz(UpdateDiz ),
723+ m_UpdateDiz(Global->Opt->Diz.UpdateMode == DIZ_UPDATE_ALWAYS || (SrcPanel-> IsDizDisplayed () && Global->Opt->Diz.UpdateMode == DIZ_UPDATE_IF_DISPLAYED) ),
724724 m_DeleteType(Type)
725725{
726+ if (m_UpdateDiz)
727+ SrcPanel->ReadDiz ();
728+
729+ const auto strDizName = SrcPanel->GetDizName ();
730+ const auto CheckDiz = [&] { return !strDizName.empty () && os::fs::exists (strDizName); };
731+ const auto DizPresent = CheckDiz ();
732+
726733 SCOPED_ACTION (TPreRedrawFuncGuard)(std::make_unique<DelPreRedrawItem>());
727734
728735 const auto SelCount = SrcPanel->GetSelCount ();
@@ -742,6 +749,9 @@ ShellDelete::ShellDelete(panel_ptr SrcPanel, delete_type const Type, bool const
742749
743750 SCOPE_EXIT
744751 {
752+ if (m_UpdateDiz && DizPresent == CheckDiz ())
753+ SrcPanel->FlushDiz ();
754+
745755 ShellUpdatePanels (SrcPanel, NeedSetUpADir);
746756 };
747757
@@ -1156,24 +1166,12 @@ bool delayed_deleter::any() const
11561166
11571167void Delete (const panel_ptr& SrcPanel, delete_type const Type)
11581168{
1159- const auto UpdateDiz = Global->Opt ->Diz .UpdateMode == DIZ_UPDATE_ALWAYS || (SrcPanel->IsDizDisplayed () && Global->Opt ->Diz .UpdateMode == DIZ_UPDATE_IF_DISPLAYED);
1160-
1161- if (UpdateDiz)
1162- SrcPanel->ReadDiz ();
1163-
1164- const auto strDizName = SrcPanel->GetDizName ();
1165- const auto CheckDiz = [&]{ return !strDizName.empty () && os::fs::exists (strDizName); };
1166- const auto DizPresent = CheckDiz ();
1167-
11681169 try
11691170 {
1170- ShellDelete (SrcPanel, Type, UpdateDiz );
1171+ ShellDelete (SrcPanel, Type);
11711172 }
11721173 catch (const operation_cancelled&)
11731174 {
11741175 // Nop
11751176 }
1176-
1177- if (UpdateDiz && DizPresent == CheckDiz ())
1178- SrcPanel->FlushDiz ();
11791177}
0 commit comments