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
8cf4fb53
Commit
8cf4fb53
authored
Feb 01, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playlist: pass Database to DatabaseModified()
Don't use global variable.
parent
1769ae54
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
13 deletions
+9
-13
Instance.cxx
src/Instance.cxx
+2
-1
Partition.cxx
src/Partition.cxx
+2
-2
Partition.hxx
src/Partition.hxx
+1
-1
Playlist.hxx
src/Playlist.hxx
+2
-1
PlaylistUpdate.cxx
src/PlaylistUpdate.cxx
+2
-8
No files found.
src/Instance.cxx
View file @
8cf4fb53
...
...
@@ -22,6 +22,7 @@
#include "Partition.hxx"
#include "Idle.hxx"
#include "Stats.hxx"
#include "db/DatabaseGlue.hxx"
#ifdef ENABLE_DATABASE
...
...
@@ -35,7 +36,7 @@ void
Instance
::
DatabaseModified
()
{
stats_invalidate
();
partition
->
DatabaseModified
();
partition
->
DatabaseModified
(
*
GetDatabase
()
);
idle_add
(
IDLE_DATABASE
);
}
...
...
src/Partition.cxx
View file @
8cf4fb53
...
...
@@ -25,9 +25,9 @@
#ifdef ENABLE_DATABASE
void
Partition
::
DatabaseModified
()
Partition
::
DatabaseModified
(
const
Database
&
db
)
{
playlist
.
DatabaseModified
();
playlist
.
DatabaseModified
(
db
);
}
#endif
...
...
src/Partition.hxx
View file @
8cf4fb53
...
...
@@ -178,7 +178,7 @@ struct Partition {
* The database has been modified. Propagate the change to
* all subsystems.
*/
void
DatabaseModified
();
void
DatabaseModified
(
const
Database
&
db
);
#endif
/**
...
...
src/Playlist.hxx
View file @
8cf4fb53
...
...
@@ -26,6 +26,7 @@
enum
TagType
:
uint8_t
;
struct
PlayerControl
;
class
DetachedSong
;
class
Database
;
class
Error
;
struct
playlist
{
...
...
@@ -141,7 +142,7 @@ public:
/**
* The database has been modified. Pull all updates.
*/
void
DatabaseModified
();
void
DatabaseModified
(
const
Database
&
db
);
#endif
PlaylistResult
AppendSong
(
PlayerControl
&
pc
,
...
...
src/PlaylistUpdate.cxx
View file @
8cf4fb53
...
...
@@ -19,7 +19,6 @@
#include "config.h"
#include "Playlist.hxx"
#include "db/DatabaseGlue.hxx"
#include "db/DatabasePlugin.hxx"
#include "db/LightSong.hxx"
#include "DetachedSong.hxx"
...
...
@@ -56,17 +55,12 @@ UpdatePlaylistSong(const Database &db, DetachedSong &song)
}
void
playlist
::
DatabaseModified
()
playlist
::
DatabaseModified
(
const
Database
&
db
)
{
const
Database
*
db
=
GetDatabase
();
if
(
db
==
nullptr
)
/* how can this ever happen? */
return
;
bool
modified
=
false
;
for
(
unsigned
i
=
0
,
n
=
queue
.
GetLength
();
i
!=
n
;
++
i
)
{
if
(
UpdatePlaylistSong
(
*
db
,
queue
.
Get
(
i
)))
{
if
(
UpdatePlaylistSong
(
db
,
queue
.
Get
(
i
)))
{
queue
.
ModifyAtPosition
(
i
);
modified
=
true
;
}
...
...
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