X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..20aeaa203c953fd988c4d266f1c955b5dd716810:/src/gtk1/utilsres.cpp diff --git a/src/gtk1/utilsres.cpp b/src/gtk1/utilsres.cpp index e3f817e19f..aa8b739307 100644 --- a/src/gtk1/utilsres.cpp +++ b/src/gtk1/utilsres.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utilres.cpp +// Name: src/gtk1/utilsres.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -7,19 +7,19 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -//#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -//#pragma implementation "utils.h" -//#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #include "wx/utils.h" -#include "wx/string.h" -#include "wx/list.h" -#include "wx/log.h" + +#ifndef WX_PRECOMP + #include "wx/list.h" + #include "wx/string.h" + #include "wx/log.h" + #include "wx/app.h" +#endif + #include "wx/config.h" -#include "wx/app.h" //----------------------------------------------------------------------------- // resource functions @@ -28,12 +28,12 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file ) { wxString filename( file ); - if (filename.IsEmpty()) filename = wxT(".wxWidgets"); - + if (filename.empty()) filename = wxT(".wxWindows"); + wxFileConfig conf( wxTheApp->GetAppName(), wxTheApp->GetVendorName(), filename ); - + conf.SetPath( section ); - + return conf.Write( entry, value ); } @@ -64,7 +64,7 @@ bool wxWriteResource(const wxString& section, const wxString& entry, int value, bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file ) { wxString filename( file ); - if (filename.IsEmpty()) filename = wxT(".wxWidgets"); + if (filename.empty()) filename = wxT(".wxWindows"); wxFileConfig conf( wxTheApp->GetAppName(), wxTheApp->GetVendorName(), filename ); @@ -73,16 +73,16 @@ bool wxGetResource(const wxString& section, const wxString& entry, wxChar **valu wxString result; if (conf.Read( entry, &result )) { - if (!result.IsEmpty()) + if (!result.empty()) { wxChar *s = new wxChar[result.Len()+1]; wxStrcpy( s, result.c_str() ); *value = s; - return TRUE; + return true; } } - return FALSE; + return false; } bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file ) @@ -93,9 +93,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, float *value, { *value = (float)wxStrtod(s, NULL); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file ) @@ -106,9 +106,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, long *value, { *value = wxStrtol(s, NULL, 10); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file ) @@ -119,8 +119,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c { *value = (int)wxStrtol(s, NULL, 10); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } -