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:
@@ -162,7 +162,6 @@ void MediaLibrary::Update()
|
|||||||
{
|
{
|
||||||
TagList list;
|
TagList list;
|
||||||
Albums->Clear();
|
Albums->Clear();
|
||||||
Songs->Clear();
|
|
||||||
Mpd.GetList(list, Config.media_lib_primary_tag);
|
Mpd.GetList(list, Config.media_lib_primary_tag);
|
||||||
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
||||||
for (TagList::iterator it = list.begin(); it != list.end(); ++it)
|
for (TagList::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
@@ -177,8 +176,9 @@ void MediaLibrary::Update()
|
|||||||
Artists->Refresh();
|
Artists->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasTwoColumns && !Artists->Empty() && Albums->Empty() && Songs->Empty())
|
if (!hasTwoColumns && !Artists->Empty() && Albums->Empty())
|
||||||
{
|
{
|
||||||
|
Songs->Clear();
|
||||||
Albums->Reset();
|
Albums->Reset();
|
||||||
TagList list;
|
TagList list;
|
||||||
locale_to_utf(Artists->Current());
|
locale_to_utf(Artists->Current());
|
||||||
@@ -226,8 +226,9 @@ void MediaLibrary::Update()
|
|||||||
Albums->Sort<CaseInsensitiveSorting>((*Albums)[0].first == "<no album>");
|
Albums->Sort<CaseInsensitiveSorting>((*Albums)[0].first == "<no album>");
|
||||||
Albums->Refresh();
|
Albums->Refresh();
|
||||||
}
|
}
|
||||||
else if (hasTwoColumns && Albums->Empty() && Songs->Empty())
|
else if (hasTwoColumns && Albums->Empty())
|
||||||
{
|
{
|
||||||
|
Songs->Clear();
|
||||||
TagList artists;
|
TagList artists;
|
||||||
*Albums << XY(0, 0) << "Fetching albums...";
|
*Albums << XY(0, 0) << "Fetching albums...";
|
||||||
Albums->Window::Refresh();
|
Albums->Window::Refresh();
|
||||||
@@ -280,7 +281,6 @@ void MediaLibrary::Update()
|
|||||||
Songs->Reset();
|
Songs->Reset();
|
||||||
SongList list;
|
SongList list;
|
||||||
|
|
||||||
Songs->Clear();
|
|
||||||
Mpd.StartSearch(1);
|
Mpd.StartSearch(1);
|
||||||
Mpd.AddSearch(Config.media_lib_primary_tag, hasTwoColumns ? Albums->Current().second.Artist : locale_to_utf_cpy(Artists->Current()));
|
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
|
if (Albums->Empty()) // left for compatibility with <mpd-0.14
|
||||||
|
|||||||
@@ -438,7 +438,6 @@ int main(int argc, char *argv[])
|
|||||||
if (myScreen->ActiveWindow() == myLibrary->Artists)
|
if (myScreen->ActiveWindow() == myLibrary->Artists)
|
||||||
{
|
{
|
||||||
myLibrary->Albums->Clear();
|
myLibrary->Albums->Clear();
|
||||||
myLibrary->Songs->Clear();
|
|
||||||
}
|
}
|
||||||
else if (myScreen->ActiveWindow() == myLibrary->Albums)
|
else if (myScreen->ActiveWindow() == myLibrary->Albums)
|
||||||
{
|
{
|
||||||
@@ -452,7 +451,6 @@ int main(int argc, char *argv[])
|
|||||||
else if (myScreen->ActiveWindow() == myTagEditor->LeftColumn)
|
else if (myScreen->ActiveWindow() == myTagEditor->LeftColumn)
|
||||||
{
|
{
|
||||||
myTagEditor->Tags->Clear();
|
myTagEditor->Tags->Clear();
|
||||||
myTagEditor->TagTypes->Refresh();
|
|
||||||
}
|
}
|
||||||
# endif // HAVE_TAGLIB_H
|
# endif // HAVE_TAGLIB_H
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -292,10 +292,7 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
|
|||||||
if (myLibrary->Main())
|
if (myLibrary->Main())
|
||||||
{
|
{
|
||||||
if (myLibrary->Columns() == 2)
|
if (myLibrary->Columns() == 2)
|
||||||
{
|
|
||||||
myLibrary->Albums->Clear();
|
myLibrary->Albums->Clear();
|
||||||
myLibrary->Songs->Clear();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
myLibrary->Artists->Clear();
|
myLibrary->Artists->Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user