Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Okular
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
36
Merge Requests
36
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Graphics
Okular
Commits
ee7e3737
Commit
ee7e3737
authored
Feb 20, 2017
by
Albert Astals Cid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Account for non local non relative video file urls
BUGS: 376574
parent
6f3970db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
32 deletions
+22
-32
ui/videowidget.cpp
ui/videowidget.cpp
+22
-32
No files found.
ui/videowidget.cpp
View file @
ee7e3737
...
...
@@ -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
&
)
)
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment