From 08e37fe2c626f539a1dc9b8c2f1ca8fa87853faa Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Sat, 17 Apr 2004 22:45:08 +0000 Subject: [PATCH] Fixed a small mistake in restore process (return instead of break...) git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1231 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/wx-console/wxbrestorepanel.cpp | 17 +++++++++++------ bacula/src/wx-console/wxbutils.cpp | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index 5a39e9ba4f..add8cba5cc 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -315,16 +315,16 @@ void wxbRestorePanel::CmdStart() { totfilemessages = 0; wxbDataTokenizer* dt; - dt = WaitForEnd("estimate\n"); + dt = WaitForEnd("estimate\n", true); int j, k; - + for (unsigned int i = 0; i < dt->GetCount(); i++) { /* 15847 total files; 1 marked to be restored; 1,034 bytes. */ if ((j = (*dt)[i].Find(" marked to be restored;")) > -1) { k = (*dt)[i].Find("; "); (*dt)[i].Mid(k+2, j).ToLong(&totfilemessages); - return; + break; } } @@ -335,12 +335,12 @@ void wxbRestorePanel::CmdStart() { for (unsigned int i = 0; i < dt->GetCount(); i++) { if ((j = (*dt)[i].Find(" files selected to be restored.")) > -1) { (*dt)[i].Mid(0, j).ToLong(&totfilemessages); - return; + break; } if ((j = (*dt)[i].Find(" file selected to be restored.")) > -1) { (*dt)[i].Mid(0, j).ToLong(&totfilemessages); - return; + break; } } @@ -579,13 +579,18 @@ wxbDataTokenizer* wxbRestorePanel::WaitForEnd(wxString cmd, bool keepresults) { wxbDataTokenizer* datatokenizer = new wxbDataTokenizer(); wxbMainFrame::GetInstance()->Send(cmd); - + + //wxbMainFrame::GetInstance()->Print("(hasFinished()) { //innerThread->Yield(); wxTheApp->Yield(); //if (base+15 < wxDateTime::Now().GetTicks()) break; } + + //wxbMainFrame::GetInstance()->Print("(>WFE)", CS_DEBUG); + if (keepresults) { return datatokenizer; } diff --git a/bacula/src/wx-console/wxbutils.cpp b/bacula/src/wx-console/wxbutils.cpp index e639144dee..3f2fd4fcc5 100644 --- a/bacula/src/wx-console/wxbutils.cpp +++ b/bacula/src/wx-console/wxbutils.cpp @@ -57,7 +57,9 @@ void wxbDataTokenizer::Print(wxString str, int status) { if (str != "") { Add(str); + //wxbMainFrame::GetInstance()->Print("D", CS_DEBUG); } + //wxbMainFrame::GetInstance()->Print(finished ? "F" : "!F", CS_DEBUG); } /* Returns true if the last signal received was an end signal, -- 2.39.5