]> git.saurik.com Git - wxWidgets.git/commitdiff
Reverted wxFileSystem support in wxLocale.
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 28 Mar 2010 15:41:41 +0000 (15:41 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 28 Mar 2010 15:41:41 +0000 (15:41 +0000)
The implementation was broken in numerous ways. URLs were corrupted in
search paths thanks to use of wxFileName for normalization. Lookup of
catalogs was broken, because ":" in URLs were interpreted as path
separators. Asserts occured because filenames were (incorrectly!)
interpreted as URLs.

Will replace with proper implementation.

See #8793, #11491.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/intl.cpp

index 0092794978ca3ca824f620c984caeb39b00e372a..1c4d35f3554a7e4443dcd7d96b5940545ef36682 100644 (file)
@@ -545,7 +545,6 @@ All:
 - Cleaned up wxURI and made it Unicode-friendly.
 - Add support for wxExecute(wxEXEC_ASYNC) in wxBase (Lukasz Michalski).
 - Added wxXLocale class and xlocale-like functions using it.
-- Allow loading message catalogs from wxFileSystem (Axel Gembe).
 - Added wxMessageQueue class for inter-thread communications
 - Use UTF-8 for Unicode data in wxIPC classes (Anders Larsen)
 - Added support for user-defined types to wxConfig (Marcin Wojdyr).
index 004aadbe808dfcd18890127aa74f5705e3386cc4..0638da4e9548aa915e2ef1510706762647989cad 100644 (file)
@@ -70,7 +70,6 @@
 #include "wx/apptrait.h"
 #include "wx/stdpaths.h"
 #include "wx/hashset.h"
-#include "wx/filesys.h"
 
 #if defined(__WXOSX__)
     #include "wx/osx/core/cfref.h"
@@ -1190,12 +1189,7 @@ bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName,
     fn.SetExt(wxS("mo"));
 
     wxString strFullName;
-#if wxUSE_FILESYSTEM
-    wxFileSystem fileSys;
-    if ( !fileSys.FindFileInPath(&strFullName, searchPath, fn.GetFullPath()) )
-#else // !wxUSE_FILESYSTEM
     if ( !wxFindFileInPath(&strFullName, searchPath, fn.GetFullPath()) )
-#endif // wxUSE_FILESYSTEM/!wxUSE_FILESYSTEM
     {
         wxLogVerbose(_("catalog file for domain '%s' not found."), szName);
         wxLogTrace(TRACE_I18N, wxS("Catalog \"%s.mo\" not found"), szName);
@@ -1206,22 +1200,6 @@ bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName,
     wxLogVerbose(_("using catalog '%s' from '%s'."), szName, strFullName.c_str());
     wxLogTrace(TRACE_I18N, wxS("Using catalog \"%s\"."), strFullName.c_str());
 
-#if wxUSE_FILESYSTEM
-    wxFSFile * const fileMsg = fileSys.OpenFile(strFullName);
-    if ( !fileMsg )
-        return false;
-
-    wxInputStream *fileStream = fileMsg->GetStream();
-    m_data.SetDataLen(0);
-
-    static const size_t chunkSize = 4096;
-    while ( !fileStream->Eof() ) {
-        fileStream->Read(m_data.GetAppendBuf(chunkSize), chunkSize);
-        m_data.UngetAppendBuf(fileStream->LastRead());
-    }
-
-    delete fileMsg;
-#else // !wxUSE_FILESYSTEM
     wxFile fileMsg(strFullName);
     if ( !fileMsg.IsOpened() )
         return false;
@@ -1239,7 +1217,6 @@ bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName,
         return false;
 
     m_data.UngetWriteBuf(nSize);
-#endif // wxUSE_FILESYSTEM/!wxUSE_FILESYSTEM
 
 
     // examine header