1 /* 2 * SPDX-FileCopyrightText: 2014 Kevin Ottens <ervin@kde.org> 3 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 4 */ 5 6 7 #include "dependencymanager.h" 8 9 using namespace Utils; 10 Q_GLOBAL_STATIC(DependencyManager,s_globalInstance)11Q_GLOBAL_STATIC(DependencyManager, s_globalInstance) 12 13 DependencyManager &DependencyManager::globalInstance() 14 { 15 return *s_globalInstance(); 16 } 17 DependencyManager()18DependencyManager::DependencyManager() 19 { 20 } 21 DependencyManager(const DependencyManager & other)22DependencyManager::DependencyManager(const DependencyManager &other) 23 : m_cleanupFunctions(other.m_cleanupFunctions) 24 { 25 } 26 ~DependencyManager()27DependencyManager::~DependencyManager() 28 { 29 for (const auto &cleanupFunction : qAsConst(m_cleanupFunctions)) { 30 cleanupFunction(this); 31 } 32 } 33 operator =(const DependencyManager & other)34DependencyManager &DependencyManager::operator=(const DependencyManager &other) 35 { 36 m_cleanupFunctions = other.m_cleanupFunctions; 37 return *this; 38 } 39