From a1be568d254e022a85a40c8f0bf65ec9c000f497 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Sat, 17 Jul 2004 13:20:20 +0000 Subject: [PATCH] - wxbRestorePanel & wxbHistoryTextCtrl : Fixed unsigned comparisons. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1477 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/wx-console/CHANGELOG | 1 + bacula/src/wx-console/wxbhistorytextctrl.cpp | 4 ++-- bacula/src/wx-console/wxbrestorepanel.cpp | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bacula/src/wx-console/CHANGELOG b/bacula/src/wx-console/CHANGELOG index 46dd48b329..159340d771 100644 --- a/bacula/src/wx-console/CHANGELOG +++ b/bacula/src/wx-console/CHANGELOG @@ -1,4 +1,5 @@ 17-07-2004 : + - wxbRestorePanel & wxbHistoryTextCtrl : Fixed unsigned comparisons. - wxbRestorePanel : Fixed problem when the newly created job is not at the end of the list. diff --git a/bacula/src/wx-console/wxbhistorytextctrl.cpp b/bacula/src/wx-console/wxbhistorytextctrl.cpp index eb5120ef4c..b954cf4c7e 100644 --- a/bacula/src/wx-console/wxbhistorytextctrl.cpp +++ b/bacula/src/wx-console/wxbhistorytextctrl.cpp @@ -50,7 +50,7 @@ void wxbHistoryTextCtrl::HistoryAdd(wxString cmd) { void wxbHistoryTextCtrl::OnKeyUp(wxKeyEvent& event) { if (event.m_keyCode == WXK_UP) { if (index > 0) { - if (index == (history.Count()-1)) { + if (index == ((int)history.Count()-1)) { history[index] = GetValue(); } index--; @@ -59,7 +59,7 @@ void wxbHistoryTextCtrl::OnKeyUp(wxKeyEvent& event) { } } else if (event.m_keyCode == WXK_DOWN) { - if (index < (history.Count()-1)) { + if (index < ((int)history.Count()-1)) { index++; SetValue(history[index]); SetInsertionPointEnd(); diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index e61adec92a..51da80753e 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -1121,8 +1121,8 @@ void wxbRestorePanel::CmdListJobs() { wxbDataTokenizer* dt = wxbUtils::WaitForEnd(configPanel->GetRowString("Client") + "\n", true); if (!tableparser->hasFinished()) { - for (int i = 0; i < dt->Count(); i++) { - if ((*dt)[i].Index("No results to list.") == 0) { + for (unsigned int i = 0; i < dt->Count(); i++) { + if ((*dt)[i].Find("No results to list.") == 0) { configPanel->AddRowChoice("Before", "No backup found for this client."); configPanel->SetRowSelection("Before", 0); configPanel->EnableApply(true); // Enabling the not existing apply button disables the ok button. @@ -1130,7 +1130,7 @@ void wxbRestorePanel::CmdListJobs() { delete dt; return; } - else if (((*dt)[i].Index("ERROR") > -1) || ((*dt)[i].Index("Query failed") > -1)) { + else if (((*dt)[i].Find("ERROR") > -1) || ((*dt)[i].Find("Query failed") > -1)) { configPanel->AddRowChoice("Before", "Cannot get previous backups list, see console."); configPanel->SetRowSelection("Before", 0); configPanel->EnableApply(true); // Enabling the not existing apply button disables the ok button. -- 2.39.5