summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)