[vlmc-devel] Remove QSingleton class

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 29 01:21:13 CET 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Feb 29 01:20:54 2016 +0100| [7c0d54a542754baf07e2c9bc2601ab5bb2c91178] | committer: Hugo Beauzée-Luyssen

Remove QSingleton class

> https://code.videolan.org/videolan/vlmc/commit/7c0d54a542754baf07e2c9bc2601ab5bb2c91178
---

 src/CMakeLists.txt       |  1 -
 src/Gui/About.h          |  1 -
 src/Tools/QSingleton.hpp | 72 ------------------------------------------------
 3 files changed, 74 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6cfd5f7..29fd0fb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -51,7 +51,6 @@ SET(VLMC_SRCS
     Settings/SettingValue.cpp
     Tools/ErrorHandler.cpp
     Tools/MemoryPool.hpp
-    Tools/QSingleton.hpp
     Tools/RendererEventWatcher.cpp
     Tools/Singleton.hpp
     Tools/Toggleable.hpp
diff --git a/src/Gui/About.h b/src/Gui/About.h
index 743c2aa..b568bb3 100644
--- a/src/Gui/About.h
+++ b/src/Gui/About.h
@@ -24,7 +24,6 @@
 #ifndef ABOUT_H
 #define ABOUT_H
 
-#include "Tools/QSingleton.hpp"
 #include "ui_About.h"
 
 #include <QDialog>
diff --git a/src/Tools/QSingleton.hpp b/src/Tools/QSingleton.hpp
deleted file mode 100644
index 3fe4cb3..0000000
--- a/src/Tools/QSingleton.hpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*****************************************************************************
- * QSingleton.hpp : Generic singleton pattern implementation with Qt parent's
- *                  parameter that can be passed to the ctor
- *****************************************************************************
- * Copyright (C) 2008-2014 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-
-/** \file
-  * This file contain the templated singleton.
-  * Class/struct to be singletonized just have to
-  * iherit from this classe with the class/struct type in template
-  * parameter.You have to do few other things, but you know your job,
-  * don't you? :)
-  */
-
-#ifndef QSINGLETON_HPP
-#define QSINGLETON_HPP
-
-#include <stdlib.h>
-#include <QWidget>
-
-template <typename T>
-class       QSingleton
-{
-public:
-    static T*      getInstance( QWidget* parent = NULL )
-    {
-        if ( m_instance == NULL )
-            m_instance = new T( parent );
-        return m_instance;
-    }
-
-    static void    destroyInstance()
-    {
-        if ( m_instance != NULL )
-        {
-            delete m_instance;
-            m_instance = NULL;
-        }
-    }
-protected:
-    QSingleton(){}
-    virtual ~QSingleton(){}
-    //Not implemented since these methods should *NEVER* been called. If they do, it probably won't compile :)
-    QSingleton(const QSingleton<T>&);
-    QSingleton<T>&   operator=(const QSingleton<T>&);
-
-private:
-    static T*      m_instance;
-};
-
-template <typename T>
-T*  QSingleton<T>::m_instance = NULL;
-
-#endif // QSINGLETON_HPP



More information about the Vlmc-devel mailing list