DatabasePlugin: make Visit() const

This commit is contained in:
Max Kellermann 2012-08-02 18:20:43 +02:00
parent 8e331cfc65
commit af1c497759
3 changed files with 6 additions and 6 deletions

View File

@ -59,7 +59,7 @@ public:
* directory (UTF-8) * directory (UTF-8)
*/ */
virtual struct song *GetSong(const char *uri_utf8, virtual struct song *GetSong(const char *uri_utf8,
GError **error_r) = 0; GError **error_r) const = 0;
/** /**
* Visit the selected entities. * Visit the selected entities.
@ -68,7 +68,7 @@ public:
VisitDirectory visit_directory, VisitDirectory visit_directory,
VisitSong visit_song, VisitSong visit_song,
VisitPlaylist visit_playlist, VisitPlaylist visit_playlist,
GError **error_r) = 0; GError **error_r) const = 0;
}; };
struct DatabasePlugin { struct DatabasePlugin {

View File

@ -208,7 +208,7 @@ SimpleDatabase::Close()
} }
struct song * struct song *
SimpleDatabase::GetSong(const char *uri, GError **error_r) SimpleDatabase::GetSong(const char *uri, GError **error_r) const
{ {
assert(root != NULL); assert(root != NULL);
@ -241,7 +241,7 @@ SimpleDatabase::Visit(const struct db_selection *selection,
VisitDirectory visit_directory, VisitDirectory visit_directory,
VisitSong visit_song, VisitSong visit_song,
VisitPlaylist visit_playlist, VisitPlaylist visit_playlist,
GError **error_r) GError **error_r) const
{ {
const struct directory *directory = LookupDirectory(selection->uri); const struct directory *directory = LookupDirectory(selection->uri);
if (directory == NULL) { if (directory == NULL) {

View File

@ -59,12 +59,12 @@ public:
virtual bool Open(GError **error_r) override; virtual bool Open(GError **error_r) override;
virtual void Close() override; virtual void Close() override;
virtual struct song *GetSong(const char *uri_utf8, virtual struct song *GetSong(const char *uri_utf8,
GError **error_r) override; GError **error_r) const override;
virtual bool Visit(const struct db_selection *selection, virtual bool Visit(const struct db_selection *selection,
VisitDirectory visit_directory, VisitDirectory visit_directory,
VisitSong visit_song, VisitSong visit_song,
VisitPlaylist visit_playlist, VisitPlaylist visit_playlist,
GError **error_r) override; GError **error_r) const override;
protected: protected:
bool Configure(const struct config_param *param, GError **error_r); bool Configure(const struct config_param *param, GError **error_r);