From ae68ae38bbbc981aab4b8eaf1e84a15b8ab05bf4 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 17 Jun 2013 18:59:50 -0300 Subject: Changed a lot of code to reduce boilerplate on models in the future. So, I changed a lot of code to reduce boilerplate on models in the future. Currently we do not have a lot of models, but this can increase quite rapdly. There's a second TreeModel in the works, the Yearly Statistics, this patch will save around 250 LOC for this new model, and more and more models will give us a greater saving. Iwll do that for the table models in the future too - I did the tree models now because they are the most complex case and I didn't wanted to create a second tree model without this. Signed-off-by: Tomaz Canabrava --- qt-ui/modeldelegates.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui/modeldelegates.cpp') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 01f5197ce..3aeaa02b5 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -26,7 +26,7 @@ void StarWidgetsDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o if (!index.isValid()) return; - QVariant value = index.model()->data(index, TreeItemDT::STAR_ROLE); + QVariant value = index.model()->data(index, DiveTripModel::STAR_ROLE); if (!value.isValid()) return; -- cgit v1.2.3-70-g09d2