mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
make use of KUrl in plasma phonon call
KUrl handles "file://" appending when neccessary
This commit is contained in:
parent
c4af529e42
commit
a636636b0e
1 changed files with 3 additions and 10 deletions
|
@ -167,7 +167,7 @@ void VideoWidgetPrivate::showOpenFileDialog()
|
|||
|
||||
void VideoWidgetPrivate::openFile(const QString &path)
|
||||
{
|
||||
media->setCurrentSource(Phonon::MediaSource(path));
|
||||
media->setCurrentSource(Phonon::MediaSource(KUrl(path)));
|
||||
media->play();
|
||||
}
|
||||
|
||||
|
@ -282,18 +282,11 @@ Phonon::AudioOutput *VideoWidget::audioOutput() const
|
|||
|
||||
void VideoWidget::setUrl(const QString &url)
|
||||
{
|
||||
QString fileUrl;
|
||||
if (url.startsWith('/')) {
|
||||
fileUrl = "file://" % url;
|
||||
} else {
|
||||
fileUrl = url;
|
||||
}
|
||||
|
||||
if (fileUrl == d->media->currentSource().url().toString()) {
|
||||
if (url == d->media->currentSource().url().toString()) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->media->setCurrentSource(Phonon::MediaSource(fileUrl));
|
||||
d->media->setCurrentSource(Phonon::MediaSource(KUrl(url)));
|
||||
}
|
||||
|
||||
QString VideoWidget::url() const
|
||||
|
|
Loading…
Add table
Reference in a new issue