fix compilation with gcc-4.5

This commit is contained in:
Andrzej Rybczak
2012-09-15 00:23:40 +02:00
parent c4190b6514
commit 66b799cd4c
3 changed files with 14 additions and 10 deletions

View File

@@ -108,7 +108,7 @@ Action *parseActionLine(const std::string &line, F error)
std::string arg = getEnclosedString(line, '"', '"', 0);
Key k = stringToSpecialKey(arg);
if (k != Key::noOp)
result = new PushCharacters(&Global::wFooter, { k.getChar() });
result = new PushCharacters(&Global::wFooter, std::vector<int>{ k.getChar() });
else
error() << "invalid character passed to push_character: '" << arg << "'\n";
}

View File

@@ -75,16 +75,12 @@ void DisplayPrimaryTags(NC::Menu<std::string> &menu);
bool SortSongsByTrack(const MPD::Song &a, const MPD::Song &b);
struct SortAllTracks {
const std::array<MPD::Song::GetFunction, 3> m_gets;
static const std::array<MPD::Song::GetFunction, 3> GetFuns;
LocaleStringComparison m_cmp;
public:
SortAllTracks() : m_gets({{
&MPD::Song::getDate,
&MPD::Song::getAlbum,
&MPD::Song::getDisc
}}), m_cmp(std::locale(), Config.ignore_leading_the) { }
SortAllTracks() : m_cmp(std::locale(), Config.ignore_leading_the) { }
bool operator()(const MPD::Song &a, const MPD::Song &b) {
for (auto get = m_gets.begin(); get != m_gets.end(); ++get) {
for (auto get = GetFuns.begin(); get != GetFuns.end(); ++get) {
int ret = m_cmp(a.getTags(*get, Config.tags_separator),
b.getTags(*get, Config.tags_separator));
if (ret != 0)
@@ -93,6 +89,11 @@ public:
return a.getTrack() < b.getTrack();
}
};
const std::array<MPD::Song::GetFunction, 3> SortAllTracks::GetFuns = {{
&MPD::Song::getDate,
&MPD::Song::getAlbum,
&MPD::Song::getDisc
}};
class SortSearchConstraints {
LocaleStringComparison m_cmp;
@@ -408,7 +409,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
{
auto tryNextColumn = [this]() -> bool {
bool result = true;
if (isActiveWindow(Songs))
if (this->isActiveWindow(Songs))
{
if (nextColumnAvailable())
nextColumn();
@@ -419,7 +420,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
};
auto tryPreviousColumn = [this]() -> bool {
bool result = true;
if (isActiveWindow(Tags))
if (this->isActiveWindow(Tags))
{
if (previousColumnAvailable())
previousColumn();

View File

@@ -243,7 +243,10 @@ void SelectedItemsAdder::addToExistingPlaylist(const std::string &playlist) cons
for (auto s = m_selected_items.begin(); s != m_selected_items.end(); ++s)
Mpd.AddToPlaylist(playlist, *s);
if (Mpd.CommitCommandsList())
{
Statusbar::msg("Selected item(s) added to playlist \"%s\"", playlist.c_str());
m_old_screen->switchTo();
}
}
void SelectedItemsAdder::addAtTheEndOfPlaylist() const