From 12c645ff827cea084b9739174685cee1a85b5fe9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 11 Feb 2009 21:34:07 +0000 Subject: [PATCH] use setUrl instead of setPath, more general, but still use a qstring, seems to work better with javascript svn path=/trunk/KDE/kdelibs/; revision=924896 --- widgets/videowidget.cpp | 10 ++++++---- widgets/videowidget.h | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/widgets/videowidget.cpp b/widgets/videowidget.cpp index 7b3863020..29e3e80e0 100644 --- a/widgets/videowidget.cpp +++ b/widgets/videowidget.cpp @@ -19,6 +19,8 @@ #include "videowidget.h" +#include + #include #include #include @@ -77,14 +79,14 @@ Phonon::AudioOutput *VideoWidget::audioOutput() const return d->audioOutput; } -void VideoWidget::setFile(const QString &path) +void VideoWidget::setUrl(const QString &url) { - d->media->setCurrentSource(Phonon::MediaSource(path)); + d->media->setCurrentSource(Phonon::MediaSource(url)); } -QString VideoWidget::file() const +QString VideoWidget::url() const { - return d->media->currentSource().fileName(); + return d->media->currentSource().url().toString(); } void VideoWidget::play() diff --git a/widgets/videowidget.h b/widgets/videowidget.h index 74a9dbd7c..67128391f 100644 --- a/widgets/videowidget.h +++ b/widgets/videowidget.h @@ -30,6 +30,8 @@ namespace Phonon { class AudioOutput; } +class KUrl; + namespace Plasma { @@ -47,7 +49,7 @@ class PLASMA_EXPORT VideoWidget : public QGraphicsProxyWidget { Q_OBJECT - Q_PROPERTY(QString file READ file WRITE setFile) + Q_PROPERTY(QString url READ url WRITE setUrl) Q_PROPERTY(QString currentTime READ currentTime) Q_PROPERTY(QString totalTime READ totalTime) Q_PROPERTY(QString remainingTime READ remainingTime) @@ -58,15 +60,15 @@ public: ~VideoWidget(); /** - * Choose what file to play + * Load a certain url that can be a local file or a remote one * @arg path resource to play */ - void setFile(const QString &path); + void setUrl(const QString &url); /** - * @return the file we are playing + * @return the url (local or remote) we are playing */ - QString file() const; + QString url() const; /** * @return the Phonon::MediaObject being used