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
4b010df9
Commit
4b010df9
authored
Feb 07, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Main: create Storage instance in glue_mapper_init()
Don't use the obsolete Mapper library to create it.
parent
5e4dd4be
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Main.cxx
src/Main.cxx
+12
-5
No files found.
src/Main.cxx
View file @
4b010df9
...
@@ -145,6 +145,16 @@ glue_mapper_init(Error &error)
...
@@ -145,6 +145,16 @@ glue_mapper_init(Error &error)
if
(
music_dir
.
IsNull
())
if
(
music_dir
.
IsNull
())
music_dir
=
GetUserMusicDir
();
music_dir
=
GetUserMusicDir
();
#ifdef ENABLE_DATABASE
if
(
!
music_dir
.
IsNull
())
{
const
auto
music_dir_utf8
=
music_dir
.
ToUTF8
();
assert
(
!
music_dir_utf8
.
empty
());
instance
->
storage
=
CreateLocalStorage
(
music_dir_utf8
.
c_str
(),
music_dir
);
}
#endif
mapper_init
(
std
::
move
(
music_dir
),
std
::
move
(
playlist_dir
));
mapper_init
(
std
::
move
(
music_dir
),
std
::
move
(
playlist_dir
));
return
true
;
return
true
;
}
}
...
@@ -166,7 +176,7 @@ glue_db_init_and_load(void)
...
@@ -166,7 +176,7 @@ glue_db_init_and_load(void)
LogWarning
(
main_domain
,
LogWarning
(
main_domain
,
"Found both 'database' and 'db_file' setting - ignoring the latter"
);
"Found both 'database' and 'db_file' setting - ignoring the latter"
);
if
(
!
mapper_has_music_directory
()
)
{
if
(
instance
->
storage
==
nullptr
)
{
if
(
param
!=
nullptr
)
if
(
param
!=
nullptr
)
LogDefault
(
main_domain
,
LogDefault
(
main_domain
,
"Found database setting without "
"Found database setting without "
...
@@ -207,8 +217,6 @@ glue_db_init_and_load(void)
...
@@ -207,8 +217,6 @@ glue_db_init_and_load(void)
return
true
;
return
true
;
SimpleDatabase
&
db
=
*
(
SimpleDatabase
*
)
instance
->
database
;
SimpleDatabase
&
db
=
*
(
SimpleDatabase
*
)
instance
->
database
;
instance
->
storage
=
CreateLocalStorage
(
mapper_get_music_directory_utf8
(),
mapper_get_music_directory_fs
());
instance
->
update
=
new
UpdateService
(
*
instance
->
event_loop
,
db
,
instance
->
update
=
new
UpdateService
(
*
instance
->
event_loop
,
db
,
*
instance
->
storage
,
*
instance
->
storage
,
*
instance
);
*
instance
);
...
@@ -524,8 +532,7 @@ int mpd_main(int argc, char *argv[])
...
@@ -524,8 +532,7 @@ int mpd_main(int argc, char *argv[])
if
(
config_get_bool
(
CONF_AUTO_UPDATE
,
false
))
{
if
(
config_get_bool
(
CONF_AUTO_UPDATE
,
false
))
{
#ifdef ENABLE_INOTIFY
#ifdef ENABLE_INOTIFY
if
(
mapper_has_music_directory
()
&&
if
(
instance
->
storage
!=
nullptr
&&
instance
->
storage
!=
nullptr
&&
instance
->
update
!=
nullptr
)
instance
->
update
!=
nullptr
)
mpd_inotify_init
(
*
instance
->
event_loop
,
mpd_inotify_init
(
*
instance
->
event_loop
,
*
instance
->
storage
,
*
instance
->
storage
,
...
...
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