Forgot a static inModification in PreferencesPanel

This commit is contained in:
Grégory Soutadé 2012-04-27 21:59:25 +02:00
parent 691b1a603b
commit 951c41a5f7
1 changed files with 21 additions and 1 deletions

View File

@ -541,9 +541,13 @@ void PreferencesPanel::OnAccountVirtualClicked(int id)
Account account;
int row;
if (_inModification) return;
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
if (it == user->_accounts.end()) return ;
_inModification = true;
row = it-user->_accounts.begin();
account = user->_accounts[row];
@ -551,6 +555,7 @@ void PreferencesPanel::OnAccountVirtualClicked(int id)
account._virtual = (checkBox->checkState() == Qt::Checked);
_kiss->UpdateAccount(account);
_inModification = false;
_wxUI->NeedReload();
}
@ -562,16 +567,21 @@ void PreferencesPanel::OnAccountBlockedClicked(int id)
Account account;
int row;
if (_inModification) return;
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
if (it == user->_accounts.end()) return ;
_inModification = true;
row = it-user->_accounts.begin();
account = user->_accounts[row];
account.blocked = (checkBox->checkState() == Qt::Checked);
_kiss->UpdateAccount(account);
_inModification = false;
_wxUI->NeedReload();
}
@ -645,6 +655,10 @@ void PreferencesPanel::OnAccountHiddenClicked(int id)
Account account;
int row;
if (_inModification) return;
_inModification = true;
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
if (it == user->_accounts.end()) return ;
@ -655,6 +669,7 @@ void PreferencesPanel::OnAccountHiddenClicked(int id)
account.hidden = (checkBox->checkState() == Qt::Checked);
_kiss->UpdateAccount(account);
_inModification = false;
_wxUI->NeedReload();
}
@ -712,6 +727,8 @@ void PreferencesPanel::OnBackgroundColorClicked(int id)
std::vector<Category>::iterator it;
int row;
if (_inModification) return;
it = std::find(user->_categories.begin(), user->_categories.end(), id);
if (it == user->_categories.end()) return ;
@ -741,6 +758,8 @@ void PreferencesPanel::OnForegroundClicked(int id)
std::vector<Category>::iterator it;
int row;
if (_inModification) return;
it = std::find(user->_categories.begin(), user->_categories.end(), id);
if (it == user->_categories.end()) return ;
@ -771,6 +790,8 @@ void PreferencesPanel::OnFontClicked(int id)
std::vector<Category>::iterator it;
int row;
if (_inModification) return;
it = std::find(user->_categories.begin(), user->_categories.end(), id);
if (it == user->_categories.end()) return ;
@ -953,7 +974,6 @@ void PreferencesPanel::OnCategoryModified(int row, int col)
int op_complete = 1;
QString value;
User* user = _kiss->GetUser();
static bool _inModification = false ;
Category new_cat, old_cat;
int new_id;
QTableWidgetItem* item = _categoriesGrid->item(row, col);