split majority of helpers and rewrite a few heinous functions

This commit is contained in:
Andrzej Rybczak
2012-08-29 11:46:17 +02:00
parent 4cb0e2232a
commit b1c301dc1c
31 changed files with 427 additions and 373 deletions

View File

@@ -32,6 +32,7 @@
#include "playlist.h"
#include "settings.h"
#include "status.h"
#include "utility/comparators.h"
#ifdef HAVE_TAGLIB_H
# include "tag_editor.h"
#endif // HAVE_TAGLIB_H
@@ -325,7 +326,7 @@ bool Browser::hasSupportedExtension(const std::string &file)
return false;
std::string ext = file.substr(last_dot+1);
ToLower(ext);
lowercase(ext);
return SupportedExtensions.find(ext) != SupportedExtensions.end();
}
@@ -594,7 +595,7 @@ std::string Browser::ItemToString(const MPD::Item &item, void *)
{
case MPD::itDirectory:
{
return "[" + ExtractTopName(item.name) + "]";
return "[" + getBasename(item.name) + "]";
}
case MPD::itSong:
{
@@ -605,7 +606,7 @@ std::string Browser::ItemToString(const MPD::Item &item, void *)
}
case MPD::itPlaylist:
{
return Config.browser_playlist_prefix.Str() + ExtractTopName(item.name);
return Config.browser_playlist_prefix.Str() + getBasename(item.name);
}
default:
{