Ooops, perhaps the code to stop devices from auto-expanding would work better in the DeviceView class.

This commit is contained in:
David Sansome 2010-09-18 14:29:43 +00:00
parent ae1fa10d44
commit 8c0b17c000
4 changed files with 8 additions and 8 deletions

View File

@ -407,3 +407,8 @@ void DeviceView::DeleteFinished(const SongList& songs_with_errors) {
dialog->Show(OrganiseErrorDialog::Type_Delete, songs_with_errors);
// It deletes itself when the user closes it
}
bool DeviceView::CanRecursivelyExpand(const QModelIndex& index) const {
// Never expand devices
return index.parent().isValid();
}

View File

@ -77,6 +77,9 @@ private slots:
void DeleteFinished(const SongList& songs_with_errors);
// AutoExpandingTreeView
bool CanRecursivelyExpand(const QModelIndex& index) const;
private:
QModelIndex MapToDevice(const QModelIndex& merged_model_index) const;
QModelIndex MapToLibrary(const QModelIndex& merged_model_index) const;

View File

@ -354,8 +354,3 @@ void LibraryView::FilterReturnPressed() {
emit doubleClicked(currentIndex());
}
bool LibraryView::CanRecursivelyExpand(const QModelIndex& index) const {
// Never expand devices
return index.parent().isValid();
}

View File

@ -72,9 +72,6 @@ class LibraryView : public AutoExpandingTreeView {
void contextMenuEvent(QContextMenuEvent* e);
void keyReleaseEvent(QKeyEvent* e);
// AutoExpandingTreeView
bool CanRecursivelyExpand(const QModelIndex& index) const;
private slots:
void Load();
void AddToPlaylist();