From: <pst...@us...> - 2008-11-15 14:36:24
|
Revision: 624 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=624&view=rev Author: pstieber Date: 2008-11-15 14:36:19 +0000 (Sat, 15 Nov 2008) Log Message: ----------- Used wxWidgets standard paths to set the location of the help cache directory in a place writable by the user. This is the first step in allowing a Linux install under /usr/local or some other system directory. Modified Paths: -------------- trunk/jazz/src/JazzPlusPlusApplication.cpp Modified: trunk/jazz/src/JazzPlusPlusApplication.cpp =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.cpp 2008-11-11 22:30:53 UTC (rev 623) +++ trunk/jazz/src/JazzPlusPlusApplication.cpp 2008-11-15 14:36:19 UTC (rev 624) @@ -22,6 +22,8 @@ #include "WxWidgets.h" +#include <wx/stdpaths.h> + #include "JazzPlusPlusApplication.h" #include "TrackFrame.h" #include "Project.h" @@ -133,6 +135,19 @@ SetVendorName("Jazz"); SetAppName("Jazz"); + wxString ConfigDir = wxStandardPaths::Get().GetUserDataDir(); + if (!wxDirExists(ConfigDir)) + { + if (!wxMkdir(ConfigDir)) + { + wxString String; + String + << "Unable to create directory \"" + << ConfigDir << '"'; + ::wxMessageBox(String, "Directory Creation Error"); + } + } + // Create the one and only top-level Jazz++ project. mpProject = new JZProject; gpProject = mpProject; @@ -200,8 +215,12 @@ if (HelpFileFound) { + // GetUserDataDir returns the directory for the user-dependent application + // data files. The value is $HOME/.appname on Linux, + // c:\Documents and Settings\username\Application Data\appname on + // Windows, and ~/Library/Application Support/appname on the Mac. // The cached version of the help file will be placed in this location. - mHelp.SetTempDir(HelpFilePath); + mHelp.SetTempDir(wxStandardPaths::Get().GetUserDataDir()); // Add the IPVT help file the the help system. mHelp.AddBook(HelpFileNameAndPath); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |