improve handling columns in media library a bit

given column should clear only the first column on its right, not all.
This commit is contained in:
Andrzej Rybczak
2009-11-13 16:39:43 +01:00
parent 495ec25a0a
commit 9a5a053ec3
3 changed files with 4 additions and 9 deletions

View File

@@ -162,7 +162,6 @@ void MediaLibrary::Update()
{
TagList list;
Albums->Clear();
Songs->Clear();
Mpd.GetList(list, Config.media_lib_primary_tag);
sort(list.begin(), list.end(), CaseInsensitiveSorting());
for (TagList::iterator it = list.begin(); it != list.end(); ++it)
@@ -177,8 +176,9 @@ void MediaLibrary::Update()
Artists->Refresh();
}
if (!hasTwoColumns && !Artists->Empty() && Albums->Empty() && Songs->Empty())
if (!hasTwoColumns && !Artists->Empty() && Albums->Empty())
{
Songs->Clear();
Albums->Reset();
TagList list;
locale_to_utf(Artists->Current());
@@ -226,8 +226,9 @@ void MediaLibrary::Update()
Albums->Sort<CaseInsensitiveSorting>((*Albums)[0].first == "<no album>");
Albums->Refresh();
}
else if (hasTwoColumns && Albums->Empty() && Songs->Empty())
else if (hasTwoColumns && Albums->Empty())
{
Songs->Clear();
TagList artists;
*Albums << XY(0, 0) << "Fetching albums...";
Albums->Window::Refresh();
@@ -280,7 +281,6 @@ void MediaLibrary::Update()
Songs->Reset();
SongList list;
Songs->Clear();
Mpd.StartSearch(1);
Mpd.AddSearch(Config.media_lib_primary_tag, hasTwoColumns ? Albums->Current().second.Artist : locale_to_utf_cpy(Artists->Current()));
if (Albums->Empty()) // left for compatibility with <mpd-0.14

View File

@@ -438,7 +438,6 @@ int main(int argc, char *argv[])
if (myScreen->ActiveWindow() == myLibrary->Artists)
{
myLibrary->Albums->Clear();
myLibrary->Songs->Clear();
}
else if (myScreen->ActiveWindow() == myLibrary->Albums)
{
@@ -452,7 +451,6 @@ int main(int argc, char *argv[])
else if (myScreen->ActiveWindow() == myTagEditor->LeftColumn)
{
myTagEditor->Tags->Clear();
myTagEditor->TagTypes->Refresh();
}
# endif // HAVE_TAGLIB_H
}

View File

@@ -292,10 +292,7 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
if (myLibrary->Main())
{
if (myLibrary->Columns() == 2)
{
myLibrary->Albums->Clear();
myLibrary->Songs->Clear();
}
else
myLibrary->Artists->Clear();
}