Fix narrowing conversions
This commit is contained in:
@@ -295,7 +295,7 @@ CollectionItem *CollectionModel::CreateCompilationArtistNode(const bool signal,
|
||||
|
||||
Q_ASSERT(parent->compilation_artist_node_ == nullptr);
|
||||
|
||||
if (signal) beginInsertRows(ItemToIndex(parent), parent->children.count(), parent->children.count());
|
||||
if (signal) beginInsertRows(ItemToIndex(parent), static_cast<int>(parent->children.count()), static_cast<int>(parent->children.count()));
|
||||
|
||||
parent->compilation_artist_node_ = new CollectionItem(CollectionItem::Type_Container, parent);
|
||||
parent->compilation_artist_node_->compilation_artist_node_ = nullptr;
|
||||
@@ -1179,7 +1179,7 @@ CollectionItem *CollectionModel::InitItem(const GroupBy type, const bool signal,
|
||||
|
||||
CollectionItem::Type item_type = type == GroupBy_None ? CollectionItem::Type_Song : CollectionItem::Type_Container;
|
||||
|
||||
if (signal) beginInsertRows(ItemToIndex(parent), parent->children.count(), parent->children.count());
|
||||
if (signal) beginInsertRows(ItemToIndex(parent), static_cast<int>(parent->children.count()), static_cast<int>(parent->children.count()));
|
||||
|
||||
// Initialize the item depending on what type it's meant to be
|
||||
CollectionItem *item = new CollectionItem(item_type, parent);
|
||||
@@ -1600,7 +1600,7 @@ void CollectionModel::FinishItem(const GroupBy type, const bool signal, const bo
|
||||
|
||||
if (!divider_key.isEmpty() && !divider_nodes_.contains(divider_key)) {
|
||||
if (signal) {
|
||||
beginInsertRows(ItemToIndex(parent), parent->children.count(), parent->children.count());
|
||||
beginInsertRows(ItemToIndex(parent), static_cast<int>(parent->children.count()), static_cast<int>(parent->children.count()));
|
||||
}
|
||||
|
||||
CollectionItem *divider = new CollectionItem(CollectionItem::Type_Divider, root_);
|
||||
@@ -1679,7 +1679,7 @@ QString CollectionModel::SortTextForArtist(QString artist) {
|
||||
|
||||
for (const auto &i : Song::kArticles) {
|
||||
if (artist.startsWith(i)) {
|
||||
int ilen = i.length();
|
||||
qint64 ilen = i.length();
|
||||
artist = artist.right(artist.length() - ilen) + ", " + i.left(ilen - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user