X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ab6fcee36cb08428581fbff5f5de81699c3e342..f2c88494b6978bee502f4c856ba9dc7e3b7c3954:/src/common/filesys.cpp diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 61ec083da4..405598e9c2 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -482,9 +482,23 @@ bool wxFileSystem::FindFileInPath(wxString *pStr, void wxFileSystem::AddHandler(wxFileSystemHandler *handler) { - m_Handlers.Append(handler); + // prepend the handler to the beginning of the list because handlers added + // last should have the highest priority to allow overriding them + m_Handlers.Insert((size_t)0, handler); } +bool wxFileSystem::HasHandlerForPath(const wxString &location) +{ + for ( wxList::compatibility_iterator node = m_Handlers.GetFirst(); + node; node = node->GetNext() ) + { + wxFileSystemHandler *h = (wxFileSystemHandler*) node->GetData(); + if (h->CanOpen(location)) + return true; + } + + return false; +} void wxFileSystem::CleanUpHandlers() {