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