Add a static 'instance()' member for the Photos model.

This will make referencing it from  a few places more easy.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-06-03 19:04:50 -03:00 committed by Dirk Hohndel
parent f53b5c4d3f
commit eb24d90c8e
3 changed files with 10 additions and 3 deletions

View file

@ -8,7 +8,13 @@ void DivePictureDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
QStyledItemDelegate::paint(painter, option, index);
}
DivePictureModel::DivePictureModel(QObject *parent): QAbstractTableModel(parent)
DivePictureModel *DivePictureModel::instance()
{
static DivePictureModel* self = new DivePictureModel();
return self;
}
DivePictureModel::DivePictureModel()
{
}