Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
44b91973
Commit
44b91973
authored
Feb 28, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mapper: use class Path
parent
7a8f96b1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
Mapper.cxx
src/Mapper.cxx
+3
-1
Mapper.hxx
src/Mapper.hxx
+2
-1
PlaylistFile.cxx
src/PlaylistFile.cxx
+5
-3
No files found.
src/Mapper.cxx
View file @
44b91973
...
...
@@ -86,8 +86,10 @@ map_uri_fs(const char *uri)
}
std
::
string
map_fs_to_utf8
(
const
char
*
path_fs
)
map_fs_to_utf8
(
Path
_
path_fs
)
{
auto
path_fs
=
_path_fs
.
c_str
();
if
(
PathTraitsFS
::
IsSeparator
(
path_fs
[
0
]))
{
if
(
instance
->
storage
==
nullptr
)
return
std
::
string
();
...
...
src/Mapper.hxx
View file @
44b91973
...
...
@@ -30,6 +30,7 @@
#define PLAYLIST_FILE_SUFFIX ".m3u"
class
Path
;
class
AllocatedPath
;
void
...
...
@@ -58,7 +59,7 @@ map_uri_fs(const char *uri);
*/
gcc_pure
std
::
string
map_fs_to_utf8
(
const
char
*
path_fs
);
map_fs_to_utf8
(
Path
path_fs
);
#endif
...
...
src/PlaylistFile.cxx
View file @
44b91973
...
...
@@ -268,13 +268,15 @@ LoadPlaylistFile(const char *utf8path, Error &error)
if
(
*
s
==
0
||
*
s
==
PLAYLIST_COMMENT
)
continue
;
const
Path
path
=
Path
::
FromFS
(
s
);
std
::
string
uri_utf8
;
if
(
!
uri_has_scheme
(
s
))
{
#ifdef ENABLE_DATABASE
uri_utf8
=
map_fs_to_utf8
(
s
);
uri_utf8
=
map_fs_to_utf8
(
path
);
if
(
uri_utf8
.
empty
())
{
if
(
PathTraitsFS
::
IsAbsolute
(
s
))
{
if
(
path
.
IsAbsolute
(
))
{
uri_utf8
=
PathToUTF8
(
s
);
if
(
uri_utf8
.
empty
())
continue
;
...
...
@@ -287,7 +289,7 @@ LoadPlaylistFile(const char *utf8path, Error &error)
continue
;
#endif
}
else
{
uri_utf8
=
PathToUTF8
(
s
);
uri_utf8
=
path
.
ToUTF8
(
);
if
(
uri_utf8
.
empty
())
continue
;
}
...
...
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