merged 2.2 branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -117,7 +117,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_DDE
|
||||
#if wxUSE_IPC
|
||||
// look whether we must issue some DDE requests to the application
|
||||
// (and not just launch it)
|
||||
strKey += _T("\\DDEExec");
|
||||
@@ -141,7 +141,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
|
||||
<< _T('#') << ddeCommand;
|
||||
}
|
||||
else
|
||||
#endif // wxUSE_DDE
|
||||
#endif // wxUSE_IPC
|
||||
if ( !foundFilename ) {
|
||||
// we didn't find any '%1' - the application doesn't know which
|
||||
// file to open (note that we only do it if there is no DDEExec
|
||||
@@ -227,27 +227,23 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
|
||||
// suppress possible error messages
|
||||
wxLogNull nolog;
|
||||
wxRegKey key(wxRegKey::HKCR, wxT(".") + m_ext);
|
||||
if ( key.Open() && key.QueryValue(wxT("Content Type"), *mimeType) ) {
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return key.Open() && key.QueryValue(wxT("Content Type"), *mimeType);
|
||||
}
|
||||
|
||||
|
||||
bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
|
||||
{
|
||||
wxString s;
|
||||
|
||||
if (GetMimeType(&s))
|
||||
|
||||
if ( !GetMimeType(&s) )
|
||||
{
|
||||
mimeTypes.Clear();
|
||||
mimeTypes.Add(s);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mimeTypes.Clear();
|
||||
mimeTypes.Add(s);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -378,18 +374,16 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
|
||||
}
|
||||
}
|
||||
|
||||
if ( knownExtension )
|
||||
{
|
||||
wxFileType *fileType = new wxFileType;
|
||||
fileType->m_impl->Init(wxEmptyString, ext);
|
||||
|
||||
return fileType;
|
||||
}
|
||||
else
|
||||
if ( !knownExtension )
|
||||
{
|
||||
// unknown extension
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxFileType *fileType = new wxFileType;
|
||||
fileType->m_impl->Init(wxEmptyString, ext);
|
||||
|
||||
return fileType;
|
||||
}
|
||||
|
||||
// MIME type -> extension -> file type
|
||||
|
Reference in New Issue
Block a user