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 --- core/gettextfromc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/gettextfromc.cpp b/core/gettextfromc.cpp index 8d1bbc1bd..e668fec2e 100644 --- a/core/gettextfromc.cpp +++ b/core/gettextfromc.cpp @@ -18,8 +18,8 @@ void gettextFromC::reset(void) gettextFromC *gettextFromC::instance() { - static QScopedPointer self(new gettextFromC()); - return self.data(); + static gettextFromC self; + return &self; } extern "C" const char *trGettext(const char *text) -- cgit v1.2.3-70-g09d2