Formatting

This commit is contained in:
Jonas Kvinge
2021-08-23 21:21:08 +02:00
parent ed7794f396
commit ea2bfbda44
111 changed files with 833 additions and 425 deletions

View File

@@ -75,16 +75,23 @@ RemoveItems::RemoveItems(Playlist *playlist, int pos, int count) : Base(playlist
}
void RemoveItems::redo() {
for (int i = 0; i < ranges_.count(); ++i)
for (int i = 0; i < ranges_.count(); ++i) {
ranges_[i].items_ = playlist_->RemoveItemsWithoutUndo(ranges_[i].pos_, ranges_[i].count_);
}
}
void RemoveItems::undo() {
for (int i = static_cast<int>(ranges_.count() - 1); i >= 0; --i)
for (int i = static_cast<int>(ranges_.count() - 1); i >= 0; --i) {
playlist_->InsertItemsWithoutUndo(ranges_[i].items_, ranges_[i].pos_);
}
}
bool RemoveItems::mergeWith(const QUndoCommand *other) {
const RemoveItems *remove_command = static_cast<const RemoveItems*>(other);
ranges_.append(remove_command->ranges_);
@@ -93,6 +100,7 @@ bool RemoveItems::mergeWith(const QUndoCommand *other) {
setText(tr("remove %n songs", "", sum));
return true;
}