format: implement generic format parser and printer
This commit is contained in:
@@ -81,8 +81,8 @@ bool LocaleBasedItemSorting::operator()(const MPD::Item &a, const MPD::Item &b)
|
||||
result = m_cmp(a.playlist().path(), b.playlist().path());
|
||||
break;
|
||||
case MPD::Item::Type::Song:
|
||||
result = m_cmp(a.song().toString(Config.browser_sort_format, Config.tags_separator),
|
||||
b.song().toString(Config.browser_sort_format, Config.tags_separator));
|
||||
result = m_cmp(Format::stringify<char>(Config.browser_sort_format, &a.song()),
|
||||
Format::stringify<char>(Config.browser_sort_format, &b.song()));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -203,7 +203,7 @@ MPD::Song::GetFunction charToGetFunction(char c)
|
||||
case 'P':
|
||||
return &MPD::Song::getPriority;
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <boost/locale/encoding.hpp>
|
||||
#include <boost/locale/encoding_utf.hpp>
|
||||
#include <cassert>
|
||||
#include "utility/wide_string.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user