Move some objects instead of copying

macos_ci_fix
Andrei Kortunov 1 year ago
parent 1d207ed318
commit d3d7a663c6

@ -300,7 +300,7 @@ namespace ESSImport
ESM::CustomMarker marker; ESM::CustomMarker marker;
marker.mWorldX = notepos[0]; marker.mWorldX = notepos[0];
marker.mWorldY = notepos[1]; marker.mWorldY = notepos[1];
marker.mNote = note; marker.mNote = std::move(note);
marker.mCell = cell.mId; marker.mCell = cell.mId;
mMarkers.push_back(marker); mMarkers.push_back(marker);
} }

@ -101,7 +101,7 @@ namespace ESSImport
if (esm.isNextSub("XNAM")) if (esm.isNextSub("XNAM"))
mActorData.mSelectedEnchantItem = esm.getHString(); mActorData.mSelectedEnchantItem = esm.getHString();
else else
mActorData.mSelectedSpell = id; mActorData.mSelectedSpell = std::move(id);
if (esm.isNextSub("YNAM")) if (esm.isNextSub("YNAM"))
esm.skipHSub(); // 4 byte, 0 esm.skipHSub(); // 4 byte, 0

@ -418,7 +418,7 @@ void Launcher::SettingsPage::saveSettings()
void Launcher::SettingsPage::slotLoadedCellsChanged(QStringList cellNames) void Launcher::SettingsPage::slotLoadedCellsChanged(QStringList cellNames)
{ {
loadCellsForAutocomplete(cellNames); loadCellsForAutocomplete(std::move(cellNames));
} }
void Launcher::SettingsPage::slotAnimSourcesToggled(bool checked) void Launcher::SettingsPage::slotAnimSourcesToggled(bool checked)

@ -522,7 +522,6 @@ void MwIniImporter::importGameFiles(
multistrmap& cfg, const multistrmap& ini, const std::filesystem::path& iniFilename) const multistrmap& cfg, const multistrmap& ini, const std::filesystem::path& iniFilename) const
{ {
std::vector<std::pair<std::time_t, std::filesystem::path>> contentFiles; std::vector<std::pair<std::time_t, std::filesystem::path>> contentFiles;
std::string baseGameFile("Game Files:GameFile");
std::time_t defaultTime = 0; std::time_t defaultTime = 0;
ToUTF8::Utf8Encoder encoder(mEncoding); ToUTF8::Utf8Encoder encoder(mEncoding);
@ -538,7 +537,7 @@ void MwIniImporter::importGameFiles(
auto it = ini.begin(); auto it = ini.begin();
for (int i = 0; it != ini.end(); i++) for (int i = 0; it != ini.end(); i++)
{ {
std::string gameFile = baseGameFile; std::string gameFile("Game Files:GameFile");
gameFile.append(std::to_string(i)); gameFile.append(std::to_string(i));
it = ini.find(gameFile); it = ini.find(gameFile);

@ -9,7 +9,7 @@ namespace CSMWorld
} }
CSMFilter::NotNode::NotNode(std::shared_ptr<Node> child) CSMFilter::NotNode::NotNode(std::shared_ptr<Node> child)
: UnaryNode(child, "not") : UnaryNode(std::move(child), "not")
{ {
} }

@ -3,7 +3,7 @@
#include <apps/opencs/model/filter/node.hpp> #include <apps/opencs/model/filter/node.hpp>
CSMFilter::UnaryNode::UnaryNode(std::shared_ptr<Node> child, const std::string& name) CSMFilter::UnaryNode::UnaryNode(std::shared_ptr<Node> child, const std::string& name)
: mChild(child) : mChild(std::move(child))
, mName(name) , mName(name)
{ {
} }

@ -16,7 +16,7 @@
CSMPrefs::ColourSetting::ColourSetting( CSMPrefs::ColourSetting::ColourSetting(
Category* parent, QMutex* mutex, const std::string& key, const std::string& label, QColor default_) Category* parent, QMutex* mutex, const std::string& key, const std::string& label, QColor default_)
: Setting(parent, mutex, key, label) : Setting(parent, mutex, key, label)
, mDefault(default_) , mDefault(std::move(default_))
, mWidget(nullptr) , mWidget(nullptr)
{ {
} }

@ -12,7 +12,7 @@
#include "state.hpp" #include "state.hpp"
CSMPrefs::StringSetting::StringSetting( CSMPrefs::StringSetting::StringSetting(
Category* parent, QMutex* mutex, const std::string& key, const std::string& label, std::string default_) Category* parent, QMutex* mutex, const std::string& key, const std::string& label, std::string_view default_)
: Setting(parent, mutex, key, label) : Setting(parent, mutex, key, label)
, mDefault(default_) , mDefault(default_)
, mWidget(nullptr) , mWidget(nullptr)

@ -23,8 +23,8 @@ namespace CSMPrefs
QLineEdit* mWidget; QLineEdit* mWidget;
public: public:
StringSetting( StringSetting(Category* parent, QMutex* mutex, const std::string& key, const std::string& label,
Category* parent, QMutex* mutex, const std::string& key, const std::string& label, std::string default_); std::string_view default_);
StringSetting& setTooltip(const std::string& tooltip); StringSetting& setTooltip(const std::string& tooltip);

@ -533,7 +533,7 @@ namespace CSMWorld
auto& npc = dynamic_cast<const Record<ESM::NPC>&>(mReferenceables.getRecord(index)).get(); auto& npc = dynamic_cast<const Record<ESM::NPC>&>(mReferenceables.getRecord(index)).get();
RaceDataPtr raceData = getRaceData(npc.mRace); RaceDataPtr raceData = getRaceData(npc.mRace);
data->reset_data(id, "", false, !npc.isMale(), raceData); data->reset_data(id, "", false, !npc.isMale(), std::move(raceData));
// Add head and hair // Add head and hair
data->setPart(ESM::PRT_Head, npc.mHead, 0); data->setPart(ESM::PRT_Head, npc.mHead, 0);

@ -154,7 +154,7 @@ namespace CSVRender
SceneWidget::SceneWidget(std::shared_ptr<Resource::ResourceSystem> resourceSystem, QWidget* parent, SceneWidget::SceneWidget(std::shared_ptr<Resource::ResourceSystem> resourceSystem, QWidget* parent,
Qt::WindowFlags f, bool retrieveInput) Qt::WindowFlags f, bool retrieveInput)
: RenderWidget(parent, f) : RenderWidget(parent, f)
, mResourceSystem(resourceSystem) , mResourceSystem(std::move(resourceSystem))
, mLighting(nullptr) , mLighting(nullptr)
, mHasDefaultAmbient(false) , mHasDefaultAmbient(false)
, mIsExterior(true) , mIsExterior(true)
@ -225,7 +225,7 @@ namespace CSVRender
mResourceSystem->releaseGLObjects(mView->getCamera()->getGraphicsContext()->getState()); mResourceSystem->releaseGLObjects(mView->getCamera()->getGraphicsContext()->getState());
} }
osg::ref_ptr<osg::Geometry> SceneWidget::createGradientRectangle(QColor bgColour, QColor gradientColour) osg::ref_ptr<osg::Geometry> SceneWidget::createGradientRectangle(QColor& bgColour, QColor& gradientColour)
{ {
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry; osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
@ -266,7 +266,7 @@ namespace CSVRender
return geometry; return geometry;
} }
osg::ref_ptr<osg::Camera> SceneWidget::createGradientCamera(QColor bgColour, QColor gradientColour) osg::ref_ptr<osg::Camera> SceneWidget::createGradientCamera(QColor& bgColour, QColor& gradientColour)
{ {
osg::ref_ptr<osg::Camera> camera = new osg::Camera(); osg::ref_ptr<osg::Camera> camera = new osg::Camera();
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
@ -288,7 +288,7 @@ namespace CSVRender
return camera; return camera;
} }
void SceneWidget::updateGradientCamera(QColor bgColour, QColor gradientColour) void SceneWidget::updateGradientCamera(QColor& bgColour, QColor& gradientColour)
{ {
osg::ref_ptr<osg::Geometry> gradientRect = createGradientRectangle(bgColour, gradientColour); osg::ref_ptr<osg::Geometry> gradientRect = createGradientRectangle(bgColour, gradientColour);
// Replaces previous rectangle // Replaces previous rectangle

@ -114,9 +114,9 @@ namespace CSVRender
void mouseMoveEvent(QMouseEvent* event) override; void mouseMoveEvent(QMouseEvent* event) override;
void wheelEvent(QWheelEvent* event) override; void wheelEvent(QWheelEvent* event) override;
osg::ref_ptr<osg::Geometry> createGradientRectangle(QColor bgColour, QColor gradientColour); osg::ref_ptr<osg::Geometry> createGradientRectangle(QColor& bgColour, QColor& gradientColour);
osg::ref_ptr<osg::Camera> createGradientCamera(QColor bgColour, QColor gradientColour); osg::ref_ptr<osg::Camera> createGradientCamera(QColor& bgColour, QColor& gradientColour);
void updateGradientCamera(QColor bgColour, QColor gradientColour); void updateGradientCamera(QColor& bgColour, QColor& gradientColour);
std::shared_ptr<Resource::ResourceSystem> mResourceSystem; std::shared_ptr<Resource::ResourceSystem> mResourceSystem;

@ -666,7 +666,7 @@ void CSVRender::TerrainTextureMode::pushEditToCommand(CSMWorld::LandTexturesColu
undoStack.push(new CSMWorld::TouchLandCommand(landTable, ltexTable, cellId)); undoStack.push(new CSMWorld::TouchLandCommand(landTable, ltexTable, cellId));
} }
void CSVRender::TerrainTextureMode::createTexture(std::string textureFileName) void CSVRender::TerrainTextureMode::createTexture(const std::string& textureFileName)
{ {
CSMDoc::Document& document = getWorldspaceWidget().getDocument(); CSMDoc::Document& document = getWorldspaceWidget().getDocument();
@ -696,12 +696,10 @@ void CSVRender::TerrainTextureMode::createTexture(std::string textureFileName)
} while (freeIndexFound == false); } while (freeIndexFound == false);
std::size_t idlocation = textureFileName.find("Texture: "); std::size_t idlocation = textureFileName.find("Texture: ");
textureFileName = textureFileName.substr(idlocation + 9); QString fileName = QString::fromStdString(textureFileName.substr(idlocation + 9));
QVariant textureNameVariant;
QVariant textureFileNameVariant; QVariant textureFileNameVariant;
textureFileNameVariant.setValue(QString::fromStdString(textureFileName)); textureFileNameVariant.setValue(fileName);
undoStack.beginMacro("Add land texture record"); undoStack.beginMacro("Add land texture record");
@ -712,7 +710,7 @@ void CSVRender::TerrainTextureMode::createTexture(std::string textureFileName)
mBrushTexture = newId; mBrushTexture = newId;
} }
bool CSVRender::TerrainTextureMode::allowLandTextureEditing(std::string cellId) bool CSVRender::TerrainTextureMode::allowLandTextureEditing(const std::string& cellId)
{ {
CSMDoc::Document& document = getWorldspaceWidget().getDocument(); CSMDoc::Document& document = getWorldspaceWidget().getDocument();
CSMWorld::IdTable& landTable CSMWorld::IdTable& landTable
@ -840,5 +838,5 @@ void CSVRender::TerrainTextureMode::setBrushShape(CSVWidget::BrushShape brushSha
void CSVRender::TerrainTextureMode::setBrushTexture(std::string brushTexture) void CSVRender::TerrainTextureMode::setBrushTexture(std::string brushTexture)
{ {
mBrushTexture = brushTexture; mBrushTexture = std::move(brushTexture);
} }

@ -118,10 +118,10 @@ namespace CSVRender
CSMWorld::IdTable& landTable, std::string cellId); CSMWorld::IdTable& landTable, std::string cellId);
/// \brief Create new land texture record from texture asset /// \brief Create new land texture record from texture asset
void createTexture(std::string textureFileName); void createTexture(const std::string& textureFileName);
/// \brief Create new cell and land if needed /// \brief Create new cell and land if needed
bool allowLandTextureEditing(std::string textureFileName); bool allowLandTextureEditing(const std::string& textureFileName);
std::string mCellId; std::string mCellId;
std::string mBrushTexture; std::string mBrushTexture;

@ -19,7 +19,7 @@
#include "tableeditidaction.hpp" #include "tableeditidaction.hpp"
#include "util.hpp" #include "util.hpp"
CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document, CSMWorld::UniversalId id, CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document, const CSMWorld::UniversalId& id,
CSMWorld::NestedTableProxyModel* model, QWidget* parent, bool editable, bool fixedRows) CSMWorld::NestedTableProxyModel* model, QWidget* parent, bool editable, bool fixedRows)
: DragRecordTable(document, parent) : DragRecordTable(document, parent)
, mAddNewRowAction(nullptr) , mAddNewRowAction(nullptr)

@ -36,7 +36,7 @@ namespace CSVWorld
CSMWorld::CommandDispatcher* mDispatcher; CSMWorld::CommandDispatcher* mDispatcher;
public: public:
NestedTable(CSMDoc::Document& document, CSMWorld::UniversalId id, CSMWorld::NestedTableProxyModel* model, NestedTable(CSMDoc::Document& document, const CSMWorld::UniversalId& id, CSMWorld::NestedTableProxyModel* model,
QWidget* parent = nullptr, bool editable = true, bool fixedRows = false); QWidget* parent = nullptr, bool editable = true, bool fixedRows = false);
std::vector<CSMWorld::UniversalId> getDraggedRecords() const override; std::vector<CSMWorld::UniversalId> getDraggedRecords() const override;

@ -1283,11 +1283,11 @@ namespace MWGui
{ {
} }
void showPage(TypesetBook::Ptr book, size_t page) override { mPageDisplay->showPage(book, page); } void showPage(TypesetBook::Ptr book, size_t page) override { mPageDisplay->showPage(std::move(book), page); }
void adviseLinkClicked(std::function<void(InteractiveId)> linkClicked) override void adviseLinkClicked(std::function<void(InteractiveId)> linkClicked) override
{ {
mPageDisplay->mLinkClicked = linkClicked; mPageDisplay->mLinkClicked = std::move(linkClicked);
} }
void unadviseLinkClicked() override { mPageDisplay->mLinkClicked = std::function<void(InteractiveId)>(); } void unadviseLinkClicked() override { mPageDisplay->mLinkClicked = std::function<void(InteractiveId)>(); }

@ -52,9 +52,9 @@ namespace
"Question_" + MyGUI::utility::toString(number) + "_AnswerThree") }; "Question_" + MyGUI::utility::toString(number) + "_AnswerThree") };
std::string sound = "vo\\misc\\chargen qa" + MyGUI::utility::toString(number) + ".wav"; std::string sound = "vo\\misc\\chargen qa" + MyGUI::utility::toString(number) + ".wav";
Response r0 = { answer0, ESM::Class::Combat }; Response r0 = { std::move(answer0), ESM::Class::Combat };
Response r1 = { answer1, ESM::Class::Magic }; Response r1 = { std::move(answer1), ESM::Class::Magic };
Response r2 = { answer2, ESM::Class::Stealth }; Response r2 = { std::move(answer2), ESM::Class::Stealth };
// randomize order in which responses are displayed // randomize order in which responses are displayed
int order = Misc::Rng::rollDice(6); int order = Misc::Rng::rollDice(6);

@ -328,7 +328,7 @@ namespace MWGui
mHistory->eventMouseWheel += MyGUI::newDelegate(this, &DialogueWindow::onMouseWheel); mHistory->eventMouseWheel += MyGUI::newDelegate(this, &DialogueWindow::onMouseWheel);
BookPage::ClickCallback callback = [this](TypesetBook::InteractiveId link) { notifyLinkClicked(link); }; BookPage::ClickCallback callback = [this](TypesetBook::InteractiveId link) { notifyLinkClicked(link); };
mHistory->adviseLinkClicked(callback); mHistory->adviseLinkClicked(std::move(callback));
mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord
+= MyGUI::newDelegate(this, &DialogueWindow::onWindowResize); += MyGUI::newDelegate(this, &DialogueWindow::onWindowResize);

@ -16,7 +16,7 @@ namespace
MWGui::BookTypesetter::Style* mBodyStyle; MWGui::BookTypesetter::Style* mBodyStyle;
AddContent(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style) AddContent(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style)
: mTypesetter(typesetter) : mTypesetter(std::move(typesetter))
, mBodyStyle(body_style) , mBodyStyle(body_style)
{ {
} }
@ -48,7 +48,7 @@ namespace
MWGui::BookTypesetter::Style* mBodyStyle; MWGui::BookTypesetter::Style* mBodyStyle;
AddEntry(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style) AddEntry(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style)
: mTypesetter(typesetter) : mTypesetter(std::move(typesetter))
, mBodyStyle(body_style) , mBodyStyle(body_style)
{ {
} }
@ -68,7 +68,7 @@ namespace
AddJournalEntry(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style, AddJournalEntry(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style,
MWGui::BookTypesetter::Style* header_style, bool add_header) MWGui::BookTypesetter::Style* header_style, bool add_header)
: AddEntry(typesetter, body_style) : AddEntry(std::move(typesetter), body_style)
, mAddHeader(add_header) , mAddHeader(add_header)
, mHeaderStyle(header_style) , mHeaderStyle(header_style)
{ {
@ -95,7 +95,7 @@ namespace
AddTopicEntry(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style, AddTopicEntry(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style,
MWGui::BookTypesetter::Style* header_style, intptr_t contentId) MWGui::BookTypesetter::Style* header_style, intptr_t contentId)
: AddEntry(typesetter, body_style) : AddEntry(std::move(typesetter), body_style)
, mContentId(contentId) , mContentId(contentId)
, mHeaderStyle(header_style) , mHeaderStyle(header_style)
{ {
@ -118,7 +118,7 @@ namespace
struct AddTopicName : AddContent struct AddTopicName : AddContent
{ {
AddTopicName(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* style) AddTopicName(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* style)
: AddContent(typesetter, style) : AddContent(std::move(typesetter), style)
{ {
} }
@ -132,7 +132,7 @@ namespace
struct AddQuestName : AddContent struct AddQuestName : AddContent
{ {
AddQuestName(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* style) AddQuestName(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* style)
: AddContent(typesetter, style) : AddContent(std::move(typesetter), style)
{ {
} }

@ -91,8 +91,8 @@ namespace
MWGui::BookPage* getPage(std::string_view name) { return getWidget<MWGui::BookPage>(name); } MWGui::BookPage* getPage(std::string_view name) { return getWidget<MWGui::BookPage>(name); }
JournalWindowImpl(MWGui::JournalViewModel::Ptr Model, bool questList, ToUTF8::FromType encoding) JournalWindowImpl(MWGui::JournalViewModel::Ptr model, bool questList, ToUTF8::FromType encoding)
: JournalBooks(Model, encoding) : JournalBooks(std::move(model), encoding)
, JournalWindow() , JournalWindow()
{ {
center(); center();
@ -313,7 +313,7 @@ namespace
notifyTopics(getWidget<MyGUI::Widget>(TopicsList)); notifyTopics(getWidget<MyGUI::Widget>(TopicsList));
} }
void pushBook(Book book, unsigned int page) void pushBook(Book& book, unsigned int page)
{ {
DisplayState bs; DisplayState bs;
bs.mPage = page; bs.mPage = page;
@ -323,7 +323,7 @@ namespace
updateCloseJournalButton(); updateCloseJournalButton();
} }
void replaceBook(Book book, unsigned int page) void replaceBook(Book& book, unsigned int page)
{ {
assert(!mStates.empty()); assert(!mStates.empty());
mStates.top().mBook = book; mStates.top().mBook = book;

@ -22,7 +22,7 @@ namespace MWGui
/// construct a new instance of the one JournalWindow implementation /// construct a new instance of the one JournalWindow implementation
static std::unique_ptr<JournalWindow> create( static std::unique_ptr<JournalWindow> create(
std::shared_ptr<JournalViewModel> Model, bool questList, ToUTF8::FromType encoding); std::shared_ptr<JournalViewModel> model, bool questList, ToUTF8::FromType encoding);
/// destroy this instance of the JournalWindow implementation /// destroy this instance of the JournalWindow implementation
virtual ~JournalWindow() {} virtual ~JournalWindow() {}

@ -500,7 +500,7 @@ namespace MWGui
std::pair<MyGUI::TextBox*, MyGUI::TextBox*> widgets std::pair<MyGUI::TextBox*, MyGUI::TextBox*> widgets
= addValueItem(skill->mName, {}, "normal", coord1, coord2); = addValueItem(skill->mName, {}, "normal", coord1, coord2);
mSkillWidgetMap[skill->mId] = widgets; mSkillWidgetMap[skill->mId] = std::move(widgets);
for (int i = 0; i < 2; ++i) for (int i = 0; i < 2; ++i)
{ {

@ -71,7 +71,7 @@ namespace MWLua
template <class T> template <class T>
void addRecordFunctionBinding( void addRecordFunctionBinding(
sol::table table, const Context& context, const std::string& recordName = std::string(T::getRecordType())) sol::table& table, const Context& context, const std::string& recordName = std::string(T::getRecordType()))
{ {
const MWWorld::Store<T>& store = MWBase::Environment::get().getESMStore()->get<T>(); const MWWorld::Store<T>& store = MWBase::Environment::get().getESMStore()->get<T>();

@ -172,7 +172,7 @@ namespace MWRender
std::shared_ptr<float> mTimePtr; std::shared_ptr<float> mTimePtr;
public: public:
void setTimePtr(std::shared_ptr<float> time) { mTimePtr = time; } void setTimePtr(std::shared_ptr<float> time) { mTimePtr = std::move(time); }
std::shared_ptr<float> getTimePtr() const { return mTimePtr; } std::shared_ptr<float> getTimePtr() const { return mTimePtr; }
float getValue(osg::NodeVisitor* nv) override; float getValue(osg::NodeVisitor* nv) override;

@ -21,8 +21,8 @@ namespace MWRender
auto luminanceFragment = shaderManager.getShader("luminance/luminance.frag", defines); auto luminanceFragment = shaderManager.getShader("luminance/luminance.frag", defines);
auto resolveFragment = shaderManager.getShader("luminance/resolve.frag", defines); auto resolveFragment = shaderManager.getShader("luminance/resolve.frag", defines);
mResolveProgram = shaderManager.getProgram(vertex, resolveFragment); mResolveProgram = shaderManager.getProgram(vertex, std::move(resolveFragment));
mLuminanceProgram = shaderManager.getProgram(vertex, luminanceFragment); mLuminanceProgram = shaderManager.getProgram(vertex, std::move(luminanceFragment));
} }
void LuminanceCalculator::compile() void LuminanceCalculator::compile()

@ -60,7 +60,7 @@ namespace MWRender
NavMeshMode mode) NavMeshMode mode)
: mId(id) : mId(id)
, mVersion(version) , mVersion(version)
, mNavMesh(navMesh) , mNavMesh(std::move(navMesh))
, mGroupStateSet(groupStateSet) , mGroupStateSet(groupStateSet)
, mDebugDrawStateSet(debugDrawStateSet) , mDebugDrawStateSet(debugDrawStateSet)
, mSettings(settings) , mSettings(settings)

@ -63,7 +63,7 @@ namespace MWWorld
public: public:
ResolutionHandle(std::shared_ptr<ResolutionListener> listener) ResolutionHandle(std::shared_ptr<ResolutionListener> listener)
: mListener(listener) : mListener(std::move(listener))
{ {
} }
ResolutionHandle() = default; ResolutionHandle() = default;

@ -10,7 +10,7 @@
#include <components/esm3/esmreader.hpp> #include <components/esm3/esmreader.hpp>
#include <components/files/qtconversion.hpp> #include <components/files/qtconversion.hpp>
ContentSelectorModel::ContentModel::ContentModel(QObject* parent, QIcon warningIcon, bool showOMWScripts) ContentSelectorModel::ContentModel::ContentModel(QObject* parent, QIcon& warningIcon, bool showOMWScripts)
: QAbstractTableModel(parent) : QAbstractTableModel(parent)
, mWarningIcon(warningIcon) , mWarningIcon(warningIcon)
, mShowOMWScripts(showOMWScripts) , mShowOMWScripts(showOMWScripts)

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

@ -12,7 +12,7 @@ QString ContentSelectorModel::EsmFile::sToolTip = QString(
<br/><b>Description:</b><br/>%5<br/> \ <br/><b>Description:</b><br/>%5<br/> \
<br/><b>Dependencies: </b>%6<br/>"); <br/><b>Dependencies: </b>%6<br/>");
ContentSelectorModel::EsmFile::EsmFile(QString fileName, ModelItem* parent) ContentSelectorModel::EsmFile::EsmFile(const QString& fileName, ModelItem* parent)
: ModelItem(parent) : ModelItem(parent)
, mFileName(fileName) , mFileName(fileName)
{ {

@ -29,7 +29,7 @@ namespace ContentSelectorModel
FileProperty_GameFile = 6 FileProperty_GameFile = 6
}; };
EsmFile(QString fileName = QString(), ModelItem* parent = nullptr); EsmFile(const QString& fileName = QString(), ModelItem* parent = nullptr);
// EsmFile(const EsmFile &); // EsmFile(const EsmFile &);
~EsmFile() {} ~EsmFile() {}

@ -21,7 +21,7 @@ namespace ContentSelectorModel
: mErrorCode(ErrorCode_None) : mErrorCode(ErrorCode_None)
{ {
} }
inline LoadOrderError(ErrorCode errorCode, QString fileName) inline LoadOrderError(ErrorCode errorCode, const QString& fileName)
: mErrorCode(errorCode) : mErrorCode(errorCode)
, mFileName(fileName) , mFileName(fileName)
{ {

@ -22,7 +22,7 @@ namespace ESM
if (mList.empty()) if (mList.empty())
Log(Debug::Warning) << "Encountered DNAM record without DODT record, skipped."; Log(Debug::Warning) << "Encountered DNAM record without DODT record, skipped.";
else else
mList.back().mCellName = name; mList.back().mCellName = std::move(name);
} }
} }

@ -264,6 +264,6 @@ void Fallback::validate(boost::any& v, std::vector<std::string> const& tokens, F
std::string key(token.substr(0, sep)); std::string key(token.substr(0, sep));
std::string value(token.substr(sep + 1)); std::string value(token.substr(sep + 1));
map->mMap[key] = value; map->mMap[key] = std::move(value);
} }
} }

@ -408,7 +408,7 @@ namespace Gui
file.reset(); file.reset();
// Create the font texture // Create the font texture
std::string bitmapFilename = "fonts/" + std::string(name) + ".tex"; std::string bitmapFilename = "fonts/" + std::move(name) + ".tex";
Files::IStreamPtr bitmapFile = mVFS->get(bitmapFilename); Files::IStreamPtr bitmapFile = mVFS->get(bitmapFilename);

@ -95,7 +95,10 @@ namespace fx
mData.get<WeatherTransition>() = transition > 0 ? 1 - transition : 0; mData.get<WeatherTransition>() = transition > 0 ? 1 - transition : 0;
} }
void bindPointLights(std::shared_ptr<SceneUtil::PPLightBuffer> buffer) { mPointLightBuffer = buffer; } void bindPointLights(std::shared_ptr<SceneUtil::PPLightBuffer> buffer)
{
mPointLightBuffer = std::move(buffer);
}
static std::string getStructDefinition() static std::string getStructDefinition()
{ {

@ -29,12 +29,12 @@ namespace SceneUtil
void Controller::setSource(std::shared_ptr<ControllerSource> source) void Controller::setSource(std::shared_ptr<ControllerSource> source)
{ {
mSource = source; mSource = std::move(source);
} }
void Controller::setFunction(std::shared_ptr<ControllerFunction> function) void Controller::setFunction(std::shared_ptr<ControllerFunction> function)
{ {
mFunction = function; mFunction = std::move(function);
} }
std::shared_ptr<ControllerSource> Controller::getSource() const std::shared_ptr<ControllerSource> Controller::getSource() const
@ -105,7 +105,7 @@ namespace SceneUtil
AssignControllerSourcesVisitor::AssignControllerSourcesVisitor(std::shared_ptr<ControllerSource> toAssign) AssignControllerSourcesVisitor::AssignControllerSourcesVisitor(std::shared_ptr<ControllerSource> toAssign)
: ControllerVisitor() : ControllerVisitor()
, mToAssign(toAssign) , mToAssign(std::move(toAssign))
{ {
} }
@ -121,7 +121,7 @@ namespace SceneUtil
} }
ForceControllerSourcesVisitor::ForceControllerSourcesVisitor(std::shared_ptr<ControllerSource> toAssign) ForceControllerSourcesVisitor::ForceControllerSourcesVisitor(std::shared_ptr<ControllerSource> toAssign)
: AssignControllerSourcesVisitor(toAssign) : AssignControllerSourcesVisitor(std::move(toAssign))
{ {
} }

@ -192,7 +192,7 @@ namespace SceneUtil
} }
osg::MatrixList mtxList osg::MatrixList mtxList
= root->getWorldMatrices(root); // We always assume that RigGeometries have origin at their root = root->getWorldMatrices(root); // We always assume that RigGeometries have origin at their root
geom->computeMatrixFromRootSkeleton(mtxList); geom->computeMatrixFromRootSkeleton(std::move(mtxList));
if (mIsBodyPart && mBackToOrigin) if (mIsBodyPart && mBackToOrigin)
updateBackToOriginTransform(geom); updateBackToOriginTransform(geom);

@ -105,7 +105,7 @@ namespace SceneUtil
const std::string& screenshotFormat, std::function<void(std::string)> callback) const std::string& screenshotFormat, std::function<void(std::string)> callback)
: mScreenshotPath(screenshotPath) : mScreenshotPath(screenshotPath)
, mScreenshotFormat(screenshotFormat) , mScreenshotFormat(screenshotFormat)
, mCallback(callback) , mCallback(std::move(callback))
{ {
} }

@ -348,7 +348,7 @@ namespace Stereo
void Manager::setUpdateViewCallback(std::shared_ptr<UpdateViewCallback> cb) void Manager::setUpdateViewCallback(std::shared_ptr<UpdateViewCallback> cb)
{ {
mUpdateViewCallback = cb; mUpdateViewCallback = std::move(cb);
} }
void Manager::setCullCallback(osg::ref_ptr<osg::NodeCallback> cb) void Manager::setCullCallback(osg::ref_ptr<osg::NodeCallback> cb)
@ -382,7 +382,7 @@ namespace Stereo
return sStereoEnabled; return sStereoEnabled;
} }
Manager::CustomViewCallback::CustomViewCallback(View left, View right) Manager::CustomViewCallback::CustomViewCallback(View& left, View& right)
: mLeft(left) : mLeft(left)
, mRight(right) , mRight(right)
{ {

@ -59,7 +59,7 @@ namespace Stereo
struct CustomViewCallback : public UpdateViewCallback struct CustomViewCallback : public UpdateViewCallback
{ {
public: public:
CustomViewCallback(View left, View right); CustomViewCallback(View& left, View& right);
void updateView(View& left, View& right) override; void updateView(View& left, View& right) override;

Loading…
Cancel
Save