diff --git a/src/olympic/keel/include/keel/assetmanager.hpp b/src/olympic/keel/include/keel/assetmanager.hpp index d543ec3a..88b0cdc5 100644 --- a/src/olympic/keel/include/keel/assetmanager.hpp +++ b/src/olympic/keel/include/keel/assetmanager.hpp @@ -171,8 +171,7 @@ constexpr AssetRef::AssetRef(AssetRef const&h) noexcept: m_ctr(h.m_ctr) { } template -constexpr AssetRef::AssetRef(AssetRef &&h) noexcept { - m_ctr = h.m_ctr; +constexpr AssetRef::AssetRef(AssetRef &&h) noexcept: m_ctr(h.m_ctr) { if (m_ctr) { m_ctr->updated.connect(this, &AssetRef::emitUpdated); } diff --git a/src/olympic/studio/applib/src/studioapp.cpp b/src/olympic/studio/applib/src/studioapp.cpp index 54ab3c2b..52530878 100644 --- a/src/olympic/studio/applib/src/studioapp.cpp +++ b/src/olympic/studio/applib/src/studioapp.cpp @@ -41,9 +41,9 @@ oxModelEnd() StudioUI::StudioUI(turbine::Context &ctx, ox::StringView projectDataDir) noexcept: m_ctx(ctx), m_projectDataDir(projectDataDir), - m_projectExplorer(ox::make_unique(m_ctx)), + m_projectExplorer(m_ctx), m_aboutPopup(m_ctx) { - m_projectExplorer->fileChosen.connect(this, &StudioUI::openFile); + m_projectExplorer.fileChosen.connect(this, &StudioUI::openFile); ImGui::GetIO().IniFilename = nullptr; loadModules(); // open project and files @@ -148,7 +148,7 @@ void StudioUI::draw() noexcept { ImGui::Begin("MainWindow##Studio", nullptr, windowFlags); { if (m_showProjectExplorer) { - m_projectExplorer->draw(m_ctx); + m_projectExplorer.draw(m_ctx); ImGui::SameLine(); } drawTabBar(); @@ -285,7 +285,7 @@ void StudioUI::loadModule(studio::Module const*mod) noexcept { } void StudioUI::loadModules() noexcept { - for (auto &mod : modules) { + for (auto const mod : modules) { loadModule(mod); } } @@ -324,15 +324,15 @@ ox::Error StudioUI::openProject(ox::CRStringView path) noexcept { m_project = ox::make_unique(keelCtx(m_ctx), ox::String(path), m_projectDataDir); auto sctx = applicationData(m_ctx); sctx->project = m_project.get(); - m_project->fileAdded.connect(m_projectExplorer.get(), &ProjectExplorer::refreshProjectTreeModel); - m_project->fileDeleted.connect(m_projectExplorer.get(), &ProjectExplorer::refreshProjectTreeModel); + m_project->fileAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel); + m_project->fileDeleted.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel); m_openFiles.clear(); m_editors.clear(); studio::editConfig(keelCtx(m_ctx), [&](StudioConfig *config) { config->projectPath = ox::String(path); config->openFiles.clear(); }); - return m_projectExplorer->refreshProjectTreeModel(); + return m_projectExplorer.refreshProjectTreeModel(); } ox::Error StudioUI::openFile(ox::CRStringView path) noexcept { diff --git a/src/olympic/studio/applib/src/studioapp.hpp b/src/olympic/studio/applib/src/studioapp.hpp index 049af42e..97be957e 100644 --- a/src/olympic/studio/applib/src/studioapp.hpp +++ b/src/olympic/studio/applib/src/studioapp.hpp @@ -30,7 +30,7 @@ class StudioUI: public ox::SignalHandler { ox::Vector> m_editors; ox::Vector> m_widgets; ox::HashMap m_editorMakers; - ox::UPtr m_projectExplorer; + ProjectExplorer m_projectExplorer; ox::Vector m_openFiles; studio::BaseEditor *m_activeEditorOnLastDraw = nullptr; studio::BaseEditor *m_activeEditor = nullptr; @@ -67,7 +67,7 @@ class StudioUI: public ox::SignalHandler { void loadEditorMaker(studio::EditorMaker const&editorMaker) noexcept; - void loadModule(const studio::Module *mod) noexcept; + void loadModule(studio::Module const*mod) noexcept; void loadModules() noexcept;