summaryrefslogtreecommitdiffstats
path: root/qt-models/diveplannermodel.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2017-12-20 20:00:26 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-24 11:04:10 -0800
commit130f109442de7b5b047cc10b0e4534169459d291 (patch)
treed10dfc4bafbabd6a2beb44d0d109ca8543974a5f /qt-models/diveplannermodel.cpp
parent4c4222d61119e437b4b79e36903a5b357756de21 (diff)
downloadsubsurface-130f109442de7b5b047cc10b0e4534169459d291.tar.gz
Remove superfluous QScopedPointer<>s in singletons
There was a curious pattern of singletons being implemented based on QScopedPointer<>s. This is an unnecessary level of indirection: The lifetime of the smart pointer is the same as that of the pointed-to object. Therefore, replace these pointers by the respective objects. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r--qt-models/diveplannermodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 82aeda388..1d3e3347e 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -412,8 +412,8 @@ DivePlannerPointsModel::DivePlannerPointsModel(QObject *parent) : QAbstractTable
DivePlannerPointsModel *DivePlannerPointsModel::instance()
{
- static QScopedPointer<DivePlannerPointsModel> self(new DivePlannerPointsModel());
- return self.data();
+ static DivePlannerPointsModel self;
+ return &self;
}
void DivePlannerPointsModel::emitDataChanged()