From 7af9f1d9c2a6cd076106cde064bd1ba0999cc0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sat, 30 Oct 2010 21:00:18 +0200 Subject: [PATCH] It is better to test before commiting ... --- src/model/Database.cpp | 12 ++++++++---- src/view/SearchPanel.cpp | 7 +------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/model/Database.cpp b/src/model/Database.cpp index 6d970ca..82968c1 100644 --- a/src/model/Database.cpp +++ b/src/model/Database.cpp @@ -1308,12 +1308,16 @@ std::vector* Database::Search(User* user, wxString* description, wxDa req += wxT("')"); } - if (firstCond) req += wxT(" AND ") ; else firstCond = true; - if (Fix == FIX_OP) - req += wxT(" AND fix_cost='1'"); + { + if (firstCond) req += wxT(" AND ") ; else firstCond = true; + req += wxT(" fix_cost='1'"); + } else if (Fix == NON_FIX_OP) - req += wxT(" AND fix_cost='0'"); + { + if (firstCond) req += wxT(" AND ") ; else firstCond = true; + req += wxT(" fix_cost='0'"); + } if (firstCond) req += wxT(" AND ") ; else firstCond = true; diff --git a/src/view/SearchPanel.cpp b/src/view/SearchPanel.cpp index 467ab32..c9f7045 100644 --- a/src/view/SearchPanel.cpp +++ b/src/view/SearchPanel.cpp @@ -207,12 +207,7 @@ void SearchPanel::OnButtonSearch(wxCommandEvent& event) if (_category->IsChecked(i)) categories.push_back(user->_categories[i].id); - if (_fix->IsItemEnabled(FIX_OP)) - fix = FIX_OP; - if (_fix->IsItemEnabled(NON_FIX_OP)) - fix = NON_FIX_OP; - else - fix = BOTH; + fix = _fix->GetSelection(); for(i=0; iGetAccountsNumber(); i++) if (_account->IsChecked(i))