mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 07:57:22 -06:00
Suppress C4267 conversion warnings (#13307)
- warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data Caused by mismatch between size_type of std and Qt containers. It is safe to cast to int as all of those containers hold low number of objects.
This commit is contained in:
@@ -79,7 +79,7 @@ BaseLogModel::BaseLogModel(QObject *parent)
|
||||
|
||||
int BaseLogModel::rowCount(const QModelIndex &) const
|
||||
{
|
||||
return m_messages.size();
|
||||
return static_cast<int>(m_messages.size());
|
||||
}
|
||||
|
||||
int BaseLogModel::columnCount(const QModelIndex &) const
|
||||
@@ -120,7 +120,7 @@ void BaseLogModel::addNewMessage(const BaseLogModel::Message &message)
|
||||
// but because of calling of beginInsertRows function we'll have ghost rows.
|
||||
if (m_messages.size() == MAX_VISIBLE_MESSAGES)
|
||||
{
|
||||
const int lastMessage = m_messages.size() - 1;
|
||||
const int lastMessage = static_cast<int>(m_messages.size()) - 1;
|
||||
beginRemoveRows(QModelIndex(), lastMessage, lastMessage);
|
||||
m_messages.pop_back();
|
||||
endRemoveRows();
|
||||
|
||||
@@ -317,7 +317,7 @@ TagModelItem *TagFilterModel::findItem(const QString &tag)
|
||||
QVector<TagModelItem *> TagFilterModel::findItems(const TagSet &tags)
|
||||
{
|
||||
QVector<TagModelItem *> items;
|
||||
items.reserve(tags.size());
|
||||
items.reserve(tags.count());
|
||||
for (const QString &tag : tags)
|
||||
{
|
||||
TagModelItem *item = findItem(tag);
|
||||
|
||||
Reference in New Issue
Block a user