fix searching in browser

it was taking whole path, take only top dir.
This commit is contained in:
Andrzej Rybczak
2009-02-16 19:52:11 +01:00
parent 0415fa37fe
commit 2a6e0fd7e8
5 changed files with 15 additions and 13 deletions

View File

@@ -459,8 +459,7 @@ void Display::Items(const MPD::Item &item, void *, Menu<MPD::Item> *menu)
*menu << "[..]";
return;
}
size_t slash = item.name.rfind("/");
*menu << "[" << (slash != string::npos ? item.name.substr(slash+1) : item.name) << "]";
*menu << "[" << ExtractTopDirectory(item.name) << "]";
return;
}
case MPD::itSong: