From 130f109442de7b5b047cc10b0e4534169459d291 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 20 Dec 2017 20:00:26 +0100 Subject: 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 --- qt-models/cylindermodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models/cylindermodel.cpp') 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 self(new CylindersModel()); - return self.data(); + static CylindersModel self; + return &self; } static QString get_cylinder_string(cylinder_t *cyl) -- cgit v1.2.3-70-g09d2