1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 19:45:31 +01:00

fixed indentation / coding style

This commit is contained in:
Alexander Bikadorov 2014-02-11 13:18:08 +01:00
parent c7ac2012b4
commit 3adaf5d598

View File

@ -576,10 +576,9 @@ void PlaylistView::keyPressEvent(QKeyEvent* event) {
} else if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { } else if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
if (currentIndex().isValid()) emit PlayItem(currentIndex()); if (currentIndex().isValid()) emit PlayItem(currentIndex());
event->accept(); event->accept();
} else if (event->modifiers() != } else if (event->modifiers() != Qt::ControlModifier // Ctrl+Space selects
Qt::ControlModifier // Ctrl+Space selects the item // the item
&& && event->key() == Qt::Key_Space) {
event->key() == Qt::Key_Space) {
emit PlayPause(); emit PlayPause();
event->accept(); event->accept();
} else if (event->key() == Qt::Key_Left) { } else if (event->key() == Qt::Key_Left) {
@ -623,8 +622,7 @@ void PlaylistView::RemoveSelected() {
qSort(selection.begin(), selection.end(), CompareSelectionRanges); qSort(selection.begin(), selection.end(), CompareSelectionRanges);
for (const QItemSelectionRange& range : selection) { for (const QItemSelectionRange& range : selection) {
if (range.top() < last_row) if (range.top() < last_row) rows_removed += range.height();
rows_removed += range.height();
model()->removeRows(range.top(), range.height(), range.parent()); model()->removeRows(range.top(), range.height(), range.parent());
} }
@ -640,15 +638,15 @@ void PlaylistView::RemoveSelected() {
if (new_row != 0) if (new_row != 0)
keyPressEvent( keyPressEvent(
new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier)); new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier));
// Update visual selection with the entire row // Update visual selection with the entire row
selectionModel()->select(new_index, QItemSelectionModel::ClearAndSelect | selectionModel()->select(new_index, QItemSelectionModel::ClearAndSelect |
QItemSelectionModel::Rows); QItemSelectionModel::Rows);
} else { } else {
// We're removing the last item, select the new last row // We're removing the last item, select the new last row
selectionModel()->select(model()->index(model()->rowCount()-1, 0), selectionModel()->select(
QItemSelectionModel::ClearAndSelect | model()->index(model()->rowCount() - 1, 0),
QItemSelectionModel::Rows); QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
} }
} }
QList<int> PlaylistView::GetEditableColumns() { QList<int> PlaylistView::GetEditableColumns() {