mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-29 03:38:05 -06:00
Suppress C4267 conversion warnings
- 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:
committed by
Vladimir Golovnev (glassez)
parent
81de07789a
commit
81ad324209
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user