summaryrefslogtreecommitdiffstats
path: root/qt-models/cylindermodel.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/cylindermodel.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/cylindermodel.cpp')
-rw-r--r--qt-models/cylindermodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 9f34007c7..e46048222 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -31,8 +31,8 @@ QVariant CylindersModel::headerData(int section, Qt::Orientation orientation, in
CylindersModel *CylindersModel::instance()
{
- static QScopedPointer<CylindersModel> self(new CylindersModel());
- return self.data();
+ static CylindersModel self;
+ return &self;
}
static QString get_cylinder_string(cylinder_t *cyl)