CResourceMimeData: Make use of std::move
This commit is contained in:
parent
c7fff2816e
commit
d8c865e438
|
@ -12,22 +12,21 @@ class CResourceMimeData : public QMimeData
|
||||||
QList<CVirtualDirectory*> mDirectories;
|
QList<CVirtualDirectory*> mDirectories;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CResourceMimeData(const QList<CResourceEntry*>& rkEntries, const QList<CVirtualDirectory*>& rkDirectories)
|
CResourceMimeData(QList<CResourceEntry*> entries, QList<CVirtualDirectory*> directories)
|
||||||
: QMimeData()
|
|
||||||
, mEntries(rkEntries)
|
|
||||||
, mDirectories(rkDirectories)
|
|
||||||
{}
|
|
||||||
|
|
||||||
CResourceMimeData(CResourceEntry *pEntry)
|
|
||||||
: QMimeData()
|
: QMimeData()
|
||||||
|
, mEntries(std::move(entries))
|
||||||
|
, mDirectories(std::move(directories))
|
||||||
{
|
{
|
||||||
mEntries << pEntry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CResourceMimeData(CVirtualDirectory *pDir)
|
explicit CResourceMimeData(CResourceEntry *pEntry)
|
||||||
: QMimeData()
|
: QMimeData(), mEntries{pEntry}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
explicit CResourceMimeData(CVirtualDirectory *pDir)
|
||||||
|
: QMimeData(), mDirectories{pDir}
|
||||||
{
|
{
|
||||||
mDirectories << pDir;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<CResourceEntry*>& Resources() const { return mEntries; }
|
const QList<CResourceEntry*>& Resources() const { return mEntries; }
|
||||||
|
|
|
@ -143,7 +143,7 @@ QMimeData* CResourceTableModel::mimeData(const QModelIndexList& rkIndexes) const
|
||||||
Dirs.push_back(pDir);
|
Dirs.push_back(pDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CResourceMimeData(Resources, Dirs);
|
return new CResourceMimeData(std::move(Resources), std::move(Dirs));
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::DropActions CResourceTableModel::supportedDragActions() const
|
Qt::DropActions CResourceTableModel::supportedDragActions() const
|
||||||
|
|
Loading…
Reference in New Issue