fix compilation with gcc-4.5
This commit is contained in:
@@ -108,7 +108,7 @@ Action *parseActionLine(const std::string &line, F error)
|
|||||||
std::string arg = getEnclosedString(line, '"', '"', 0);
|
std::string arg = getEnclosedString(line, '"', '"', 0);
|
||||||
Key k = stringToSpecialKey(arg);
|
Key k = stringToSpecialKey(arg);
|
||||||
if (k != Key::noOp)
|
if (k != Key::noOp)
|
||||||
result = new PushCharacters(&Global::wFooter, { k.getChar() });
|
result = new PushCharacters(&Global::wFooter, std::vector<int>{ k.getChar() });
|
||||||
else
|
else
|
||||||
error() << "invalid character passed to push_character: '" << arg << "'\n";
|
error() << "invalid character passed to push_character: '" << arg << "'\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,16 +75,12 @@ void DisplayPrimaryTags(NC::Menu<std::string> &menu);
|
|||||||
bool SortSongsByTrack(const MPD::Song &a, const MPD::Song &b);
|
bool SortSongsByTrack(const MPD::Song &a, const MPD::Song &b);
|
||||||
|
|
||||||
struct SortAllTracks {
|
struct SortAllTracks {
|
||||||
const std::array<MPD::Song::GetFunction, 3> m_gets;
|
static const std::array<MPD::Song::GetFunction, 3> GetFuns;
|
||||||
LocaleStringComparison m_cmp;
|
LocaleStringComparison m_cmp;
|
||||||
public:
|
public:
|
||||||
SortAllTracks() : m_gets({{
|
SortAllTracks() : m_cmp(std::locale(), Config.ignore_leading_the) { }
|
||||||
&MPD::Song::getDate,
|
|
||||||
&MPD::Song::getAlbum,
|
|
||||||
&MPD::Song::getDisc
|
|
||||||
}}), m_cmp(std::locale(), Config.ignore_leading_the) { }
|
|
||||||
bool operator()(const MPD::Song &a, const MPD::Song &b) {
|
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),
|
int ret = m_cmp(a.getTags(*get, Config.tags_separator),
|
||||||
b.getTags(*get, Config.tags_separator));
|
b.getTags(*get, Config.tags_separator));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@@ -93,6 +89,11 @@ public:
|
|||||||
return a.getTrack() < b.getTrack();
|
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 {
|
class SortSearchConstraints {
|
||||||
LocaleStringComparison m_cmp;
|
LocaleStringComparison m_cmp;
|
||||||
@@ -408,7 +409,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
|
|||||||
{
|
{
|
||||||
auto tryNextColumn = [this]() -> bool {
|
auto tryNextColumn = [this]() -> bool {
|
||||||
bool result = true;
|
bool result = true;
|
||||||
if (isActiveWindow(Songs))
|
if (this->isActiveWindow(Songs))
|
||||||
{
|
{
|
||||||
if (nextColumnAvailable())
|
if (nextColumnAvailable())
|
||||||
nextColumn();
|
nextColumn();
|
||||||
@@ -419,7 +420,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
|
|||||||
};
|
};
|
||||||
auto tryPreviousColumn = [this]() -> bool {
|
auto tryPreviousColumn = [this]() -> bool {
|
||||||
bool result = true;
|
bool result = true;
|
||||||
if (isActiveWindow(Tags))
|
if (this->isActiveWindow(Tags))
|
||||||
{
|
{
|
||||||
if (previousColumnAvailable())
|
if (previousColumnAvailable())
|
||||||
previousColumn();
|
previousColumn();
|
||||||
|
|||||||
@@ -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)
|
for (auto s = m_selected_items.begin(); s != m_selected_items.end(); ++s)
|
||||||
Mpd.AddToPlaylist(playlist, *s);
|
Mpd.AddToPlaylist(playlist, *s);
|
||||||
if (Mpd.CommitCommandsList())
|
if (Mpd.CommitCommandsList())
|
||||||
|
{
|
||||||
Statusbar::msg("Selected item(s) added to playlist \"%s\"", playlist.c_str());
|
Statusbar::msg("Selected item(s) added to playlist \"%s\"", playlist.c_str());
|
||||||
|
m_old_screen->switchTo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectedItemsAdder::addAtTheEndOfPlaylist() const
|
void SelectedItemsAdder::addAtTheEndOfPlaylist() const
|
||||||
|
|||||||
Reference in New Issue
Block a user