Move URL<->filename conversion functions to wxFileName

This ensures that they are always available and can be used in
wxLaunchDefaultBrowser() in all build variants, whereas before this
function didn't handle file:// URLs correctly when the library was built
with wxUSE_FILESYSTEM==0.

Closes https://github.com/wxWidgets/wxWidgets/pull/1469

Closes #10414.
This commit is contained in:
oneeyeman1
2019-08-24 00:49:25 -05:00
committed by Vadim Zeitlin
parent 5e7b515349
commit 14bcf09924
8 changed files with 133 additions and 100 deletions

View File

@@ -180,7 +180,7 @@ void FileSystemTestCase::FileNameToUrlConversion()
wxString url1 = wxFileSystem::FileNameToURL(fn1);
CPPUNIT_ASSERT_EQUAL( d.expected, url1 );
CPPUNIT_ASSERT( fn1.SameAs(wxFileSystem::URLToFileName(url1)) );
CPPUNIT_ASSERT( fn1.SameAs(wxFileName::URLToFileName(url1)) );
}
}
@@ -196,7 +196,7 @@ void FileSystemTestCase::UnicodeFileNameToUrlConversion()
wxString url = wxFileSystem::FileNameToURL(filename);
CPPUNIT_ASSERT( filename.SameAs(wxFileSystem::URLToFileName(url)) );
CPPUNIT_ASSERT( filename.SameAs(wxFileName::URLToFileName(url)) );
}
#endif // wxUSE_FILESYSTEM