Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Elisa
Commits
af78af82
Commit
af78af82
authored
Oct 23, 2022
by
Tobias Fella
Committed by
Nate Graham
Oct 24, 2022
Browse files
Fix loading lines with file://
parent
c5774ceb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mediaplaylistproxymodel.cpp
View file @
af78af82
...
...
@@ -759,9 +759,11 @@ void MediaPlayListProxyModel::loadPlayList(const QUrl &fileName)
const
auto
data
=
inputFile
.
readAll
();
clearPlayList
();
auto
newTracks
=
DataTypes
::
EntryDataList
{};
for
(
const
auto
&
line
:
data
.
split
(
'\n'
))
{
for
(
const
auto
&
l
:
data
.
split
(
'\n'
))
{
const
auto
&
line
=
QString
::
fromUtf8
(
l
);
const
auto
&
url
=
line
.
startsWith
(
QStringLiteral
(
"file:/"
))
?
QUrl
(
line
)
:
QUrl
::
fromLocalFile
(
line
);
newTracks
.
push_back
({{{{
DataTypes
::
ElementTypeRole
,
ElisaUtils
::
FileName
},
{
DataTypes
::
ResourceRole
,
QUrl
::
fromLocalFile
(
QString
::
fromUtf8
(
line
))
}}},
{},
{}});
{
DataTypes
::
ResourceRole
,
url
}}},
{},
{}});
}
enqueue
(
newTracks
,
ElisaUtils
::
ReplacePlayList
,
ElisaUtils
::
DoNotTriggerPlay
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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