Changeset 8a05a7a in git


Ignore:
Timestamp:
13/06/10 13:26:17 (9 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/survex-1_1, svn/tags/1.1.14, svn/tags/1.1.15, svn/tags/1.1.16, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/tags/v1_1_13, svn/trunk, travis-osx
Children:
6f14ee0
Parents:
d3172cc
Message:

src/: Add wmsg_cfgpth() which caches the result of msg_cfgpth() as
a wxString.

git-svn-id: file:///home/survex-svn/survex/branches/survex-1_1@3398 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rd3172cc r8a05a7a  
     1Sun Jun 13 12:23:23 GMT 2010  Olly Betts <olly@survex.com>
     2
     3        * src/: Add wmsg_cfgpth() which caches the result of msg_cfgpth() as
     4          a wxString.
     5
    16Sun Jun 13 06:57:07 GMT 2010  Olly Betts <olly@survex.com>
    27
  • src/aven.cc

    rd3172cc r8a05a7a  
    160160        wxLogNull logNo;
    161161        wxLocale *loc = new wxLocale();
    162         loc->AddCatalogLookupPathPrefix(wxString(msg_cfgpth(), wxConvUTF8));
     162        loc->AddCatalogLookupPathPrefix(wmsg_cfgpth());
    163163        wxString msg_lang_str(msg_lang, wxConvUTF8);
    164164        const char *lang = msg_lang2 ? msg_lang2 : msg_lang;
     
    324324}
    325325
     326const wxString &
     327wmsg_cfgpth()
     328{
     329    static wxString path;
     330    if (path.empty())
     331        path = wxString(msg_cfgpth(), wxConvUTF8);
     332    return path;
     333}
     334
    326335// called to report errors by message.c
    327336extern "C" void
  • src/aven.h

    rd3172cc r8a05a7a  
    7676wxString wmsg(int msg_no);
    7777
     78const wxString & wmsg_cfgpth();
     79
    7880class MainFrm;
    7981
  • src/gla-gl.cc

    rd3172cc r8a05a7a  
    302302#ifdef USE_FNT
    303303    // Load font
    304     wxString path(msg_cfgpth(), wxConvUTF8);
     304    wxString path = wmsg_cfgpth();
    305305    path += wxCONFIG_PATH_SEPARATOR;
    306306    path += wxT("aven.txf");
     
    13041304
    13051305        wxImage img;
    1306         wxString texture(msg_cfgpth(), wxConvUTF8);
     1306        wxString texture(wmsg_cfgpth());
    13071307        texture += wxCONFIG_PATH_SEPARATOR;
    13081308        texture += wxT("icons");
  • src/mainfrm.cc

    rd3172cc r8a05a7a  
    669669#endif
    670670{
    671     icon_path = wxString(msg_cfgpth(), wxConvUTF8);
     671    icon_path = wxString(wmsg_cfgpth());
    672672    icon_path += wxCONFIG_PATH_SEPARATOR;
    673673    icon_path += wxT("icons");
     
    937937    // FIXME: this assumes images are 15x15
    938938    wxImageList* image_list = new wxImageList(15, 15);
    939     wxString path = wxString(msg_cfgpth(), wxConvUTF8);
     939    wxString path = wxString(wmsg_cfgpth());
    940940    path += wxCONFIG_PATH_SEPARATOR;
    941941    path += wxT("icons") ;
  • src/prefsdlg.cc

    rd3172cc r8a05a7a  
    7373    //FIXME share code with LoadIcon...
    7474
    75     const wxString path = wxString(msg_cfgpth()) +
    76                           wxCONFIG_PATH_SEPARATOR + wxString("icons") +
    77                           wxCONFIG_PATH_SEPARATOR +
    78                           wxString(icon) + wxString("prefs.png");
     75    wxString path = wmsg_cfgpth();
     76    path += wxCONFIG_PATH_SEPARATOR;
     77    path += wxString("icons");
     78    path += wxCONFIG_PATH_SEPARATOR;
     79    path += wxString(icon);
     80    path += wxString("prefs.png");
    7981    return wxBitmap(path, wxBITMAP_TYPE_PNG);
    8082}
Note: See TracChangeset for help on using the changeset viewer.