Ticket #9809: recursive_operation_diff.txt

File recursive_operation_diff.txt, 2.2 KB (added by Stephen L'Allier, 8 years ago)
Line 
1--- recursive_operation.cpp 2015-12-08 12:21:36.732404673 -0500
2+++ recursive_operation_new.cpp 2015-12-08 12:26:27.804327366 -0500
3@@ -5,6 +5,7 @@
4 #include "filter.h"
5 #include "Options.h"
6 #include "queue.h"
7+#include "local_filesys.h"
8
9 CRecursiveOperation::CRecursiveOperation(CState* pState)
10 : CStateEventHandler(pState),
11@@ -23,7 +24,7 @@
12 }
13 }
14
15-void CRecursiveOperation::OnStateChange(CState*, enum t_statechange_notifications notification, const wxString&, const void* data2)
16+void CRecursiveOperation::OnStateChange(CState* pState, enum t_statechange_notifications notification, const wxString&, const void* data2)
17 {
18 if (notification == STATECHANGE_REMOTE_DIR_OTHER && data2) {
19 std::shared_ptr<CDirectoryListing> const& listing = *reinterpret_cast<std::shared_ptr<CDirectoryListing> const*>(data2);
20@@ -238,7 +239,7 @@
21 if (entry.name != dir.restrict)
22 continue;
23 }
24- else if (filter.FilenameFiltered(m_filters, entry.name, path, entry.is_dir(), entry.size, 0, entry.time))
25+ else if (filter.FilenameFiltered(m_filters, entry.name, path, entry.is_dir(), entry.size, false, 0, entry.time))
26 continue;
27
28 if (!entry.is_dir()) {
29@@ -330,21 +331,29 @@
30
31 m_pChmodDlg = pChmodDialog;
32 }
33-
34-void CRecursiveOperation::StopRecursiveOperation()
35+//added new if statement in the beginning to check to see if the
36+void CRecursiveOperation:StopRecursiveOperation()
37 {
38- if (m_operationMode != recursive_none) {
39+ if(pState == Cancel()){
40+ if (m_operationMode != recursive_none) {
41+ m_operationMode = recursive_none;
42+ m_pState->NotifyHandlers(STATECHANGE_REMOTE_IDLE);
43+ m_pState->NotifyHandlers(STATECHANGE_RECURSION_STATUS);
44+ }
45+ if (m_pChmodDlg) {
46+ m_pChmodDlg->Destroy();
47+ m_pChmodDlg = 0;
48+ }
49+ else {
50 m_operationMode = recursive_none;
51 m_pState->NotifyHandlers(STATECHANGE_REMOTE_IDLE);
52- m_pState->NotifyHandlers(STATECHANGE_RECURSION_STATUS);
53+ m_pState->Notifyandlers(STATECHANGE_RECURSION_STATUS);
54+ }
55+ m_dirsToVisit.clear();
56+ m_visitedDirs.clear();
57 }
58- m_dirsToVisit.clear();
59- m_visitedDirs.clear();
60
61- if (m_pChmodDlg) {
62- m_pChmodDlg->Destroy();
63- m_pChmodDlg = 0;
64- }
65+
66 }
67
68 void CRecursiveOperation::ListingFailed(int error)