diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index bd6de222e55bf594e01437f40ce220e699701d70..2c4df066e2a2607a92dff57058c6f37a0d84b070 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -212,7 +212,7 @@ void ParseString(const char *str) } } -void SetProjectName(const char *name) +static void SetProjectName(const char *name) { char no_ext[256], ext[256], base[256]; SplitFileName(name, no_ext, ext, base); @@ -389,7 +389,7 @@ int MergeFile(const char *name, int warn_if_missing) return status; } -void ClearProject() +void ClearProject(const char *filename) { #if !defined(HAVE_NO_POST) for(int i = PView::list.size() - 1; i >= 0; i--) @@ -401,6 +401,7 @@ void ClearProject() for(int i = GModel::list.size() - 1; i >= 0; i--) delete GModel::list[i]; new GModel(); + SetProjectName(filename); #if defined(HAVE_FLTK) if(GUI::available()){ GUI::instance()->resetVisibility(); diff --git a/Common/OpenFile.h b/Common/OpenFile.h index 2a8da860814e670fe048f333a3ed8e99cf003bb6..1e0778cb0ab0d87da55577d0eb4d2f5823c81ae4 100644 --- a/Common/OpenFile.h +++ b/Common/OpenFile.h @@ -11,7 +11,7 @@ void ParseString(const char *str); void OpenProject(const char *filename); void OpenProjectMacFinder(const char *filename); int MergeFile(const char *filename, int warn_if_missing=0); -void ClearProject(); +void ClearProject(const char *filename); void SetBoundingBox(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); diff --git a/Fltk/menuWindow.cpp b/Fltk/menuWindow.cpp index e78c1b2e30c56a85bb9d9331ba181760f5dbf052..e912f794a05f1114195b434e04e850fd77c04a3e 100644 --- a/Fltk/menuWindow.cpp +++ b/Fltk/menuWindow.cpp @@ -143,7 +143,7 @@ static void file_merge_cb(Fl_Widget *w, void *data) static void file_clear_cb(Fl_Widget *w, void *data) { - ClearProject(); + ClearProject(CTX.default_filename); Draw(); } @@ -329,7 +329,7 @@ static void file_rename_cb(Fl_Widget *w, void *data) goto test; } rename(CTX.filename, name.c_str()); - ClearProject(); + ClearProject(name.c_str()); OpenProject(name.c_str()); Draw(); } @@ -536,7 +536,7 @@ static void geometry_edit_cb(Fl_Widget *w, void *data) void geometry_reload_cb(Fl_Widget *w, void *data) { - ClearProject(); + ClearProject(CTX.filename); OpenProject(CTX.filename); Draw(); }