]> git.sur5r.net Git - bacula/bacula/commitdiff
- wxbRestorePanel : Fixed problem when the newly created job is not at the end of...
authorNicolas Boichat <nicolas@boichat.ch>
Sat, 17 Jul 2004 09:39:57 +0000 (09:39 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Sat, 17 Jul 2004 09:39:57 +0000 (09:39 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1476 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/wx-console/CHANGELOG
bacula/src/wx-console/wxbrestorepanel.cpp

index ac97a086827aaed0ed72a0fc4cfbb54f13b9470f..46dd48b3294fce385bbfe1c52f50b22e255ccc90 100644 (file)
@@ -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).
index 1783446fc8de3a2e6a150a975cd0b625257263b3..e61adec92a042a84e70f6899fe46d49311214f63 100644 (file)
@@ -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;