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
c134adbc
Commit
c134adbc
authored
Jul 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapper: pass music and playlist directory to mapper_init()
Added another glue function in main().
parent
7bc8c751
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
19 deletions
+23
-19
main.c
src/main.c
+17
-1
mapper.c
src/mapper.c
+5
-17
mapper.h
src/mapper.h
+1
-1
No files found.
src/main.c
View file @
c134adbc
...
...
@@ -100,6 +100,22 @@ glue_daemonize_init(const struct options *options)
daemonize_kill
();
}
static
void
glue_mapper_init
(
void
)
{
const
char
*
music_dir
,
*
playlist_dir
;
music_dir
=
config_get_path
(
CONF_MUSIC_DIR
);
#if GLIB_CHECK_VERSION(2,14,0)
if
(
music_dir
==
NULL
)
music_dir
=
g_get_user_special_dir
(
G_USER_DIRECTORY_MUSIC
);
#endif
playlist_dir
=
config_get_path
(
CONF_PLAYLIST_DIR
);
mapper_init
(
music_dir
,
playlist_dir
);
}
/**
* Returns the database. If this function returns false, this has not
* succeeded, and the caller should create the database after the
...
...
@@ -304,7 +320,7 @@ int main(int argc, char *argv[])
event_pipe_register
(
PIPE_EVENT_IDLE
,
idle_event_emitted
);
path_global_init
();
mapper_init
();
glue_
mapper_init
();
initPermissions
();
playlist_global_init
();
spl_global_init
();
...
...
src/mapper.c
View file @
c134adbc
...
...
@@ -25,7 +25,6 @@
#include "directory.h"
#include "song.h"
#include "path.h"
#include "conf.h"
#include <glib.h>
...
...
@@ -90,24 +89,13 @@ mapper_set_playlist_dir(const char *path)
playlist_dir
);
}
void
mapper_init
(
void
)
void
mapper_init
(
const
char
*
_music_dir
,
const
char
*
_playlist_dir
)
{
const
char
*
path
;
path
=
config_get_path
(
CONF_MUSIC_DIR
);
if
(
path
!=
NULL
)
mapper_set_music_dir
(
path
);
#if GLIB_CHECK_VERSION(2,14,0)
else
{
path
=
g_get_user_special_dir
(
G_USER_DIRECTORY_MUSIC
);
if
(
path
!=
NULL
)
mapper_set_music_dir
(
path
);
}
#endif
if
(
_music_dir
!=
NULL
)
mapper_set_music_dir
(
_music_dir
);
path
=
config_get_path
(
CONF_PLAYLIST_DIR
);
if
(
path
!=
NULL
)
mapper_set_playlist_dir
(
path
);
if
(
_playlist_dir
!=
NULL
)
mapper_set_playlist_dir
(
_playlist_dir
);
}
void
mapper_finish
(
void
)
...
...
src/mapper.h
View file @
c134adbc
...
...
@@ -31,7 +31,7 @@
struct
directory
;
struct
song
;
void
mapper_init
(
void
);
void
mapper_init
(
const
char
*
_music_dir
,
const
char
*
_playlist_dir
);
void
mapper_finish
(
void
);
...
...
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