make 'go to containing dir' function work on all screens

This commit is contained in:
unK
2008-09-03 05:20:22 +02:00
parent 3bdac53feb
commit 0658eb1c7c
2 changed files with 42 additions and 7 deletions

View File

@@ -57,7 +57,12 @@ Song::Song(mpd_Song *s) : itsHash(0),
s->comment ? itsComment = s->comment : itsComment = "";
int i = itsFile.find_last_of("/");
if (i != string::npos)
if (itsFile.substr(0, 7) == "http://")
{
itsShortName = itsFile;
}
else if (i != string::npos)
{
itsDirectory = itsFile.substr(0, i);
itsShortName = itsFile.substr(i+1);
@@ -81,6 +86,9 @@ string Song::GetLength() const
{
std::stringstream ss;
if (!GetTotalLength())
return "unknown";
ss << itsMinutesLength << ":";
if (!itsSecondsLength)
{