kio
kpreviewwidgetbase.cpp
Go to the documentation of this file.00001 /* 00002 * This file is part of the KDE project. 00003 * Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@kde.org> 00004 * 00005 * You can Freely distribute this program under the GNU Library General Public 00006 * License. See the file "COPYING" for the exact licensing terms. 00007 */ 00008 00009 #include "kpreviewwidgetbase.h" 00010 #include <qstringlist.h> 00011 00012 class KPreviewWidgetBase::KPreviewWidgetBasePrivate 00013 { 00014 public: 00015 QStringList supportedMimeTypes; 00016 }; 00017 00018 QPtrDict<KPreviewWidgetBase::KPreviewWidgetBasePrivate> * KPreviewWidgetBase::s_private; 00019 00020 KPreviewWidgetBase::KPreviewWidgetBase( QWidget *parent, const char *name ) 00021 : QWidget( parent, name ) 00022 { 00023 if ( !s_private ) 00024 s_private = new QPtrDict<KPreviewWidgetBasePrivate>(); 00025 00026 s_private->insert( this, new KPreviewWidgetBasePrivate() ); 00027 } 00028 00029 KPreviewWidgetBase::~KPreviewWidgetBase() 00030 { 00031 s_private->remove( this ); 00032 if ( s_private->isEmpty() ) 00033 { 00034 delete s_private; 00035 s_private = 0L; 00036 } 00037 } 00038 00039 void KPreviewWidgetBase::setSupportedMimeTypes( const QStringList& mimeTypes ) 00040 { 00041 d()->supportedMimeTypes = mimeTypes; 00042 } 00043 00044 QStringList KPreviewWidgetBase::supportedMimeTypes() const 00045 { 00046 return d()->supportedMimeTypes; 00047 } 00048 00049 #include "kpreviewwidgetbase.moc"