change to /usr/share/wx/version

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2001-11-22 00:30:44 +00:00
parent 65eb985502
commit 2c18f21dc7
3 changed files with 15 additions and 3 deletions

View File

@@ -87,6 +87,8 @@ WXDLLEXPORT wxString wxNow();
// Return path where wxWindows is installed (mostly useful in Unices) // Return path where wxWindows is installed (mostly useful in Unices)
WXDLLEXPORT const wxChar *wxGetInstallPrefix(); WXDLLEXPORT const wxChar *wxGetInstallPrefix();
// Return path to wxWin data (/usr/share/wx/%{version}) (Unices)
WXDLLEXPORT wxString wxGetDataDir();
#if wxUSE_GUI #if wxUSE_GUI

View File

@@ -1087,6 +1087,18 @@ const wxChar *wxGetInstallPrefix()
#endif #endif
} }
wxString wxGetDataDir()
{
wxString format = wxGetInstallPrefix();
format << wxFILE_SEP_PATH
<< wxT("share") << wxFILE_SEP_PATH
<< wxT("wx") << wxFILE_SEP_PATH
<< wxT("%i.%i");
wxString dir;
dir.Printf(format.c_str(), wxMAJOR_VERSION, wxMINOR_VERSION);
return dir;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// network and user id functions // network and user id functions

View File

@@ -2034,10 +2034,8 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
- afmFile = fopen() may fail and in that case the next if branch - afmFile = fopen() may fail and in that case the next if branch
MUST be executed - and it would not if there was "else" */ MUST be executed - and it would not if there was "else" */
{ {
afmName = wxGetInstallPrefix(); afmName = wxGetDataDir();
afmName << wxFILE_SEP_PATH afmName << wxFILE_SEP_PATH
<< wxT("share") << wxFILE_SEP_PATH
<< wxT("wx") << wxFILE_SEP_PATH
#if defined(__LINUX__) || defined(__FREEBSD__) #if defined(__LINUX__) || defined(__FREEBSD__)
<< wxT("gs_afm") << wxFILE_SEP_PATH << wxT("gs_afm") << wxFILE_SEP_PATH
#else #else