From: David H. <no...@so...> - 2014-01-11 17:08:17
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "codelite". The branch, master has been updated via 0bab0c1d608ad91c6290e8f39c82c4f22ccdb15f (commit) from 522dc333a39f754f39308ce610aaff09fe0a8d9b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceforge.net/p/codelite/codelitegit/ci/0bab0c1d608ad91c6290e8f39c82c4f22ccdb15f commit 0bab0c1d608ad91c6290e8f39c82c4f22ccdb15f Author: dghart <da...@4P...> Date: Sat Jan 11 17:06:45 2014 +0000 Make sure CodeLite's data dir actually exists before writing to it Passing the commandline option --datadir with an invalid filepath caused asserts or worse. So explicitly create any missing dir if necessary. diff --git a/LiteEditor/app.cpp b/LiteEditor/app.cpp index 9765251..50ce391 100644 --- a/LiteEditor/app.cpp +++ b/LiteEditor/app.cpp @@ -344,7 +344,12 @@ bool CodeLiteApp::OnInit() #if defined (__WXGTK__) if (homeDir.IsEmpty()) { SetAppName(wxT("codelite")); - homeDir = clStandardPaths::Get().GetUserDataDir(); // ~/Library/Application Support/codelite or ~/.codelite + homeDir = clStandardPaths::Get().GetUserDataDir(); // By default, ~/Library/Application Support/codelite or ~/.codelite + if (!wxFileName::Exists(homeDir)) { + wxLogNull noLog; + wxFileName::Mkdir(homeDir, wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); + wxCHECK_MSG(wxFileName::DirExists(homeDir), false, "Failed to create the requested data dir"); + } //Create the directory structure wxLogNull noLog; @@ -370,6 +375,12 @@ bool CodeLiteApp::OnInit() #elif defined (__WXMAC__) SetAppName(wxT("codelite")); homeDir = clStandardPaths::Get().GetUserDataDir(); + if (!wxFileName::Exists(homeDir)) { + wxLogNull noLog; + wxFileName::Mkdir(homeDir, wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); + wxCHECK_MSG(wxFileName::DirExists(homeDir), false, "Failed to create the requested data dir"); + } + { wxLogNull noLog; @@ -458,7 +469,7 @@ bool CodeLiteApp::OnInit() #ifdef __WXMSW__ { wxLogNull noLog; - wxMkdir(clStandardPaths::Get().GetUserDataDir()); + wxFileName::Mkdir(clStandardPaths::Get().GetUserDataDir(), wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); } #endif ----------------------------------------------------------------------- Summary of changes: LiteEditor/app.cpp | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) hooks/post-receive -- codelite |