1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-14 18:35:16 +01:00

Don't lazy populate all the children of library items

This commit is contained in:
David Sansome 2010-01-15 16:36:34 +00:00
parent a49f5506ac
commit b4c7b92fac
3 changed files with 9 additions and 1 deletions

1
TODO
View File

@ -5,7 +5,6 @@
- Copy to library, move to library
- Edit tags in the playlist
- Global shortcut keys
- Make QSortFilterProxyModel on the library obey hasChildren()
- Database versioning
- Clicking play plays selected item

View File

@ -502,3 +502,11 @@ void Library::SetFilterText(const QString& text) {
query_options_.filter = text;
Reset();
}
bool Library::canFetchMore(const QModelIndex &parent) const {
if (!parent.isValid())
return false;
LibraryItem* item = IndexToItem(parent);
return !item->lazy_loaded;
}

View File

@ -39,6 +39,7 @@ class Library : public SimpleTreeModel<LibraryItem> {
Qt::ItemFlags flags(const QModelIndex& index) const;
QStringList mimeTypes() const;
QMimeData* mimeData(const QModelIndexList& indexes) const;
bool canFetchMore(const QModelIndex &parent) const;
signals:
void Error(const QString& message);