summaryrefslogtreecommitdiff
path: root/core/launcher/qcleanuphandler_p.h
Unidiff
Diffstat (limited to 'core/launcher/qcleanuphandler_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/qcleanuphandler_p.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/launcher/qcleanuphandler_p.h b/core/launcher/qcleanuphandler_p.h
index d8cddac..04d5c7e 100644
--- a/core/launcher/qcleanuphandler_p.h
+++ b/core/launcher/qcleanuphandler_p.h
@@ -1,24 +1,44 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
1#ifndef QCLEANUPHANDLER_H 21#ifndef QCLEANUPHANDLER_H
2#define QCLEANUPHANDLER_H 22#define QCLEANUPHANDLER_H
3 23
4#ifndef QT_H 24#ifndef QT_H
5#include <qlist.h> 25#include <qlist.h>
6#endif // QT_H 26#endif // QT_H
7 27
8template<class Type> 28template<class Type>
9class Q_EXPORT QCleanupHandler 29class Q_EXPORT QCleanupHandler
10{ 30{
11public: 31public:
12 QCleanupHandler() : cleanupObjects( 0 ) {} 32 QCleanupHandler() : cleanupObjects( 0 ) {}
13 ~QCleanupHandler() { clear(); } 33 ~QCleanupHandler() { clear(); }
14 34
15 Type* add( Type **object ) { 35 Type* add( Type **object ) {
16 if ( !cleanupObjects ) 36 if ( !cleanupObjects )
17 cleanupObjects = new QList<Type*>; 37 cleanupObjects = new QList<Type*>;
18 cleanupObjects->insert( 0, object ); 38 cleanupObjects->insert( 0, object );
19 return *object; 39 return *object;
20 } 40 }
21 41
22 void remove( Type **object ) { 42 void remove( Type **object ) {
23 if ( !cleanupObjects ) 43 if ( !cleanupObjects )
24 return; 44 return;