From 7bef9dd5b0d2e273392cadee8f0c1c58d5c21bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Mon, 30 Jan 2012 20:54:04 +0100 Subject: [PATCH] Fix two bugs : New date was not set in grid after operation validation and new group name was not saved --- Makefile | 2 +- src/view/grid/GridAccount.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b7110b4..f346568 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ clean: mojito : $(MOCS_OBJS) $(KDCHART_MOCS_OBJS) kc: $(MOCS) $(OBJS) - $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) #-L. -lkdchart + $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(UI_CHARTSELECTOR): libkdchart/src/KDChartDatasetSelector.ui uic $< > $(UI_CHARTSELECTOR) diff --git a/src/view/grid/GridAccount.cpp b/src/view/grid/GridAccount.cpp index a2c9edb..1f458ba 100644 --- a/src/view/grid/GridAccount.cpp +++ b/src/view/grid/GridAccount.cpp @@ -844,6 +844,7 @@ void GridAccount::OnOperationModified(int row, int col) QFont font; Category cat ; bool fix_cost; + QDate curDate = QDate::currentDate(); // Avoid recursives calls if (_inModification || _loadOperations) return; @@ -999,7 +1000,12 @@ void GridAccount::OnOperationModified(int row, int col) if (fix_cost && i == CATEGORY) continue; setItem(row, i, new QTableWidgetItem("")); } - + if (!fix_cost) + { + if (_curMonth+1 == curDate.month() && + _curYear == curDate.year()) + setItem(row, OP_DATE, new QTableWidgetItem(v.sprintf("%02d/%02d/%d", curDate.day(), _curMonth+1, _curYear))); + } DEFAULT_FONT(font); if (fix_cost) @@ -1176,7 +1182,8 @@ void GridAccount::UpdateMeta(Operation& meta) meta.amount = _kiss->MetaAmount(meta.id); - UpdateOperation(meta); + if (_databaseSynchronization) + _kiss->UpdateOperation(meta); } void GridAccount::Group()