--- recursive_operation.cpp 2015-12-08 12:21:36.732404673 -0500 +++ recursive_operation_new.cpp 2015-12-08 12:26:27.804327366 -0500 @@ -5,6 +5,7 @@ #include "filter.h" #include "Options.h" #include "queue.h" +#include "local_filesys.h" CRecursiveOperation::CRecursiveOperation(CState* pState) : CStateEventHandler(pState), @@ -23,7 +24,7 @@ } } -void CRecursiveOperation::OnStateChange(CState*, enum t_statechange_notifications notification, const wxString&, const void* data2) +void CRecursiveOperation::OnStateChange(CState* pState, enum t_statechange_notifications notification, const wxString&, const void* data2) { if (notification == STATECHANGE_REMOTE_DIR_OTHER && data2) { std::shared_ptr const& listing = *reinterpret_cast const*>(data2); @@ -238,7 +239,7 @@ if (entry.name != dir.restrict) continue; } - else if (filter.FilenameFiltered(m_filters, entry.name, path, entry.is_dir(), entry.size, 0, entry.time)) + else if (filter.FilenameFiltered(m_filters, entry.name, path, entry.is_dir(), entry.size, false, 0, entry.time)) continue; if (!entry.is_dir()) { @@ -330,21 +331,29 @@ m_pChmodDlg = pChmodDialog; } - -void CRecursiveOperation::StopRecursiveOperation() +//added new if statement in the beginning to check to see if the +void CRecursiveOperation:StopRecursiveOperation() { - if (m_operationMode != recursive_none) { + if(pState == Cancel()){ + if (m_operationMode != recursive_none) { + m_operationMode = recursive_none; + m_pState->NotifyHandlers(STATECHANGE_REMOTE_IDLE); + m_pState->NotifyHandlers(STATECHANGE_RECURSION_STATUS); + } + if (m_pChmodDlg) { + m_pChmodDlg->Destroy(); + m_pChmodDlg = 0; + } + else { m_operationMode = recursive_none; m_pState->NotifyHandlers(STATECHANGE_REMOTE_IDLE); - m_pState->NotifyHandlers(STATECHANGE_RECURSION_STATUS); + m_pState->Notifyandlers(STATECHANGE_RECURSION_STATUS); + } + m_dirsToVisit.clear(); + m_visitedDirs.clear(); } - m_dirsToVisit.clear(); - m_visitedDirs.clear(); - if (m_pChmodDlg) { - m_pChmodDlg->Destroy(); - m_pChmodDlg = 0; - } + } void CRecursiveOperation::ListingFailed(int error)