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
400ff1c8
Commit
400ff1c8
authored
Jan 07, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DatabaseQueue: pass DatabaseSelection to Add...()
parent
d360f17a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
15 deletions
+10
-15
DatabaseCommands.cxx
src/DatabaseCommands.cxx
+2
-2
DatabaseQueue.cxx
src/DatabaseQueue.cxx
+2
-5
DatabaseQueue.hxx
src/DatabaseQueue.hxx
+3
-6
QueueCommands.cxx
src/QueueCommands.cxx
+3
-2
No files found.
src/DatabaseCommands.cxx
View file @
400ff1c8
...
...
@@ -91,9 +91,9 @@ handle_match_add(Client *client, int argc, char *argv[], bool fold_case)
return
COMMAND_RETURN_ERROR
;
}
const
DatabaseSelection
selection
(
""
,
true
,
&
filter
);
GError
*
error
=
NULL
;
return
AddFromDatabase
(
client
->
partition
,
""
,
&
filter
,
&
error
)
return
AddFromDatabase
(
client
->
partition
,
selection
,
&
error
)
?
COMMAND_RETURN_OK
:
print_error
(
client
,
error
);
}
...
...
src/DatabaseQueue.cxx
View file @
400ff1c8
...
...
@@ -42,16 +42,13 @@ AddToQueue(Partition &partition, song &song, GError **error_r)
}
bool
AddFromDatabase
(
Partition
&
partition
,
const
char
*
uri
,
const
SongFilter
*
filter
,
GError
**
error_r
)
AddFromDatabase
(
Partition
&
partition
,
const
DatabaseSelection
&
selection
,
GError
**
error_r
)
{
const
Database
*
db
=
GetDatabase
(
error_r
);
if
(
db
==
nullptr
)
return
false
;
const
DatabaseSelection
selection
(
uri
,
true
,
filter
);
using
namespace
std
::
placeholders
;
const
auto
f
=
std
::
bind
(
AddToQueue
,
std
::
ref
(
partition
),
_1
,
_2
);
return
db
->
Visit
(
selection
,
f
,
error_r
);
...
...
src/DatabaseQueue.hxx
View file @
400ff1c8
...
...
@@ -20,16 +20,13 @@
#ifndef MPD_DATABASE_QUEUE_HXX
#define MPD_DATABASE_QUEUE_HXX
#include "gcc.h"
#include "gerror.h"
class
SongFilter
;
struct
Partition
;
struct
DatabaseSelection
;
gcc_nonnull
(
2
)
bool
AddFromDatabase
(
Partition
&
partition
,
const
char
*
name
,
const
SongFilter
*
filter
,
GError
**
error_r
);
AddFromDatabase
(
Partition
&
partition
,
const
DatabaseSelection
&
selection
,
GError
**
error_r
);
#endif
src/QueueCommands.cxx
View file @
400ff1c8
...
...
@@ -22,6 +22,7 @@
#include "CommandError.hxx"
#include "DatabaseQueue.hxx"
#include "SongFilter.hxx"
#include "DatabaseSelection.hxx"
#include "Playlist.hxx"
#include "PlaylistPrint.hxx"
#include "ClientFile.hxx"
...
...
@@ -69,9 +70,9 @@ handle_add(Client *client, G_GNUC_UNUSED int argc, char *argv[])
return
print_playlist_result
(
client
,
result
);
}
const
DatabaseSelection
selection
(
uri
,
true
);
GError
*
error
=
NULL
;
return
AddFromDatabase
(
client
->
partition
,
uri
,
nullptr
,
&
error
)
return
AddFromDatabase
(
client
->
partition
,
selection
,
&
error
)
?
COMMAND_RETURN_OK
:
print_error
(
client
,
error
);
}
...
...
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