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
886ed1b2
Commit
886ed1b2
authored
Jan 01, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapper: fall back to XDG music directory
If no music_directory is configured, fall back to the XDG music directory, determined by g_get_user_special_dir(G_USER_DIRECTORY_MUSIC).
parent
46aedbae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
NEWS
NEWS
+1
-0
mapper.c
src/mapper.c
+11
-1
No files found.
NEWS
View file @
886ed1b2
...
...
@@ -8,6 +8,7 @@ ver 0.15 - (200?/??/??)
* the option "error_file" was removed, all messages are logged into
"log_file"
* support logging to syslog
* fall back to XDG music directory if no music_directory is configured
ver 0.14 (2008/12/25)
* audio outputs:
...
...
src/mapper.c
View file @
886ed1b2
...
...
@@ -43,11 +43,21 @@ static size_t playlist_dir_length;
void
mapper_init
(
void
)
{
ConfigParam
*
music_dir_param
=
parseConfigFilePath
(
CONF_MUSIC_DIR
,
1
);
ConfigParam
*
music_dir_param
=
parseConfigFilePath
(
CONF_MUSIC_DIR
,
false
);
ConfigParam
*
playlist_dir_param
=
parseConfigFilePath
(
CONF_PLAYLIST_DIR
,
1
);
int
ret
;
struct
stat
st
;
if
(
music_dir_param
!=
NULL
)
{
music_dir
=
g_strdup
(
music_dir_param
->
value
);
}
else
{
music_dir
=
g_strdup
(
g_get_user_special_dir
(
G_USER_DIRECTORY_MUSIC
));
if
(
music_dir
==
NULL
)
/* GLib failed to determine the XDG music
directory - abort */
g_error
(
"config parameter
\"
%s
\"
not found
\n
"
,
CONF_MUSIC_DIR
);
}
music_dir
=
g_strdup
(
music_dir_param
->
value
);
music_dir_length
=
strlen
(
music_dir
);
...
...
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