Skip to content

Commit 8cbe424

Browse files
Merge pull request #35 from adriengivry/feature/add_project_to_hub_when_opened_without_hub
Project added to hub when received as program args
2 parents ce04e24 + d4656ba commit 8cbe424

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Diff for: Sources/Overload/OvEditor/include/OvEditor/Core/ProjectHub.h

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ namespace OvEditor::Core
3636
*/
3737
void SetupContext();
3838

39+
/**
40+
* Register the project (identified from the given path) into the project hub
41+
* @param p_path
42+
*/
43+
void RegisterProject(const std::string& p_path);
44+
3945
private:
4046
std::unique_ptr<OvWindowing::Context::Device> m_device;
4147
std::unique_ptr<OvWindowing::Window> m_window;

Diff for: Sources/Overload/OvEditor/src/OvEditor/Core/ProjectHub.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,8 @@ void OvEditor::Core::ProjectHub::SetupContext()
307307
m_uiManager->EnableEditorLayoutSave(false);
308308
m_uiManager->EnableDocking(false);
309309
}
310+
311+
void OvEditor::Core::ProjectHub::RegisterProject(const std::string& p_path)
312+
{
313+
static_cast<ProjectHubPanel*>(m_mainPanel.get())->RegisterProject(p_path);
314+
}

Diff for: Sources/Overload/OvEditor/src/OvEditor/Main.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ int main(int argc, char** argv)
6464
projectName = OvTools::Utils::PathParser::GetElementName(projectFile);
6565
OvTools::Utils::String::Replace(projectName, ".ovproject", "");
6666
}
67+
68+
hub.RegisterProject(projectPath);
6769
}
6870
}
6971

0 commit comments

Comments
 (0)