X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90a683695bfd22da80bb12d50d6f3666f38e903a..1ff301c4eb31ca22a735dbc452d3eb11e276dfbe:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 4dc91cb910..f8d725c523 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -82,10 +82,7 @@ #include "wx/config.h" // for wxExpandEnvVars #include "wx/utils.h" #include "wx/file.h" - -#if wxUSE_DYNAMIC_LOADER || wxUSE_DYNLIB_CLASS -#include "wx/dynlib.h" -#endif +//#include "wx/dynlib.h" // see GetLongPath below, code disabled. // For GetShort/LongPathName #ifdef __WIN32__ @@ -101,6 +98,10 @@ #include #endif +#ifdef __DJGPP__ +#include +#endif + #ifdef __MWERKS__ #include #include @@ -234,6 +235,15 @@ void wxFileName::Assign(const wxString& volume, const wxString& name, const wxString& ext, wxPathFormat format ) +{ + SetPath( path, format ); + + m_volume = volume; + m_ext = ext; + m_name = name; +} + +void wxFileName::SetPath( const wxString &path, wxPathFormat format ) { wxPathFormat my_format = GetFormat( format ); wxString my_path = path; @@ -300,10 +310,10 @@ void wxFileName::Assign(const wxString& volume, } } } - - m_volume = volume; - m_ext = ext; - m_name = name; + else + { + m_relative = TRUE; + } } void wxFileName::Assign(const wxString& fullpath, @@ -1255,19 +1265,17 @@ wxString wxFileName::GetLongPath() const if ( !s_triedToLoad ) { s_triedToLoad = TRUE; - wxDllType dllKernel = wxDllLoader::LoadLibrary(_T("kernel32")); - if ( dllKernel ) + wxDynamicLibrary dllKernel(_T("kernel32")); + if ( dllKernel.IsLoaded() ) { // may succeed or fail depending on the Windows version static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL; #ifdef _UNICODE - s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameW")); + s_pfnGetLongPathName = (GET_LONG_PATH_NAME) dllKernel.GetSymbol(_T("GetLongPathNameW")); #else - s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameA")); + s_pfnGetLongPathName = (GET_LONG_PATH_NAME) dllKernel.GetSymbol(_T("GetLongPathNameA")); #endif - wxDllLoader::UnloadLibrary(dllKernel); - if ( s_pfnGetLongPathName ) { DWORD dwSize = (*s_pfnGetLongPathName)(path, NULL, 0);