Use static_cast

This commit is contained in:
Jonas Kvinge
2021-03-21 18:53:02 +01:00
parent f91a679cdf
commit 59bffed47f
80 changed files with 241 additions and 242 deletions

View File

@@ -265,7 +265,7 @@ void Queue::Clear() {
if (source_indexes_.isEmpty()) return;
beginRemoveRows(QModelIndex(), 0, source_indexes_.count() - 1);
beginRemoveRows(QModelIndex(), 0, static_cast<int>(source_indexes_.count() - 1));
source_indexes_.clear();
endRemoveRows();
@@ -285,7 +285,7 @@ void Queue::Move(const QList<int> &proxy_rows, int pos) {
}
// Put the items back in
const int start = pos == -1 ? source_indexes_.count() : pos;
const int start = pos == -1 ? static_cast<int>(source_indexes_.count()) : pos;
for (int i = start; i < start + moved_items.count(); ++i) {
source_indexes_.insert(i, moved_items[i - start]);
}
@@ -390,8 +390,8 @@ bool Queue::dropMimeData(const QMimeData *data, Qt::DropAction action, int row,
}
if (!source_indexes.isEmpty()) {
const int insert_point = row == -1 ? source_indexes_.count() : row;
beginInsertRows(QModelIndex(), insert_point, insert_point + source_indexes.count() - 1);
const int insert_point = row == -1 ? static_cast<int>(source_indexes_.count()) : row;
beginInsertRows(QModelIndex(), insert_point, insert_point + static_cast<int>(source_indexes.count() - 1));
for (int i = 0 ; i < source_indexes.count() ; ++i) {
source_indexes_.insert(insert_point + i, source_indexes[i]);
}

View File

@@ -146,7 +146,7 @@ void QueueView::MoveDown() {
if (indexes.isEmpty() || indexes.last().row() == current_playlist_->queue()->rowCount()-1)
return;
for (int i = indexes.count() - 1; i >= 0; --i) {
for (int i = static_cast<int>(indexes.count() - 1); i >= 0; --i) {
current_playlist_->queue()->MoveDown(indexes[i].row());
}