attempts to fix wxMimeTypesManager mess: many bugs (entries priority, memory leaks, ...) fixed, but probably even more left

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-06-10 15:59:34 +00:00
parent 1ec3a9848a
commit 678ebfcdae
2 changed files with 561 additions and 491 deletions

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: unix/mimetype.h // Name: wx/unix/mimetype.h
// Purpose: classes and functions to manage MIME types // Purpose: classes and functions to manage MIME types
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
@ -20,9 +20,9 @@
#if (wxUSE_FILE && wxUSE_TEXTFILE) #if (wxUSE_FILE && wxUSE_TEXTFILE)
class wxMimeArrayString; class wxMimeTypeCommands;
WX_DEFINE_ARRAY(wxMimeArrayString *, wxArrayTypeEntries); WX_DEFINE_ARRAY(wxMimeTypeCommands *, wxMimeCommandsArray);
// this is the real wxMimeTypesManager for Unix // this is the real wxMimeTypesManager for Unix
class WXDLLEXPORT wxMimeTypesManagerImpl class WXDLLEXPORT wxMimeTypesManagerImpl
@ -86,7 +86,7 @@ private:
m_aIcons; // Icon filenames m_aIcons; // Icon filenames
// verb=command pairs for this file type // verb=command pairs for this file type
wxArrayTypeEntries m_aEntries; wxMimeCommandsArray m_aEntries;
// are we initialized? // are we initialized?
bool m_initialized; bool m_initialized;
@ -130,18 +130,22 @@ private:
bool WriteToMimeTypes (int index, bool delete_index); bool WriteToMimeTypes (int index, bool delete_index);
bool WriteToNSMimeTypes (int index, bool delete_index); bool WriteToNSMimeTypes (int index, bool delete_index);
// ReadMailcap() helper
bool ProcessOtherMailcapField(struct MailcapLineData& data,
const wxString& curField);
// functions used to do associations // functions used to do associations
int AddToMimeData(const wxString& strType, int AddToMimeData(const wxString& strType,
const wxString& strIcon, const wxString& strIcon,
wxMimeArrayString *entry, wxMimeTypeCommands *entry,
const wxArrayString& strExtensions, const wxArrayString& strExtensions,
const wxString& strDesc, const wxString& strDesc,
bool replaceExisting = TRUE); bool replaceExisting = TRUE);
bool DoAssociation(const wxString& strType, bool DoAssociation(const wxString& strType,
const wxString& strIcon, const wxString& strIcon,
wxMimeArrayString *entry, wxMimeTypeCommands *entry,
const wxArrayString& strExtensions, const wxArrayString& strExtensions,
const wxString& strDesc); const wxString& strDesc);

File diff suppressed because it is too large Load Diff