Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F16570530
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
24 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/interfaces/kmediaplayer/CMakeLists.txt b/interfaces/kmediaplayer/CMakeLists.txt
index 0482d8050c..413f2002b0 100644
--- a/interfaces/kmediaplayer/CMakeLists.txt
+++ b/interfaces/kmediaplayer/CMakeLists.txt
@@ -1,33 +1,34 @@
add_subdirectory( kfileaudiopreview )
include_directories( ${KDE4_KPARTS_INCLUDES} )
########### next target ###############
set(kmediaplayer_LIB_SRCS
player.cpp
view.cpp
kmediaplayeradaptor.cpp
)
kde4_add_library(kmediaplayer ${LIBRARY_TYPE} ${kmediaplayer_LIB_SRCS})
-generate_export_header(kmediaplayer)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/kmediaplayer)
+generate_export_header(kmediaplayer EXPORT_FILE_NAME kmediaplayer/kmediaplayer_export.h)
target_link_libraries(kmediaplayer ${KDE4_KPARTS_LIBS} )
target_link_libraries(kmediaplayer LINK_INTERFACE_LIBRARIES ${KDE4_KPARTS_LIBS} ${QT_QTGUI_LIBRARY} )
set_target_properties(kmediaplayer PROPERTIES
VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
)
install(TARGETS kmediaplayer ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kmediaplayer_export.h player.h view.h DESTINATION ${INCLUDE_INSTALL_DIR}/kmediaplayer COMPONENT Devel)
install( FILES kmediaplayerengine.desktop kmediaplayer.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
install( FILES org.kde.KMediaPlayer.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
diff --git a/kio/kfile/kfilemetapreview.cpp b/kio/kfile/kfilemetapreview.cpp
index f9c9ed350e..3024d583a6 100644
--- a/kio/kfile/kfilemetapreview.cpp
+++ b/kio/kfile/kfilemetapreview.cpp
@@ -1,200 +1,200 @@
/*
* This file is part of the KDE project.
* Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@kde.org>
*
* You can Freely distribute this program under the GNU Library General Public
* License. See the file "COPYING" for the exact licensing terms.
*/
#include "kfilemetapreview.h"
#include <QLayout>
#include <kdebug.h>
#include <kio/previewjob.h>
#include <kpluginloader.h>
#include <kpluginfactory.h>
#include <kimagefilepreview.h>
bool KFileMetaPreview::s_tryAudioPreview = true;
KFileMetaPreview::KFileMetaPreview( QWidget *parent )
: KPreviewWidgetBase( parent ),
haveAudioPreview( false )
{
QHBoxLayout *layout = new QHBoxLayout( this );
layout->setMargin( 0 );
m_stack = new QStackedWidget( this );
layout->addWidget( m_stack );
// ###
// m_previewProviders.setAutoDelete( true );
initPreviewProviders();
}
KFileMetaPreview::~KFileMetaPreview()
{
}
void KFileMetaPreview::initPreviewProviders()
{
qDeleteAll(m_previewProviders);
m_previewProviders.clear();
// hardcoded so far
// image previews
KImageFilePreview *imagePreview = new KImageFilePreview( m_stack );
(void) m_stack->addWidget( imagePreview );
m_stack->setCurrentWidget ( imagePreview );
resize( imagePreview->sizeHint() );
const QStringList mimeTypes = imagePreview->supportedMimeTypes();
QStringList::ConstIterator it = mimeTypes.begin();
for ( ; it != mimeTypes.end(); ++it )
{
// qDebug(".... %s", (*it).toLatin1().constData());
m_previewProviders.insert( *it, imagePreview );
}
}
KPreviewWidgetBase* KFileMetaPreview::findExistingProvider(const QString& mimeType, const KMimeType::Ptr& mimeInfo) const
{
KPreviewWidgetBase* provider = m_previewProviders.value(mimeType);
if ( provider )
return provider;
if ( mimeInfo ) {
// check mime type inheritance
const QStringList parentMimeTypes = mimeInfo->allParentMimeTypes();
Q_FOREACH(const QString& parentMimeType, parentMimeTypes) {
provider = m_previewProviders.value(parentMimeType);
if (provider)
return provider;
}
}
// ### mimetype may be image/* for example, try that
const int index = mimeType.indexOf( '/' );
if (index > 0)
{
provider = m_previewProviders.value(mimeType.left(index + 1) + '*');
if (provider)
return provider;
}
return 0;
}
KPreviewWidgetBase * KFileMetaPreview::previewProviderFor( const QString& mimeType )
{
KMimeType::Ptr mimeInfo = KMimeType::mimeType( mimeType );
// qDebug("### looking for: %s", mimeType.toLatin1().constData());
// often the first highlighted item, where we can be sure, there is no plugin
// (this "folders reflect icons" is a konq-specific thing, right?)
if ( mimeInfo && mimeInfo->is("inode/directory") )
return 0L;
KPreviewWidgetBase *provider = findExistingProvider(mimeType, mimeInfo);
if (provider)
return provider;
//qDebug("#### didn't find anything for: %s", mimeType.toLatin1().constData());
if ( s_tryAudioPreview &&
!mimeType.startsWith(QLatin1String("text/")) &&
!mimeType.startsWith(QLatin1String("image/")) )
{
if ( !haveAudioPreview )
{
KPreviewWidgetBase *audioPreview = createAudioPreview( m_stack );
if ( audioPreview )
{
haveAudioPreview = true;
(void) m_stack->addWidget( audioPreview );
const QStringList mimeTypes = audioPreview->supportedMimeTypes();
QStringList::ConstIterator it = mimeTypes.begin();
for ( ; it != mimeTypes.end(); ++it )
{
// only add non already handled mimetypes
if ( m_previewProviders.constFind( *it ) == m_previewProviders.constEnd() )
m_previewProviders.insert( *it, audioPreview );
}
}
}
}
// with the new mimetypes from the audio-preview, try again
provider = findExistingProvider(mimeType, mimeInfo);
if (provider)
return provider;
// The logic in this code duplicates the logic in PreviewJob.
// But why do we need multiple KPreviewWidgetBase instances anyway?
return 0L;
}
-void KFileMetaPreview::showPreview(const KUrl &url)
+void KFileMetaPreview::showPreview(const QUrl &url)
{
KMimeType::Ptr mt = KMimeType::findByUrl( url );
KPreviewWidgetBase *provider = previewProviderFor( mt->name() );
if ( provider )
{
if ( provider != m_stack->currentWidget() ) // stop the previous preview
clearPreview();
m_stack->setEnabled( true );
m_stack->setCurrentWidget( provider );
provider->showPreview( url );
}
else
{
clearPreview();
m_stack->setEnabled( false );
}
}
void KFileMetaPreview::clearPreview()
{
if ( m_stack->currentWidget() )
static_cast<KPreviewWidgetBase*>( m_stack->currentWidget() )->clearPreview();
}
void KFileMetaPreview::addPreviewProvider( const QString& mimeType,
KPreviewWidgetBase *provider )
{
m_previewProviders.insert( mimeType, provider );
}
void KFileMetaPreview::clearPreviewProviders()
{
QHash<QString, KPreviewWidgetBase*>::const_iterator i = m_previewProviders.constBegin();
while (i != m_previewProviders.constEnd())
{
m_stack->removeWidget(i.value());
++i;
}
qDeleteAll(m_previewProviders);
m_previewProviders.clear();
}
// static
KPreviewWidgetBase * KFileMetaPreview::createAudioPreview( QWidget *parent )
{
KPluginLoader loader( "kfileaudiopreview" );
KPluginFactory *factory = loader.factory();
if ( !factory )
{
kWarning() << "Couldn't load kfileaudiopreview" << loader.errorString();
s_tryAudioPreview = false;
return 0L;
}
KPreviewWidgetBase* w = factory->create<KPreviewWidgetBase>( parent );
if ( w )
w->setObjectName( "kfileaudiopreview" );
return w;
}
#include "moc_kfilemetapreview.cpp"
diff --git a/kio/kfile/kfilemetapreview.h b/kio/kfile/kfilemetapreview.h
index 551c976126..91806e0684 100644
--- a/kio/kfile/kfilemetapreview.h
+++ b/kio/kfile/kfilemetapreview.h
@@ -1,54 +1,54 @@
/*
* This file is part of the KDE project.
* Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@kde.org>
*
* You can Freely distribute this program under the GNU Library General Public
* License. See the file "COPYING" for the exact licensing terms.
*/
#ifndef KFILEMETAPREVIEW_H
#define KFILEMETAPREVIEW_H
#include <QHash>
#include <QStackedWidget>
#include <kpreviewwidgetbase.h>
#include <kurl.h>
#include <kmimetype.h>
class KIO_EXPORT KFileMetaPreview : public KPreviewWidgetBase
{
Q_OBJECT
public:
KFileMetaPreview(QWidget *parent);
~KFileMetaPreview();
virtual void addPreviewProvider( const QString& mimeType,
KPreviewWidgetBase *provider );
virtual void clearPreviewProviders();
public Q_SLOTS:
- virtual void showPreview(const KUrl &url);
+ virtual void showPreview(const QUrl &url);
virtual void clearPreview();
protected:
virtual KPreviewWidgetBase *previewProviderFor( const QString& mimeType );
private:
void initPreviewProviders();
KPreviewWidgetBase* findExistingProvider(const QString& mimeType, const KMimeType::Ptr& mimeInfo) const;
QStackedWidget *m_stack;
QHash<QString,KPreviewWidgetBase*> m_previewProviders;
bool haveAudioPreview;
// may return 0L
static KPreviewWidgetBase * createAudioPreview( QWidget *parent );
static bool s_tryAudioPreview;
private:
class KFileMetaPreviewPrivate;
KFileMetaPreviewPrivate *d;
};
#endif // KFILEMETAPREVIEW_H
diff --git a/kio/kfile/kimagefilepreview.cpp b/kio/kfile/kimagefilepreview.cpp
index 9cd4b182ac..9fc3c2235e 100644
--- a/kio/kfile/kimagefilepreview.cpp
+++ b/kio/kfile/kimagefilepreview.cpp
@@ -1,286 +1,286 @@
/*
* This file is part of the KDE project
* Copyright (C) 2001 Martin R. Jones <mjones@kde.org>
* 2001 Carsten Pfeiffer <pfeiffer@kde.org>
* 2008 Rafael Fernández López <ereslibre@kde.org>
*
* You can Freely distribute this program under the GNU Library General Public
* License. See the file "COPYING" for the exact licensing terms.
*/
#include "kimagefilepreview.h"
#include <QLayout>
#include <QLabel>
#include <QPainter>
#include <QComboBox>
#include <QCheckBox>
#include <QResizeEvent>
#include <QtCore/QTimer>
#include <QtCore/QTimeLine>
#include <kglobalsettings.h>
#include <kconfig.h>
#include <kiconloader.h>
#include <kdebug.h>
#include <klocale.h>
#include <kfileitem.h>
#include <kio/previewjob.h>
#include <kconfiggroup.h>
#include <config-kfile.h>
/**** KImageFilePreview ****/
class KImageFilePreview::KImageFilePreviewPrivate
{
public:
KImageFilePreviewPrivate()
: m_job(0)
, clear(true)
{
m_timeLine = new QTimeLine(150);
m_timeLine->setCurveShape(QTimeLine::EaseInCurve);
m_timeLine->setDirection(QTimeLine::Forward);
m_timeLine->setFrameRange(0, 100);
}
~KImageFilePreviewPrivate()
{
delete m_timeLine;
}
void _k_slotResult( KJob* );
void _k_slotFailed( const KFileItem& );
void _k_slotStepAnimation( int frame );
void _k_slotFinished( );
void _k_slotActuallyClear( );
KUrl currentURL;
KUrl lastShownURL;
QLabel *imageLabel;
KIO::PreviewJob *m_job;
QTimeLine *m_timeLine;
QPixmap m_pmCurrent;
QPixmap m_pmTransition;
float m_pmCurrentOpacity;
float m_pmTransitionOpacity;
bool clear;
};
KImageFilePreview::KImageFilePreview( QWidget *parent )
: KPreviewWidgetBase(parent), d(new KImageFilePreviewPrivate)
{
QVBoxLayout *vb = new QVBoxLayout( this );
vb->setMargin( 0 );
d->imageLabel = new QLabel(this);
d->imageLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
d->imageLabel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
vb->addWidget(d->imageLabel);
setSupportedMimeTypes( KIO::PreviewJob::supportedMimeTypes() );
setMinimumWidth( 50 );
connect(d->m_timeLine, SIGNAL(frameChanged(int)), this, SLOT(_k_slotStepAnimation(int)));
connect(d->m_timeLine, SIGNAL(finished()), this, SLOT(_k_slotFinished()));
}
KImageFilePreview::~KImageFilePreview()
{
if (d->m_job) {
d->m_job->kill();
}
delete d;
}
void KImageFilePreview::showPreview()
{
// Pass a copy since clearPreview() will clear currentURL
KUrl url = d->currentURL;
showPreview( url, true );
}
// called via KPreviewWidgetBase interface
-void KImageFilePreview::showPreview( const KUrl& url )
+void KImageFilePreview::showPreview( const QUrl& url )
{
showPreview( url, false );
}
-void KImageFilePreview::showPreview( const KUrl &url, bool force )
+void KImageFilePreview::showPreview( const QUrl &url, bool force )
{
if (!url.isValid() ||
(d->lastShownURL.isValid() &&
- url.equals(d->lastShownURL, KUrl::CompareWithoutTrailingSlash) &&
+ KUrl(url).equals(d->lastShownURL, KUrl::CompareWithoutTrailingSlash) &&
d->currentURL.isValid()))
return;
d->clear = false;
d->currentURL = url;
d->lastShownURL = url;
int w = d->imageLabel->contentsRect().width() - 4;
int h = d->imageLabel->contentsRect().height() - 4;
if (d->m_job) {
disconnect(d->m_job, SIGNAL(result(KJob *)),
this, SLOT( _k_slotResult( KJob * )));
disconnect(d->m_job, SIGNAL(gotPreview(const KFileItem&,
const QPixmap& )), this,
SLOT( gotPreview( const KFileItem&, const QPixmap& ) ));
disconnect(d->m_job, SIGNAL(failed(const KFileItem&)),
this, SLOT(_k_slotFailed(const KFileItem&)));
d->m_job->kill();
}
d->m_job = createJob(url, w, h);
if ( force ) // explicitly requested previews shall always be generated!
d->m_job->setIgnoreMaximumSize(true);
connect(d->m_job, SIGNAL(result(KJob *)),
this, SLOT( _k_slotResult( KJob * )));
connect(d->m_job, SIGNAL(gotPreview(const KFileItem&,
const QPixmap& )),
SLOT( gotPreview( const KFileItem&, const QPixmap& ) ));
connect(d->m_job, SIGNAL(failed(const KFileItem&)),
this, SLOT(_k_slotFailed(const KFileItem&)));
}
void KImageFilePreview::resizeEvent( QResizeEvent * )
{
clearPreview();
- d->currentURL = KUrl(); // force this to actually happen
+ d->currentURL = QUrl(); // force this to actually happen
showPreview( d->lastShownURL );
}
QSize KImageFilePreview::sizeHint() const
{
return QSize( 100, 200 );
}
-KIO::PreviewJob * KImageFilePreview::createJob( const KUrl& url, int w, int h )
+KIO::PreviewJob * KImageFilePreview::createJob( const QUrl& url, int w, int h )
{
if (url.isValid()) {
KFileItemList items;
items.append(KFileItem(KFileItem::Unknown, KFileItem::Unknown, url, true));
QStringList plugins = KIO::PreviewJob::availablePlugins();
KIO::PreviewJob *previewJob = KIO::filePreview(items, QSize(w, h), &plugins);
previewJob->setOverlayIconAlpha(0);
previewJob->setScaleType(KIO::PreviewJob::Scaled);
return previewJob;
} else {
return 0;
}
}
void KImageFilePreview::gotPreview( const KFileItem& item, const QPixmap& pm )
{
if (item.url() == d->currentURL) { // should always be the case
if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects) {
if (d->m_timeLine->state() == QTimeLine::Running) {
d->m_timeLine->setCurrentTime(0);
}
d->m_pmTransition = pm;
d->m_pmTransitionOpacity = 0;
d->m_pmCurrentOpacity = 1;
d->m_timeLine->setDirection(QTimeLine::Forward);
d->m_timeLine->start();
}
else
{
d->imageLabel->setPixmap(pm);
}
}
}
void KImageFilePreview::KImageFilePreviewPrivate::_k_slotFailed( const KFileItem& item )
{
if ( item.isDir() )
imageLabel->clear();
else if (item.url() == currentURL) // should always be the case
imageLabel->setPixmap(SmallIcon( "image-missing", KIconLoader::SizeLarge,
KIconLoader::DisabledState ));
}
void KImageFilePreview::KImageFilePreviewPrivate::_k_slotResult( KJob *job )
{
if (job == m_job) {
m_job = 0L;
}
}
void KImageFilePreview::KImageFilePreviewPrivate::_k_slotStepAnimation( int frame )
{
Q_UNUSED(frame)
QPixmap pm(QSize(qMax(m_pmCurrent.size().width(), m_pmTransition.size().width()),
qMax(m_pmCurrent.size().height(), m_pmTransition.size().height())));
pm.fill(Qt::transparent);
QPainter p(&pm);
p.setOpacity(m_pmCurrentOpacity);
//If we have a current pixmap
if (!m_pmCurrent.isNull())
p.drawPixmap(QPoint(((float) pm.size().width() - m_pmCurrent.size().width()) / 2.0,
((float) pm.size().height() - m_pmCurrent.size().height()) / 2.0), m_pmCurrent);
if (!m_pmTransition.isNull()) {
p.setOpacity(m_pmTransitionOpacity);
p.drawPixmap(QPoint(((float) pm.size().width() - m_pmTransition.size().width()) / 2.0,
((float) pm.size().height() - m_pmTransition.size().height()) / 2.0), m_pmTransition);
}
p.end();
imageLabel->setPixmap(pm);
m_pmCurrentOpacity = qMax(m_pmCurrentOpacity - 0.4, 0.0); // krazy:exclude=qminmax
m_pmTransitionOpacity = qMin(m_pmTransitionOpacity + 0.4, 1.0); //krazy:exclude=qminmax
}
void KImageFilePreview::KImageFilePreviewPrivate::_k_slotFinished()
{
m_pmCurrent = m_pmTransition;
m_pmTransitionOpacity = 0;
m_pmCurrentOpacity = 1;
m_pmTransition = QPixmap();
// The animation might have lost some frames. Be sure that if the last one
// was dropped, the last image shown is the opaque one.
imageLabel->setPixmap(m_pmCurrent);
clear = false;
}
void KImageFilePreview::clearPreview()
{
if (d->m_job) {
d->m_job->kill();
d->m_job = 0L;
}
if (d->clear || d->m_timeLine->state() == QTimeLine::Running) {
return;
}
if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects) {
d->m_pmTransition = QPixmap();
//If we add a previous preview then we run the animation
if (!d->m_pmCurrent.isNull()) {
d->m_timeLine->setCurrentTime(0);
d->m_timeLine->setDirection(QTimeLine::Backward);
d->m_timeLine->start();
}
- d->currentURL = KUrl();
+ d->currentURL = QUrl();
d->clear = true;
}
else
{
d->imageLabel->clear();
}
}
#include "moc_kimagefilepreview.cpp"
diff --git a/kio/kfile/kimagefilepreview.h b/kio/kfile/kimagefilepreview.h
index 9eae650282..4db4c3039a 100644
--- a/kio/kfile/kimagefilepreview.h
+++ b/kio/kfile/kimagefilepreview.h
@@ -1,82 +1,81 @@
/*
*
* This file is part of the KDE project.
* Copyright (C) 2001 Martin R. Jones <mjones@kde.org>
* 2001 Carsten Pfeiffer <pfeiffer@kde.org>
* 2008 Rafael Fernández López <ereslibre@kde.org>
*
* You can Freely distribute this program under the GNU Library General Public
* License. See the file "COPYING" for the exact licensing terms.
*/
#ifndef KIMAGEFILEPREVIEW_H
#define KIMAGEFILEPREVIEW_H
#include <QPixmap>
-
-#include <kurl.h>
+#include <QUrl>
#include <kpreviewwidgetbase.h>
class KFileItem;
class KJob;
namespace KIO { class PreviewJob; }
/**
* Image preview widget for the file dialog.
*/
class KIO_EXPORT KImageFilePreview : public KPreviewWidgetBase
{
Q_OBJECT
public:
/**
* Creates a new image file preview.
*
* @param parent The parent widget.
*/
explicit KImageFilePreview(QWidget *parent = 0);
/**
* Destroys the image file preview.
*/
~KImageFilePreview();
/**
* Returns the size hint for this widget.
*/
virtual QSize sizeHint() const;
public Q_SLOTS:
/**
* Shows a preview for the given @p url.
*/
- virtual void showPreview(const KUrl &url);
+ virtual void showPreview(const QUrl &url);
/**
* Clears the preview.
*/
virtual void clearPreview();
protected Q_SLOTS:
void showPreview();
- void showPreview( const KUrl& url, bool force );
+ void showPreview( const QUrl& url, bool force );
virtual void gotPreview( const KFileItem&, const QPixmap& );
protected:
virtual void resizeEvent( QResizeEvent *event );
- virtual KIO::PreviewJob * createJob( const KUrl& url, int width, int height );
+ virtual KIO::PreviewJob * createJob( const QUrl& url, int width, int height );
private:
class KImageFilePreviewPrivate;
KImageFilePreviewPrivate *const d;
Q_DISABLE_COPY(KImageFilePreview)
Q_PRIVATE_SLOT( d, void _k_slotResult( KJob* ) )
Q_PRIVATE_SLOT( d, void _k_slotFailed( const KFileItem& ) )
Q_PRIVATE_SLOT( d, void _k_slotStepAnimation( int frame ) )
Q_PRIVATE_SLOT( d, void _k_slotFinished( ) )
};
#endif // KIMAGEFILEPREVIEW_H
diff --git a/kio/kfile/kpreviewwidgetbase.h b/kio/kfile/kpreviewwidgetbase.h
index 6511cc975d..e755880c36 100644
--- a/kio/kfile/kpreviewwidgetbase.h
+++ b/kio/kfile/kpreviewwidgetbase.h
@@ -1,86 +1,86 @@
/* This file is part of the KDE libraries
* Copyright (C) 2001 Frerich Raabe <raabe@kde.org>
* 2003 Carsten Pfeiffer <pfeiffer@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __KPREVIEWWIDGETBASE_H__
#define __KPREVIEWWIDGETBASE_H__
#include <QWidget>
#include <kio/kio_export.h>
-class KUrl;
+class QUrl;
/**
* Abstract baseclass for all preview widgets which shall be used via
* KFileDialog::setPreviewWidget(const KPreviewWidgetBase *).
* Ownership will be transferred to KFileDialog, so you have to create
* the preview with "new" and let KFileDialog delete it.
*
* Just derive your custom preview widget from KPreviewWidgetBase and implement
- * all the pure virtual methods. The slot showPreview(const KUrl &) is called
+ * all the pure virtual methods. The slot showPreview(const QUrl &) is called
* every time the file selection changes.
*
* @short Abstract baseclass for all preview widgets.
* @author Frerich Raabe <raabe@kde.org>
*/
class KIO_EXPORT KPreviewWidgetBase : public QWidget
{
Q_OBJECT
public:
/**
* Constructor. Construct the user interface of your preview widget here
* and pass the KFileDialog this preview widget is going to be used in as
* the parent.
*
* @param parent The KFileDialog this preview widget is going to be used in
*/
KPreviewWidgetBase(QWidget *parent);
~KPreviewWidgetBase();
public Q_SLOTS:
/**
* This slot is called every time the user selects another file in the
* file dialog. Implement the stuff necessary to reflect the change here.
*
* @param url The URL of the currently selected file.
*/
- virtual void showPreview(const KUrl &url) = 0;
+ virtual void showPreview(const QUrl &url) = 0;
/**
* Reimplement this to clear the preview. This is called when e.g. the
* selection is cleared or when multiple selections exist, or the directory
* is changed.
*/
virtual void clearPreview() = 0;
QStringList supportedMimeTypes() const;
protected:
void setSupportedMimeTypes( const QStringList& mimeTypes );
private:
class KPreviewWidgetBasePrivate;
KPreviewWidgetBasePrivate *const d;
Q_DISABLE_COPY(KPreviewWidgetBase)
};
#endif
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Nov 1, 9:25 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10075827
Default Alt Text
(24 KB)
Attached To
Mode
rKL kdelibs
Attached
Detach File
Event Timeline
Log In to Comment