CResourceMimeData: Make use of std::move

This commit is contained in:
Lioncash 2020-07-10 11:53:29 -04:00
parent c7fff2816e
commit d8c865e438
2 changed files with 11 additions and 12 deletions

View File

@ -12,22 +12,21 @@ class CResourceMimeData : public QMimeData
QList<CVirtualDirectory*> mDirectories;
public:
CResourceMimeData(const QList<CResourceEntry*>& rkEntries, const QList<CVirtualDirectory*>& rkDirectories)
: QMimeData()
, mEntries(rkEntries)
, mDirectories(rkDirectories)
{}
CResourceMimeData(CResourceEntry *pEntry)
CResourceMimeData(QList<CResourceEntry*> entries, QList<CVirtualDirectory*> directories)
: QMimeData()
, mEntries(std::move(entries))
, mDirectories(std::move(directories))
{
mEntries << pEntry;
}
CResourceMimeData(CVirtualDirectory *pDir)
: QMimeData()
explicit CResourceMimeData(CResourceEntry *pEntry)
: QMimeData(), mEntries{pEntry}
{
}
explicit CResourceMimeData(CVirtualDirectory *pDir)
: QMimeData(), mDirectories{pDir}
{
mDirectories << pDir;
}
const QList<CResourceEntry*>& Resources() const { return mEntries; }

View File

@ -143,7 +143,7 @@ QMimeData* CResourceTableModel::mimeData(const QModelIndexList& rkIndexes) const
Dirs.push_back(pDir);
}
return new CResourceMimeData(Resources, Dirs);
return new CResourceMimeData(std::move(Resources), std::move(Dirs));
}
Qt::DropActions CResourceTableModel::supportedDragActions() const