--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/testobjectstore.cpp Tue Aug 31 15:15:55 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "testobjectstore.h"
+
+TestObjectStore::TestObjectStore()
+{
+
+}
+
+TestObjectStore::~TestObjectStore()
+{
+ while(!mObjects.isEmpty())
+ {
+ QObject *obj = mObjects.takeFirst();
+ delete obj;
+ }
+}
+
+TestObjectStore &TestObjectStore::instance()
+{
+ static TestObjectStore _store;
+ return _store;
+}
+
+void TestObjectStore::addObject(QObject *object)
+{
+ if(connect(object, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *))))
+ {
+ mObjects.append(object);
+ }
+}
+
+void TestObjectStore::objectDestroyed(QObject *obj)
+{
+ if(obj)
+ {
+ disconnect(obj, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *)));
+ mObjects.removeOne(obj);
+ }
+}