Exemple #1
0
void SessionModel::updateTotals()
{
	Session current, previous;
	for (int i = 0; i < m_data.count(); ++i) {
		current = m_data.at(i);
		current.updateTotals(previous);
		previous = current;
	}
	emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
	emit billedStatusChanged(current.isBilled());
}
Exemple #2
0
void Project::stop(const QDateTime& current, bool* ok) {
	bool success = true;
	m_active = false;
	if (current.isValid()) {
		success = m_model->add(m_start_time, current, m_task);
	} else {
		billedStatusChanged(m_model->isBilled(m_model->rowCount() - 2));
	}
	setText(1, "");
	if (ok) {
		*ok = success;
	}
}
Exemple #3
0
void Project::start(const QDateTime& current) {
	m_start_time = current;
	m_active = true;
	setText(1, "00:00:00");
	billedStatusChanged(false);
}