summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>2010-01-16 22:29:13 -0300
committerAnselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>2010-01-16 22:29:13 -0300
commit6954cb499ad13b09bdca92c184ec0ff42685c445 (patch)
treee2b81cfdf53e2c1ac9a7b7fb67c2e39d925e5d3d
parentde651f6692e17eb73f56dff05a724e7e05269761 (diff)
listScreen: Fixed another bug in total label update
The last fix solved the updates in the model, but didn't solve all screen updates. Changing the order of 2 operations did the job. Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
-rw-r--r--mybudget/src/lists/listscreen.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/mybudget/src/lists/listscreen.cpp b/mybudget/src/lists/listscreen.cpp
index dc68504..c21449e 100644
--- a/mybudget/src/lists/listscreen.cpp
+++ b/mybudget/src/lists/listscreen.cpp
@@ -184,15 +184,20 @@ void ListScreen::categoryUpdated(const QString &category)
{
updateModel(category);
- // To update the label when a new value is inserted
- setTotalLabelValue(m_totals.value(category, 0));
-
/*
When a category is updated, we need to update the overall list too.
As the category argument here cames from the edited one, it will never
be "overall" because there is no edit mode for it.
*/
updateModel("overall");
+
+ /*
+ To update the label when a new value is inserted
+ Here we use currentCategory instead of category because
+ "overall" can be the current selection in the list menu and, as we said before,
+ category will never be overall because there is no edit mode for it.
+ */
+ setTotalLabelValue(m_totals.value(currentCategory(), 0));
}
void ListScreen::updateModel(const QString &category)