Fix two bugs : New date was not set in grid after operation validation and new group name was not saved

This commit is contained in:
Grégory Soutadé 2012-01-30 20:54:04 +01:00
parent 292591c098
commit 7bef9dd5b0
2 changed files with 10 additions and 3 deletions

View File

@ -59,7 +59,7 @@ clean:
mojito : $(MOCS_OBJS) $(KDCHART_MOCS_OBJS) mojito : $(MOCS_OBJS) $(KDCHART_MOCS_OBJS)
kc: $(MOCS) $(OBJS) kc: $(MOCS) $(OBJS)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) #-L. -lkdchart $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
$(UI_CHARTSELECTOR): libkdchart/src/KDChartDatasetSelector.ui $(UI_CHARTSELECTOR): libkdchart/src/KDChartDatasetSelector.ui
uic $< > $(UI_CHARTSELECTOR) uic $< > $(UI_CHARTSELECTOR)

View File

@ -844,6 +844,7 @@ void GridAccount::OnOperationModified(int row, int col)
QFont font; QFont font;
Category cat ; Category cat ;
bool fix_cost; bool fix_cost;
QDate curDate = QDate::currentDate();
// Avoid recursives calls // Avoid recursives calls
if (_inModification || _loadOperations) return; if (_inModification || _loadOperations) return;
@ -999,7 +1000,12 @@ void GridAccount::OnOperationModified(int row, int col)
if (fix_cost && i == CATEGORY) continue; if (fix_cost && i == CATEGORY) continue;
setItem(row, i, new QTableWidgetItem("")); 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); DEFAULT_FONT(font);
if (fix_cost) if (fix_cost)
@ -1176,7 +1182,8 @@ void GridAccount::UpdateMeta(Operation& meta)
meta.amount = _kiss->MetaAmount(meta.id); meta.amount = _kiss->MetaAmount(meta.id);
UpdateOperation(meta); if (_databaseSynchronization)
_kiss->UpdateOperation(meta);
} }
void GridAccount::Group() void GridAccount::Group()