CResourceTableModel: Make use of push_back

This commit is contained in:
Lioncash 2020-07-10 11:48:09 -04:00
parent a904cf97ff
commit c7fff2816e
1 changed files with 6 additions and 6 deletions

View File

@ -138,9 +138,9 @@ QMimeData* CResourceTableModel::mimeData(const QModelIndexList& rkIndexes) const
CVirtualDirectory *pDir = IndexDirectory(Index); CVirtualDirectory *pDir = IndexDirectory(Index);
if (pEntry) if (pEntry)
Resources << pEntry; Resources.push_back(pEntry);
else else
Dirs << pDir; Dirs.push_back(pDir);
} }
return new CResourceMimeData(Resources, Dirs); return new CResourceMimeData(Resources, Dirs);
@ -181,7 +181,7 @@ QModelIndex CResourceTableModel::GetIndexForDirectory(CVirtualDirectory *pDir) c
CResourceEntry* CResourceTableModel::IndexEntry(const QModelIndex& rkIndex) const CResourceEntry* CResourceTableModel::IndexEntry(const QModelIndex& rkIndex) const
{ {
int Index = rkIndex.row() - mDirectories.size(); const int Index = rkIndex.row() - mDirectories.size();
return (Index >= 0 ? mEntries[Index] : nullptr); return (Index >= 0 ? mEntries[Index] : nullptr);
} }
@ -227,7 +227,7 @@ void CResourceTableModel::FillEntryList(CVirtualDirectory *pDir, bool AssetListM
if (!pEntry->IsHidden()) if (!pEntry->IsHidden())
{ {
int Index = EntryListIndex(pEntry); const int Index = EntryListIndex(pEntry);
mEntries.insert(Index, pEntry); mEntries.insert(Index, pEntry);
} }
} }
@ -299,7 +299,7 @@ void CResourceTableModel::CheckAddResource(CResourceEntry *pEntry)
// Append to the end, let the proxy handle sorting // Append to the end, let the proxy handle sorting
const int NumRows = mDirectories.size() + mEntries.size(); const int NumRows = mDirectories.size() + mEntries.size();
beginInsertRows(QModelIndex(), NumRows, NumRows); beginInsertRows(QModelIndex(), NumRows, NumRows);
mEntries << pEntry; mEntries.push_back(pEntry);
endInsertRows(); endInsertRows();
} }
} }
@ -324,7 +324,7 @@ void CResourceTableModel::CheckAddDirectory(CVirtualDirectory *pDir)
// Just append to the end, let the proxy handle sorting // Just append to the end, let the proxy handle sorting
beginInsertRows(QModelIndex(), mDirectories.size(), mDirectories.size()); beginInsertRows(QModelIndex(), mDirectories.size(), mDirectories.size());
mDirectories << pDir; mDirectories.push_back(pDir);
endInsertRows(); endInsertRows();
} }