1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-07 00:15:34 +00:00

Move it from the buildContentModel stack frame to the ContentModel instance. The ContentModel constructor would need to take an rvalue reference (QIcon&&).

This commit is contained in:
Bret Curtis 2020-11-01 23:24:24 +01:00
parent af12390fa8
commit f0e2b7c06b
3 changed files with 4 additions and 4 deletions

View file

@ -10,9 +10,9 @@
#include <components/esm/esmreader.hpp>
#include <utility>
ContentSelectorModel::ContentModel::ContentModel(QObject *parent, QIcon warningIcon) :
ContentSelectorModel::ContentModel::ContentModel(QObject *parent, QIcon&& warningIcon) :
QAbstractTableModel(parent),
mWarningIcon(std::move(warningIcon)),
mWarningIcon(warningIcon),
mMimeType ("application/omwcontent"),
mMimeTypes (QStringList() << mMimeType),
mColumnCount (1),

View file

@ -23,7 +23,7 @@ namespace ContentSelectorModel
{
Q_OBJECT
public:
explicit ContentModel(QObject *parent, QIcon warningIcon);
explicit ContentModel(QObject *parent, QIcon&& warningIcon);
~ContentModel() override;
void setEncoding(const QString &encoding);

View file

@ -24,7 +24,7 @@ ContentSelectorView::ContentSelector::ContentSelector(QWidget *parent) :
void ContentSelectorView::ContentSelector::buildContentModel()
{
QIcon warningIcon(ui.addonView->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(16, 15)));
mContentModel = new ContentSelectorModel::ContentModel(this, warningIcon);
mContentModel = new ContentSelectorModel::ContentModel(this, std::move(warningIcon));
}
void ContentSelectorView::ContentSelector::buildGameFileView()