[keel,nostalgia/tools/pack,studio] Cleanup

This commit is contained in:
2023-11-30 21:45:03 -06:00
parent 68a0dd9660
commit 0fc7e7005c
7 changed files with 30 additions and 33 deletions

View File

@@ -106,8 +106,7 @@ void NewMenu::drawLastPageButtons(turbine::Context *ctx) noexcept {
}
void NewMenu::finish(turbine::Context *ctx) noexcept {
const auto itemName = ox::String(m_itemName);
const auto err = m_types[static_cast<std::size_t>(m_selectedType)]->write(ctx, itemName);
const auto err = m_types[static_cast<std::size_t>(m_selectedType)]->write(ctx, m_itemName);
if (err) {
oxLogError(err);
return;

View File

@@ -305,7 +305,7 @@ ox::Error StudioUI::openProject(ox::CRStringView path) noexcept {
oxRequireM(fs, keel::loadRomFs(path));
oxReturnError(keel::setRomFs(&m_ctx->keelCtx, std::move(fs)));
turbine::setWindowTitle(*m_ctx, ox::sfmt("{} - {}", m_ctx->keelCtx.appName, path));
m_project = ox::make_unique<studio::Project>(&m_ctx->keelCtx, ox::String(path), m_projectDir);
m_project = ox::make_unique<studio::Project>(m_ctx->keelCtx, ox::String(path), m_projectDir);
auto sctx = applicationData<studio::StudioContext>(*m_ctx);
sctx->project = m_project.get();
m_project->fileAdded.connect(m_projectExplorer.get(), &ProjectExplorer::refreshProjectTreeModel);
@@ -324,9 +324,7 @@ ox::Error StudioUI::openFile(ox::CRStringView path) noexcept {
}
ox::Error StudioUI::openFileActiveTab(ox::CRStringView path, bool makeActiveTab) noexcept {
// Warning: StringView to String
auto const pathStr = ox::String(path);
if (m_openFiles.contains(pathStr)) {
if (m_openFiles.contains(path)) {
for (auto &e : m_editors) {
if (makeActiveTab && e->itemName() == path) {
m_activeEditor = e.get();
@@ -365,7 +363,7 @@ ox::Error StudioUI::openFileActiveTab(ox::CRStringView path, bool makeActiveTab)
}
// save to config
studio::editConfig<StudioConfig>(&m_ctx->keelCtx, [&](StudioConfig *config) {
if (!config->openFiles.contains(pathStr)) {
if (!config->openFiles.contains(path)) {
config->openFiles.emplace_back(path);
}
});