Fix for broken wxMSWUniv after wxLaunchDefaultBrowser introduction. Source cleaning (should not happen in new code).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -539,7 +539,8 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
|||||||
if(wxURI(url).IsReference())
|
if(wxURI(url).IsReference())
|
||||||
finalurl = wxString(wxT("http://")) + url;
|
finalurl = wxString(wxT("http://")) + url;
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
|
||||||
|
|
||||||
wxString command;
|
wxString command;
|
||||||
|
|
||||||
// ShellExecute() always opens in the same window,
|
// ShellExecute() always opens in the same window,
|
||||||
@@ -560,10 +561,10 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
|||||||
// this is a bit naive but should work as -1 can't appear
|
// this is a bit naive but should work as -1 can't appear
|
||||||
// elsewhere in the DDE topic, normally
|
// elsewhere in the DDE topic, normally
|
||||||
if ( ddeCmd.Replace(wxT("-1"), wxT("0"),
|
if ( ddeCmd.Replace(wxT("-1"), wxT("0"),
|
||||||
FALSE /* only first occurence */) == 1 )
|
false /* only first occurence */) == 1 )
|
||||||
{
|
{
|
||||||
// and also replace the parameters
|
// and also replace the parameters
|
||||||
if ( ddeCmd.Replace(wxT("%1"), url, FALSE) == 1 )
|
if ( ddeCmd.Replace(wxT("%1"), url, false) == 1 )
|
||||||
{
|
{
|
||||||
// magic incantation understood by wxMSW
|
// magic incantation understood by wxMSW
|
||||||
command << wxT("WX_DDE#")
|
command << wxT("WX_DDE#")
|
||||||
@@ -633,11 +634,10 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#elif wxUSE_MIMETYPE
|
||||||
#if wxUSE_MIMETYPE
|
|
||||||
// Non-windows way
|
// Non-windows way
|
||||||
wxFileType *ft =
|
wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension (_T("html"));
|
||||||
wxTheMimeTypesManager->GetFileTypeFromExtension (_T("html"));
|
|
||||||
if (!ft)
|
if (!ft)
|
||||||
{
|
{
|
||||||
wxLogError(_T("No default application can open .html extension"));
|
wxLogError(_T("No default application can open .html extension"));
|
||||||
@@ -648,10 +648,7 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
|||||||
ft->GetMimeType(&mt);
|
ft->GetMimeType(&mt);
|
||||||
|
|
||||||
wxString cmd;
|
wxString cmd;
|
||||||
bool ok =
|
bool ok = ft->GetOpenCommand (&cmd, wxFileType::MessageParameters(finalurl));
|
||||||
ft->GetOpenCommand (&cmd,
|
|
||||||
wxFileType::MessageParameters (finalurl.c_str(),
|
|
||||||
_T("")));
|
|
||||||
delete ft;
|
delete ft;
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
@@ -664,9 +661,10 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
#else
|
|
||||||
|
#else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
#endif //!wxUSE_MIMETYPE
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user