summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write/qcleanuphandler.h
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-write/qcleanuphandler.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-write/qcleanuphandler.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/noncore/apps/opie-write/qcleanuphandler.h b/noncore/apps/opie-write/qcleanuphandler.h
index 5c5bf16..2d6eb7c 100644
--- a/noncore/apps/opie-write/qcleanuphandler.h
+++ b/noncore/apps/opie-write/qcleanuphandler.h
@@ -32,29 +32,25 @@
** not clear to you.
**
**********************************************************************/
#ifndef QCLEANUPHANDLER_H
#define QCLEANUPHANDLER_H
#ifndef QT_H
#include <qlist.h>
#endif // QT_H
template<class Type>
-#ifdef Q_NO_TEMPLATE_EXPORT
class QCleanupHandler
-#else
-class Q_EXPORT QCleanupHandler
-#endif
{
public:
QCleanupHandler() : cleanupObjects( 0 ) {}
~QCleanupHandler() { clear(); }
Type* add( Type **object ) {
if ( !cleanupObjects )
cleanupObjects = new QPtrList<Type*>;
cleanupObjects->insert( 0, object );
return *object;
}
@@ -79,53 +75,45 @@ public:
*object = 0;
cleanupObjects->remove( object );
}
delete cleanupObjects;
cleanupObjects = 0;
}
private:
QPtrList<Type*> *cleanupObjects;
};
template<class Type>
-#ifdef Q_NO_TEMPLATE_EXPORT
class QSingleCleanupHandler
-#else
-class Q_EXPORT QSingleCleanupHandler
-#endif
{
public:
QSingleCleanupHandler() : object( 0 ) {}
~QSingleCleanupHandler() {
if ( object ) {
delete *object;
*object = 0;
}
}
Type* set( Type **o ) {
object = o;
return *object;
}
void reset() { object = 0; }
private:
Type **object;
};
template<class Type>
-#ifdef Q_NO_TEMPLATE_EXPORT
class QSharedCleanupHandler
-#else
-class Q_EXPORT QSharedCleanupHandler
-#endif
{
public:
QSharedCleanupHandler() : object( 0 ) {}
~QSharedCleanupHandler() {
if ( object ) {
if ( (*object)->deref() )
delete *object;
*object = 0;
}
}
Type* set( Type **o ) {
object = o;