group various functions more logically

This commit is contained in:
Andrzej Rybczak
2009-02-10 15:51:55 +01:00
parent 256bb429b5
commit d82577e357
22 changed files with 896 additions and 825 deletions

View File

@@ -24,6 +24,7 @@
#include "browser.h"
#include "charset.h"
#include "display.h"
#include "helpers.h"
#include "settings.h"
#ifdef HAVE_TAGLIB_H
@@ -128,37 +129,6 @@ void UpdateItemList(Menu<Item> *menu)
menu->Refresh();
}
void DisplayItem(const Item &item, void *, Menu<Item> *menu)
{
switch (item.type)
{
case itDirectory:
{
if (item.song)
{
*menu << "[..]";
return;
}
size_t slash = item.name.rfind("/");
*menu << "[" << (slash != string::npos ? item.name.substr(slash+1) : item.name) << "]";
return;
}
case itSong:
!Config.columns_in_browser
?
DisplaySong(*item.song, &Config.song_list_format, reinterpret_cast<Menu<Song> *>(menu))
:
DisplaySongInColumns(*item.song, &Config.song_columns_list_format, reinterpret_cast<Menu<Song> *>(menu))
;
return;
case itPlaylist:
*menu << Config.browser_playlist_prefix << item.name;
return;
default:
return;
}
}
void GetDirectory(string dir, string subdir)
{
if (dir.empty())