mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Fix coverity issues
torrentcontentmodel: Use a variable to store filesCount optionsdlg: add fallthrough comment to suppress warning speedPlotview: initialize member misc: fix wrong type used, add spaces
This commit is contained in:
parent
cab10aa7b4
commit
4ad541d066
4 changed files with 22 additions and 9 deletions
|
@ -288,17 +288,18 @@ void TorrentContentModel::clear()
|
|||
void TorrentContentModel::setupModelData(const BitTorrent::TorrentInfo &info)
|
||||
{
|
||||
qDebug("setup model data called");
|
||||
if (info.filesCount() <= 0)
|
||||
const int filesCount = info.filesCount();
|
||||
if (filesCount <= 0)
|
||||
return;
|
||||
|
||||
emit layoutAboutToBeChanged();
|
||||
// Initialize files_index array
|
||||
qDebug("Torrent contains %d files", info.filesCount());
|
||||
m_filesIndex.reserve(info.filesCount());
|
||||
qDebug("Torrent contains %d files", filesCount);
|
||||
m_filesIndex.reserve(filesCount);
|
||||
|
||||
TorrentContentModelFolder* currentParent;
|
||||
// Iterate over files
|
||||
for (int i = 0; i < info.filesCount(); ++i) {
|
||||
for (int i = 0; i < filesCount; ++i) {
|
||||
currentParent = m_rootItem;
|
||||
QString path = Utils::Fs::fromNativePath(info.filePath(i));
|
||||
// Iterate of parts of the path to create necessary folders
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue