Skip to content
Snippets Groups Projects
Commit f76601ee authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

create default file in homedir if no PWD

parent 7bd51c0b
No related branches found
No related tags found
No related merge requests found
...@@ -654,7 +654,8 @@ void ClearProject() ...@@ -654,7 +654,8 @@ void ClearProject()
Msg::Info("Done clearing all models and views"); Msg::Info("Done clearing all models and views");
new GModel(); new GModel();
GModel::current()->setFileName(CTX::instance()->defaultFileName); std::string base = (getenv("PWD") ? "" : CTX::instance()->homeDir);
GModel::current()->setFileName(base + CTX::instance()->defaultFileName);
GModel::current()->setName(""); GModel::current()->setName("");
#if defined(HAVE_FLTK) #if defined(HAVE_FLTK)
if(FlGui::available()){ if(FlGui::available()){
......
...@@ -27,8 +27,8 @@ void add_infile(const std::string &text, const std::string &fileNameOrEmpty) ...@@ -27,8 +27,8 @@ void add_infile(const std::string &text, const std::string &fileNameOrEmpty)
{ {
std::string fileName = fileNameOrEmpty; std::string fileName = fileNameOrEmpty;
if(fileName.empty()){ if(fileName.empty()){
fileName = CTX::instance()->defaultFileName; std::string base = (getenv("PWD") ? "" : CTX::instance()->homeDir);
GModel::current()->setFileName(fileName); GModel::current()->setFileName(base + CTX::instance()->defaultFileName);
GModel::current()->setName(""); GModel::current()->setName("");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment