[fwbuilder-commits] r2328 - in branches/v3_1: . src/gui
Brought to you by:
mikehorn
From: <va...@in...> - 2010-01-08 21:05:53
|
Author: vadim Date: 2010-01-08 13:05:15 -0800 (Fri, 08 Jan 2010) New Revision: 2328 Modified: branches/v3_1/build_num branches/v3_1/src/gui/FWCmdRule.cpp branches/v3_1/src/gui/RuleSetModel.cpp branches/v3_1/src/gui/RuleSetView.cpp Log: fixes #1063 GUI crash after rule remove Modified: branches/v3_1/build_num =================================================================== --- branches/v3_1/build_num 2010-01-08 20:18:09 UTC (rev 2327) +++ branches/v3_1/build_num 2010-01-08 21:05:15 UTC (rev 2328) @@ -1 +1 @@ -#define BUILD_NUM 2325 +#define BUILD_NUM 2327 Modified: branches/v3_1/src/gui/FWCmdRule.cpp =================================================================== --- branches/v3_1/src/gui/FWCmdRule.cpp 2010-01-08 20:18:09 UTC (rev 2327) +++ branches/v3_1/src/gui/FWCmdRule.cpp 2010-01-08 21:05:15 UTC (rev 2328) @@ -205,6 +205,9 @@ QModelIndex index = md->index(rule, 0); md->removeRow(index.row(), index.parent()); } + // invalidate selection in RuleSetView + + getRuleSetView()->unselect(); } void FWCmdRuleDelete::undoOnModel(RuleSetModel *md) Modified: branches/v3_1/src/gui/RuleSetModel.cpp =================================================================== --- branches/v3_1/src/gui/RuleSetModel.cpp 2010-01-08 20:18:09 UTC (rev 2327) +++ branches/v3_1/src/gui/RuleSetModel.cpp 2010-01-08 21:05:15 UTC (rev 2328) @@ -456,11 +456,13 @@ return col; } -RuleNode *RuleSetModel::nodeFromIndex(const QModelIndex &index) const +RuleNode* RuleSetModel::nodeFromIndex(const QModelIndex &index) const { - if (index.isValid()) { + if (index.isValid()) + { return static_cast<RuleNode *>(index.internalPointer()); - } else { + } else + { return root; } } Modified: branches/v3_1/src/gui/RuleSetView.cpp =================================================================== --- branches/v3_1/src/gui/RuleSetView.cpp 2010-01-08 20:18:09 UTC (rev 2327) +++ branches/v3_1/src/gui/RuleSetView.cpp 2010-01-08 21:05:15 UTC (rev 2328) @@ -2218,7 +2218,8 @@ if (index.isValid()) { memento.column = index.column(); - memento.rule_id = md->nodeFromIndex(index)->rule->getId(); + RuleNode* node = md->nodeFromIndex(index); + memento.rule_id = node->rule->getId(); } else { memento.column = -1; |