mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
Merge remote-tracking branch 'origin/Applications/16.12'
This commit is contained in:
commit
ac345ba4dc
|
@ -99,6 +99,25 @@ public:
|
|||
double repetitionsLeft;
|
||||
};
|
||||
|
||||
static QUrl urlFromUrlString(const QString &url, Okular::Document *document)
|
||||
{
|
||||
QUrl newurl;
|
||||
if ( url.startsWith( QLatin1Char( '/' ) ) )
|
||||
{
|
||||
newurl = QUrl::fromLocalFile( url );
|
||||
}
|
||||
else
|
||||
{
|
||||
newurl = QUrl( url );
|
||||
if ( newurl.isRelative() )
|
||||
{
|
||||
newurl = document->currentDocument().adjusted(QUrl::RemoveFilename);
|
||||
newurl.setPath( newurl.path() + url );
|
||||
}
|
||||
}
|
||||
return newurl;
|
||||
}
|
||||
|
||||
void VideoWidget::Private::load()
|
||||
{
|
||||
repetitionsLeft = movie->playRepetitions();
|
||||
|
@ -107,21 +126,7 @@ void VideoWidget::Private::load()
|
|||
|
||||
loaded = true;
|
||||
|
||||
QString url = movie->url();
|
||||
QUrl newurl;
|
||||
if ( QDir::isRelativePath( url ) )
|
||||
{
|
||||
newurl = document->currentDocument().adjusted(QUrl::RemoveFilename);
|
||||
newurl.setPath( newurl.path() + url );
|
||||
}
|
||||
else
|
||||
{
|
||||
newurl = QUrl::fromLocalFile(url);
|
||||
}
|
||||
if ( newurl.isLocalFile() )
|
||||
player->load( newurl );
|
||||
else
|
||||
player->load( newurl );
|
||||
player->load( urlFromUrlString( movie->url(), document ) );
|
||||
|
||||
connect( player->mediaObject(), SIGNAL( stateChanged( Phonon::State, Phonon::State ) ),
|
||||
q, SLOT( stateChanged( Phonon::State, Phonon::State ) ) );
|
||||
|
@ -145,23 +150,8 @@ void VideoWidget::Private::setupPlayPauseAction( PlayPauseMode mode )
|
|||
|
||||
void VideoWidget::Private::takeSnapshot()
|
||||
{
|
||||
const QString url = movie->url();
|
||||
QUrl newurl;
|
||||
if ( QDir::isRelativePath( url ) )
|
||||
{
|
||||
newurl = document->currentDocument().adjusted(QUrl::RemoveFilename);
|
||||
newurl.setPath( newurl.path() + url );
|
||||
}
|
||||
else
|
||||
{
|
||||
newurl = QUrl::fromLocalFile(url);
|
||||
}
|
||||
|
||||
SnapshotTaker *taker = 0;
|
||||
if ( newurl.isLocalFile() )
|
||||
taker = new SnapshotTaker( newurl, q );
|
||||
else
|
||||
taker = new SnapshotTaker( newurl, q );
|
||||
const QUrl url = urlFromUrlString( movie->url(), document );
|
||||
SnapshotTaker *taker = new SnapshotTaker( url, q );
|
||||
|
||||
q->connect( taker, SIGNAL( finished( const QImage& ) ), q, SLOT( setPosterImage( const QImage& ) ) );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue