From: Nicolas Boichat Date: Sat, 17 Jul 2004 09:39:57 +0000 (+0000) Subject: - wxbRestorePanel : Fixed problem when the newly created job is not at the end of... X-Git-Tag: Release-1.35.1~58 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aaca200da2c9367b23f7acdcf348ba91d0426726;p=bacula%2Fbacula - wxbRestorePanel : Fixed problem when the newly created job is not at the end of the list. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1476 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/wx-console/CHANGELOG b/bacula/src/wx-console/CHANGELOG index ac97a08682..46dd48b329 100644 --- a/bacula/src/wx-console/CHANGELOG +++ b/bacula/src/wx-console/CHANGELOG @@ -1,3 +1,7 @@ +17-07-2004 : + - wxbRestorePanel : Fixed problem when the newly created job is not + at the end of the list. + 16-07-2004 : - wxbRestorePanel : Fixed crash when an error occurs while querying restore list (reported by Dan Langille). diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index 1783446fc8..e61adec92a 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -814,20 +814,27 @@ void wxbRestorePanel::CmdStart() { wxDateTime jobtime; - if (jobname == (*tableparser)[tableparser->GetCount()-1][1]) { - wxStringTokenizer jtkz((*tableparser)[tableparser->GetCount()-1][2], " ", wxTOKEN_STRTOK); - if ((jobtime.ParseDate(jtkz.GetNextToken()) != NULL) && // Date - (jobtime.ParseTime(jtkz.GetNextToken()) != NULL)) { // Time - if (jobtime.IsLaterThan(currenttime)) { - jobid = (*tableparser)[tableparser->GetCount()-1][0]; - cmd << jobid << "\n"; - delete tableparser; - cancel->Enable(true); - break; + for (i = 0; i < tableparser->GetCount(); i++) { + if (jobname == (*tableparser)[i][1]) { + wxStringTokenizer jtkz((*tableparser)[i][2], " ", wxTOKEN_STRTOK); + if ((jobtime.ParseDate(jtkz.GetNextToken()) != NULL) && // Date + (jobtime.ParseTime(jtkz.GetNextToken()) != NULL)) { // Time + if (jobtime.IsLaterThan(currenttime)) { + jobid = (*tableparser)[i][0]; + cmd << jobid << "\n"; + delete tableparser; + tableparser = NULL; + cancel->Enable(true); + break; + } } } } + if (tableparser == NULL) { //The job was found + break; + } + delete tableparser; wxStopWatch sw2;