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
4c995eb4
Commit
4c995eb4
authored
Feb 05, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/UpdateWalk: move LocalStorage to Instance
Keep only a reference.
parent
144cfe70
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
7 deletions
+21
-7
Instance.hxx
src/Instance.hxx
+4
-0
Main.cxx
src/Main.cxx
+4
-0
Archive.cxx
src/db/update/Archive.cxx
+1
-0
Container.cxx
src/db/update/Container.cxx
+1
-0
Service.hxx
src/db/update/Service.hxx
+1
-0
UpdateGlue.cxx
src/db/update/UpdateGlue.cxx
+2
-1
Walk.cxx
src/db/update/Walk.cxx
+4
-3
Walk.hxx
src/db/update/Walk.hxx
+4
-3
No files found.
src/Instance.hxx
View file @
4c995eb4
...
@@ -31,6 +31,7 @@ class NeighborGlue;
...
@@ -31,6 +31,7 @@ class NeighborGlue;
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
#include "db/DatabaseListener.hxx"
#include "db/DatabaseListener.hxx"
class
Database
;
class
Database
;
class
LocalStorage
;
class
UpdateService
;
class
UpdateService
;
#endif
#endif
...
@@ -62,6 +63,8 @@ struct Instance final
...
@@ -62,6 +63,8 @@ struct Instance final
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
Database
*
database
;
Database
*
database
;
LocalStorage
*
storage
;
UpdateService
*
update
;
UpdateService
*
update
;
#endif
#endif
...
@@ -71,6 +74,7 @@ struct Instance final
...
@@ -71,6 +74,7 @@ struct Instance final
Instance
()
{
Instance
()
{
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
storage
=
nullptr
;
update
=
nullptr
;
update
=
nullptr
;
#endif
#endif
}
}
...
...
src/Main.cxx
View file @
4c995eb4
...
@@ -69,6 +69,7 @@
...
@@ -69,6 +69,7 @@
#include "db/DatabaseGlue.hxx"
#include "db/DatabaseGlue.hxx"
#include "db/DatabaseSimple.hxx"
#include "db/DatabaseSimple.hxx"
#include "db/plugins/SimpleDatabasePlugin.hxx"
#include "db/plugins/SimpleDatabasePlugin.hxx"
#include "storage/LocalStorage.hxx"
#endif
#endif
#ifdef ENABLE_NEIGHBOR_PLUGINS
#ifdef ENABLE_NEIGHBOR_PLUGINS
...
@@ -209,7 +210,10 @@ glue_db_init_and_load(void)
...
@@ -209,7 +210,10 @@ glue_db_init_and_load(void)
return
true
;
return
true
;
SimpleDatabase
&
db
=
*
(
SimpleDatabase
*
)
instance
->
database
;
SimpleDatabase
&
db
=
*
(
SimpleDatabase
*
)
instance
->
database
;
instance
->
storage
=
new
LocalStorage
(
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
);
*
instance
);
/* run database update after daemonization? */
/* run database update after daemonization? */
...
...
src/db/update/Archive.cxx
View file @
4c995eb4
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "db/DatabaseLock.hxx"
#include "db/DatabaseLock.hxx"
#include "db/Directory.hxx"
#include "db/Directory.hxx"
#include "db/Song.hxx"
#include "db/Song.hxx"
#include "storage/LocalStorage.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/AllocatedPath.hxx"
#include "storage/FileInfo.hxx"
#include "storage/FileInfo.hxx"
#include "archive/ArchiveList.hxx"
#include "archive/ArchiveList.hxx"
...
...
src/db/update/Container.cxx
View file @
4c995eb4
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "db/DatabaseLock.hxx"
#include "db/DatabaseLock.hxx"
#include "db/Directory.hxx"
#include "db/Directory.hxx"
#include "db/Song.hxx"
#include "db/Song.hxx"
#include "storage/LocalStorage.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderList.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/AllocatedPath.hxx"
...
...
src/db/update/Service.hxx
View file @
4c995eb4
...
@@ -61,6 +61,7 @@ class UpdateService final : DeferredMonitor {
...
@@ -61,6 +61,7 @@ class UpdateService final : DeferredMonitor {
public
:
public
:
UpdateService
(
EventLoop
&
_loop
,
SimpleDatabase
&
_db
,
UpdateService
(
EventLoop
&
_loop
,
SimpleDatabase
&
_db
,
LocalStorage
&
_storage
,
DatabaseListener
&
_listener
);
DatabaseListener
&
_listener
);
/**
/**
...
...
src/db/update/UpdateGlue.cxx
View file @
4c995eb4
...
@@ -151,10 +151,11 @@ UpdateService::RunDeferred()
...
@@ -151,10 +151,11 @@ UpdateService::RunDeferred()
}
}
UpdateService
::
UpdateService
(
EventLoop
&
_loop
,
SimpleDatabase
&
_db
,
UpdateService
::
UpdateService
(
EventLoop
&
_loop
,
SimpleDatabase
&
_db
,
LocalStorage
&
_storage
,
DatabaseListener
&
_listener
)
DatabaseListener
&
_listener
)
:
DeferredMonitor
(
_loop
),
db
(
_db
),
listener
(
_listener
),
:
DeferredMonitor
(
_loop
),
db
(
_db
),
listener
(
_listener
),
progress
(
UPDATE_PROGRESS_IDLE
),
progress
(
UPDATE_PROGRESS_IDLE
),
update_task_id
(
0
),
update_task_id
(
0
),
walk
(
_loop
,
_listener
)
walk
(
_loop
,
_listener
,
_storage
)
{
{
}
}
src/db/update/Walk.cxx
View file @
4c995eb4
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "db/Song.hxx"
#include "db/Song.hxx"
#include "db/PlaylistVector.hxx"
#include "db/PlaylistVector.hxx"
#include "db/Uri.hxx"
#include "db/Uri.hxx"
#include "storage/LocalStorage.hxx"
#include "playlist/PlaylistRegistry.hxx"
#include "playlist/PlaylistRegistry.hxx"
#include "Mapper.hxx"
#include "Mapper.hxx"
#include "ExcludeList.hxx"
#include "ExcludeList.hxx"
...
@@ -47,9 +48,9 @@
...
@@ -47,9 +48,9 @@
#include <stdlib.h>
#include <stdlib.h>
#include <errno.h>
#include <errno.h>
UpdateWalk
::
UpdateWalk
(
EventLoop
&
_loop
,
DatabaseListener
&
_listener
)
UpdateWalk
::
UpdateWalk
(
EventLoop
&
_loop
,
DatabaseListener
&
_listener
,
:
storage
(
mapper_get_music_directory_utf8
(),
LocalStorage
&
_storage
)
mapper_get_music_directory_fs
()
),
:
storage
(
_storage
),
editor
(
_loop
,
_listener
)
editor
(
_loop
,
_listener
)
{
{
#ifndef WIN32
#ifndef WIN32
...
...
src/db/update/Walk.hxx
View file @
4c995eb4
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
#include "check.h"
#include "check.h"
#include "Editor.hxx"
#include "Editor.hxx"
#include "storage/LocalStorage.hxx"
#include <sys/stat.h>
#include <sys/stat.h>
...
@@ -30,6 +29,7 @@ struct stat;
...
@@ -30,6 +29,7 @@ struct stat;
struct
FileInfo
;
struct
FileInfo
;
struct
Directory
;
struct
Directory
;
struct
archive_plugin
;
struct
archive_plugin
;
class
LocalStorage
;
class
ExcludeList
;
class
ExcludeList
;
class
UpdateWalk
final
{
class
UpdateWalk
final
{
...
@@ -48,12 +48,13 @@ class UpdateWalk final {
...
@@ -48,12 +48,13 @@ class UpdateWalk final {
bool
walk_discard
;
bool
walk_discard
;
bool
modified
;
bool
modified
;
LocalStorage
storage
;
LocalStorage
&
storage
;
DatabaseEditor
editor
;
DatabaseEditor
editor
;
public
:
public
:
UpdateWalk
(
EventLoop
&
_loop
,
DatabaseListener
&
_listener
);
UpdateWalk
(
EventLoop
&
_loop
,
DatabaseListener
&
_listener
,
LocalStorage
&
_storage
);
/**
/**
* Returns true if the database was modified.
* Returns true if the database was modified.
...
...
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