mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-03 19:07:39 +01:00
Add default to switch
This commit is contained in:
parent
7b43a94055
commit
05358cdfe4
@ -515,6 +515,9 @@ void CollectionFilterWidget::keyReleaseEvent(QKeyEvent *e) {
|
||||
ui_->search_field->clear();
|
||||
e->accept();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QWidget::keyReleaseEvent(e);
|
||||
|
@ -363,6 +363,8 @@ void CollectionView::keyPressEvent(QKeyEvent *e) {
|
||||
}
|
||||
e->accept();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
AutoExpandingTreeView::keyPressEvent(e);
|
||||
@ -619,21 +621,17 @@ void CollectionView::SearchForThis() {
|
||||
search = QStringLiteral("artist:%1").arg(item->metadata.artist());
|
||||
break;
|
||||
case CollectionModel::GroupBy::Album:
|
||||
search = QStringLiteral("album:%1").arg(item->metadata.album());
|
||||
break;
|
||||
case CollectionModel::GroupBy::AlbumDisc:
|
||||
search = QStringLiteral("album:%1").arg(item->metadata.album());
|
||||
break;
|
||||
case CollectionModel::GroupBy::YearAlbum:
|
||||
case CollectionModel::GroupBy::YearAlbumDisc:{
|
||||
case CollectionModel::GroupBy::YearAlbumDisc:
|
||||
search = QStringLiteral("year:%1 album:%2").arg(item->metadata.year()).arg(item->metadata.album());
|
||||
break;
|
||||
}
|
||||
case CollectionModel::GroupBy::OriginalYearAlbum:
|
||||
case CollectionModel::GroupBy::OriginalYearAlbumDisc:{
|
||||
case CollectionModel::GroupBy::OriginalYearAlbumDisc:
|
||||
search = QStringLiteral("year:%1 album:%2").arg(item->metadata.effective_originalyear()).arg(item->metadata.album());
|
||||
break;
|
||||
}
|
||||
case CollectionModel::GroupBy::Year:
|
||||
search = QStringLiteral("year:%1").arg(item->metadata.year());
|
||||
break;
|
||||
|
@ -342,6 +342,8 @@ QVariant Playlist::data(const QModelIndex &idx, int role) const {
|
||||
|
||||
case Column_HasCUE: return song.has_cue();
|
||||
|
||||
default: break;
|
||||
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
@ -203,6 +203,9 @@ void PlaylistListContainer::RecursivelySetIcons(QStandardItem *parent) const {
|
||||
case PlaylistListModel::Type_Playlist:
|
||||
child->setIcon(model_->playlist_icon());
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,6 +426,9 @@ void PlaylistListContainer::Delete() {
|
||||
RecursivelyFindPlaylists(idx, &ids);
|
||||
folders_to_delete << idx;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -461,6 +467,8 @@ void PlaylistListContainer::RecursivelyFindPlaylists(const QModelIndex &parent,
|
||||
RecursivelyFindPlaylists(parent.model()->index(i, 0, parent), ids);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -117,6 +117,9 @@ void PlaylistListModel::AddRowItem(QStandardItem *item, const QString &parent_pa
|
||||
AddRowItem(child_item, parent_path);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@ -139,6 +142,9 @@ void PlaylistListModel::RowsAboutToBeRemoved(const QModelIndex &parent, const in
|
||||
|
||||
case Type_Folder:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,6 +234,9 @@ bool PlaylistListModel::setData(const QModelIndex &idx, const QVariant &value, i
|
||||
// Walk all the children and modify their paths.
|
||||
UpdatePathsRecursive(idx);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -157,12 +157,12 @@ void AutoExpandingTreeView::keyPressEvent(QKeyEvent *e) {
|
||||
|
||||
switch (e->key()) {
|
||||
case Qt::Key_Backspace:
|
||||
case Qt::Key_Escape:
|
||||
case Qt::Key_Escape:{
|
||||
emit FocusOnFilterSignal(e);
|
||||
e->accept();
|
||||
break;
|
||||
|
||||
case Qt::Key_Left:
|
||||
}
|
||||
case Qt::Key_Left:{
|
||||
// Set focus on the root of the current branch
|
||||
const QModelIndex idx = currentIndex();
|
||||
if (idx.isValid() && idx.parent() != rootIndex() && (!isExpanded(idx) || model()->rowCount(idx) == 0)) {
|
||||
@ -172,6 +172,9 @@ void AutoExpandingTreeView::keyPressEvent(QKeyEvent *e) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QTreeView::keyPressEvent(e);
|
||||
|
||||
|
@ -300,6 +300,8 @@ void FileView::keyPressEvent(QKeyEvent *e) {
|
||||
case Qt::Key_Return:
|
||||
ItemDoubleClick(ui_->list->currentIndex());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QWidget::keyPressEvent(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user