mpd: use lambda closures instead of passing vectors to functions

This commit is contained in:
Andrzej Rybczak
2012-08-28 06:01:56 +02:00
parent 4a0026052f
commit a20a195225
14 changed files with 178 additions and 164 deletions

View File

@@ -35,8 +35,12 @@ void ServerInfo::Init()
SetDimensions();
w = new Scrollpad((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "MPD server info", Config.main_color, Config.window_border);
Mpd.GetURLHandlers(itsURLHandlers);
Mpd.GetTagTypes(itsTagTypes);
Mpd.GetURLHandlers([this](std::string &&handler) {
itsURLHandlers.push_back(handler);
});
Mpd.GetTagTypes([this](std::string &&tag_type) {
itsTagTypes.push_back(tag_type);
});
isInitialized = 1;
}