]> git.saurik.com Git - wxWidgets.git/blob - src/osx/core/mimetype.cpp
6bfd38a8b933aadf2f4d5268945cc2e24fe4db4a
[wxWidgets.git] / src / osx / core / mimetype.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/core/mimetype.cpp
3 // Purpose: classes and functions to manage MIME types
4 // Author: Vadim Zeitlin, Stefan Csomor
5 // Modified by:
6 // Created: 23.09.98
7 // RCS-ID: $Id: mimetype.cpp 54734 2008-07-21 01:33:51Z VZ $
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence (part of wxExtra library)
10 /////////////////////////////////////////////////////////////////////////////
11
12 // for compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
14
15 #ifdef __BORLANDC__
16 #pragma hdrstop
17 #endif
18
19 #if wxUSE_MIMETYPE && wxUSE_FILE
20
21 #include "wx/unix/mimetype.h"
22
23 #ifndef WX_PRECOMP
24 #include "wx/dynarray.h"
25 #include "wx/string.h"
26 #include "wx/intl.h"
27 #include "wx/log.h"
28 #include "wx/utils.h"
29 #endif
30
31 #include "wx/file.h"
32 #include "wx/confbase.h"
33
34 #include "wx/ffile.h"
35 #include "wx/dir.h"
36 #include "wx/tokenzr.h"
37 #include "wx/iconloc.h"
38 #include "wx/filename.h"
39 #include "wx/app.h"
40 #include "wx/apptrait.h"
41
42 // other standard headers
43 #include <ctype.h>
44
45 // ----------------------------------------------------------------------------
46 // constants
47 // ----------------------------------------------------------------------------
48
49 // MIME code tracing mask
50 #define TRACE_MIME wxT("mime")
51
52 // ----------------------------------------------------------------------------
53 // wxFileTypeImpl (Unix)
54 // ----------------------------------------------------------------------------
55
56 wxString wxFileTypeImpl::GetExpandedCommand(const wxString & verb, const wxFileType::MessageParameters& params) const
57 {
58 wxString sTmp;
59 size_t i = 0;
60 while ( (i < m_index.GetCount() ) && sTmp.empty() )
61 {
62 sTmp = m_manager->GetCommand( verb, m_index[i] );
63 i++;
64 }
65
66 return wxFileType::ExpandCommand(sTmp, params);
67 }
68
69 bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
70 {
71 wxString sTmp;
72 size_t i = 0;
73 while ( (i < m_index.GetCount() ) && sTmp.empty() )
74 {
75 sTmp = m_manager->m_aIcons[m_index[i]];
76 i++;
77 }
78
79 if ( sTmp.empty() )
80 return false;
81
82 if ( iconLoc )
83 {
84 iconLoc->SetFileName(sTmp);
85 }
86
87 return true;
88 }
89
90 bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
91 {
92 mimeTypes.Clear();
93 size_t nCount = m_index.GetCount();
94 for (size_t i = 0; i < nCount; i++)
95 mimeTypes.Add(m_manager->m_aTypes[m_index[i]]);
96
97 return true;
98 }
99
100 size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs,
101 wxArrayString *commands,
102 const wxFileType::MessageParameters& params) const
103 {
104 wxString vrb, cmd, sTmp;
105 size_t count = 0;
106 wxMimeTypeCommands * sPairs;
107
108 // verbs and commands have been cleared already in mimecmn.cpp...
109 // if we find no entries in the exact match, try the inexact match
110 for (size_t n = 0; ((count == 0) && (n < m_index.GetCount())); n++)
111 {
112 // list of verb = command pairs for this mimetype
113 sPairs = m_manager->m_aEntries [m_index[n]];
114 size_t i;
115 for ( i = 0; i < sPairs->GetCount(); i++ )
116 {
117 vrb = sPairs->GetVerb(i);
118 // some gnome entries have "." inside
119 vrb = vrb.AfterLast(wxT('.'));
120 cmd = sPairs->GetCmd(i);
121 if (! cmd.empty() )
122 {
123 cmd = wxFileType::ExpandCommand(cmd, params);
124 count++;
125 if ( vrb.IsSameAs(wxT("open")))
126 {
127 if ( verbs )
128 verbs->Insert(vrb, 0u);
129 if ( commands )
130 commands ->Insert(cmd, 0u);
131 }
132 else
133 {
134 if ( verbs )
135 verbs->Add(vrb);
136 if ( commands )
137 commands->Add(cmd);
138 }
139 }
140 }
141 }
142
143 return count;
144 }
145
146 bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
147 {
148 const wxString strExtensions = m_manager->GetExtension(m_index[0]);
149 extensions.Empty();
150
151 // one extension in the space or comma-delimited list
152 wxString strExt;
153 wxString::const_iterator end = strExtensions.end();
154 for ( wxString::const_iterator p = strExtensions.begin(); /* nothing */; ++p )
155 {
156 if ( p == end || *p == wxT(' ') || *p == wxT(',') )
157 {
158 if ( !strExt.empty() )
159 {
160 extensions.Add(strExt);
161 strExt.Empty();
162 }
163 //else: repeated spaces
164 // (shouldn't happen, but it's not that important if it does happen)
165
166 if ( p == end )
167 break;
168 }
169 else if ( *p == wxT('.') )
170 {
171 // remove the dot from extension (but only if it's the first char)
172 if ( !strExt.empty() )
173 {
174 strExt += wxT('.');
175 }
176 //else: no, don't append it
177 }
178 else
179 {
180 strExt += *p;
181 }
182 }
183
184 return true;
185 }
186
187 // set an arbitrary command:
188 // could adjust the code to ask confirmation if it already exists and
189 // overwriteprompt is true, but this is currently ignored as *Associate* has
190 // no overwrite prompt
191 bool
192 wxFileTypeImpl::SetCommand(const wxString& cmd,
193 const wxString& verb,
194 bool WXUNUSED(overwriteprompt))
195 {
196 wxArrayString strExtensions;
197 wxString strDesc, strIcon;
198
199 wxArrayString strTypes;
200 GetMimeTypes(strTypes);
201 if ( strTypes.IsEmpty() )
202 return false;
203
204 wxMimeTypeCommands *entry = new wxMimeTypeCommands();
205 entry->Add(verb + wxT("=") + cmd + wxT(" %s "));
206
207 bool ok = false;
208 size_t nCount = strTypes.GetCount();
209 for ( size_t i = 0; i < nCount; i++ )
210 {
211 if ( m_manager->DoAssociation
212 (
213 strTypes[i],
214 strIcon,
215 entry,
216 strExtensions,
217 strDesc
218 ) )
219 {
220 // DoAssociation() took ownership of entry, don't delete it below
221 ok = true;
222 }
223 }
224
225 if ( !ok )
226 delete entry;
227
228 return ok;
229 }
230
231 // ignore index on the grounds that we only have one icon in a Unix file
232 bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int WXUNUSED(index))
233 {
234 if (strIcon.empty())
235 return false;
236
237 wxArrayString strExtensions;
238 wxString strDesc;
239
240 wxArrayString strTypes;
241 GetMimeTypes(strTypes);
242 if ( strTypes.IsEmpty() )
243 return false;
244
245 wxMimeTypeCommands *entry = new wxMimeTypeCommands();
246 bool ok = false;
247 size_t nCount = strTypes.GetCount();
248 for ( size_t i = 0; i < nCount; i++ )
249 {
250 if ( m_manager->DoAssociation
251 (
252 strTypes[i],
253 strIcon,
254 entry,
255 strExtensions,
256 strDesc
257 ) )
258 {
259 // we don't need to free entry now, DoAssociation() took ownership
260 // of it
261 ok = true;
262 }
263 }
264
265 if ( !ok )
266 delete entry;
267
268 return ok;
269 }
270
271 // ----------------------------------------------------------------------------
272 // wxMimeTypesManagerImpl (Unix)
273 // ----------------------------------------------------------------------------
274
275 wxMimeTypesManagerImpl::wxMimeTypesManagerImpl()
276 {
277 m_initialized = false;
278 }
279
280 void wxMimeTypesManagerImpl::InitIfNeeded()
281 {
282 if ( !m_initialized )
283 {
284 // set the flag first to prevent recursion
285 m_initialized = true;
286
287 wxString wm = wxTheApp->GetTraits()->GetDesktopEnvironment();
288
289 if (wm == wxT("KDE"))
290 Initialize( wxMAILCAP_KDE );
291 else if (wm == wxT("GNOME"))
292 Initialize( wxMAILCAP_GNOME );
293 else
294 Initialize();
295 }
296 }
297
298
299
300 // read system and user mailcaps and other files
301 void wxMimeTypesManagerImpl::Initialize(int WXUNUSED(mailcapStyles),
302 const wxString& WXUNUSED(sExtraDir))
303 {
304 #ifdef __VMS
305 // XDG tables are never installed on OpenVMS
306 return;
307 #endif
308 #if 0
309 // Read MIME type - extension associations
310 LoadXDGGlobs( "/usr/share/mime/globs" );
311 LoadXDGGlobs( "/usr/local/share/mime/globs" );
312
313 // Load desktop files for XDG, and then override them with the defaults.
314 // We will override them one desktop file at a time, rather
315 // than one mime type at a time, but it should be a reasonable
316 // heuristic.
317 {
318 wxString xdgDataHome = wxGetenv("XDG_DATA_HOME");
319 if ( xdgDataHome.empty() )
320 xdgDataHome = wxGetHomeDir() + "/.local/share";
321 wxString xdgDataDirs = wxGetenv("XDG_DATA_DIRS");
322 if ( xdgDataDirs.empty() )
323 {
324 xdgDataDirs = "/usr/local/share:/usr/share";
325 if (mailcapStyles & wxMAILCAP_GNOME)
326 xdgDataDirs += ":/usr/share/gnome:/opt/gnome/share";
327 if (mailcapStyles & wxMAILCAP_KDE)
328 xdgDataDirs += ":/usr/share/kde3:/opt/kde3/share";
329 }
330 if ( !sExtraDir.empty() )
331 {
332 xdgDataDirs += ':';
333 xdgDataDirs += sExtraDir;
334 }
335
336 wxArrayString dirs;
337 wxStringTokenizer tokenizer(xdgDataDirs, ":");
338 while ( tokenizer.HasMoreTokens() )
339 {
340 wxString p = tokenizer.GetNextToken();
341 dirs.Add(p);
342 }
343 dirs.insert(dirs.begin(), xdgDataHome);
344
345 wxString defaultsList;
346 size_t i;
347 for (i = 0; i < dirs.GetCount(); i++)
348 {
349 wxString f = dirs[i];
350 if (f.Last() != '/') f += '/';
351 f += "applications/defaults.list";
352 if (wxFileExists(f))
353 {
354 defaultsList = f;
355 break;
356 }
357 }
358
359 // Load application files and associate them to corresponding mime types.
360 size_t nDirs = dirs.GetCount();
361 for (size_t nDir = 0; nDir < nDirs; nDir++)
362 {
363 wxString dirStr = dirs[nDir];
364 if (dirStr.Last() != '/') dirStr += '/';
365 dirStr += "applications";
366 LoadXDGAppsFilesFromDir(dirStr);
367 }
368
369 if (!defaultsList.IsEmpty())
370 {
371 wxArrayString deskTopFilesSeen;
372
373 wxMimeTextFile textfile(defaultsList);
374 if ( textfile.Open() )
375 {
376 int nIndex = textfile.pIndexOf( wxT("[Default Applications]") );
377 if (nIndex != wxNOT_FOUND)
378 {
379 for (i = nIndex+1; i < textfile.GetLineCount(); i++)
380 {
381 if (textfile.GetLine(i).Find(wxT("=")) != wxNOT_FOUND)
382 {
383 wxString mimeType = textfile.GetVerb(i);
384 wxString desktopFile = textfile.GetCmd(i);
385
386 if (deskTopFilesSeen.Index(desktopFile) == wxNOT_FOUND)
387 {
388 deskTopFilesSeen.Add(desktopFile);
389 size_t j;
390 for (j = 0; j < dirs.GetCount(); j++)
391 {
392 wxString desktopPath = dirs[j];
393 if (desktopPath.Last() != '/') desktopPath += '/';
394 desktopPath += "applications/";
395 desktopPath += desktopFile;
396
397 if (wxFileExists(desktopPath))
398 LoadXDGApp(desktopPath);
399 }
400 }
401 }
402 }
403 }
404 }
405 }
406 }
407 #endif
408 }
409
410 // clear data so you can read another group of WM files
411 void wxMimeTypesManagerImpl::ClearData()
412 {
413 m_aTypes.Clear();
414 m_aIcons.Clear();
415 m_aExtensions.Clear();
416 m_aDescriptions.Clear();
417
418 WX_CLEAR_ARRAY(m_aEntries);
419 m_aEntries.Empty();
420 }
421
422 wxMimeTypesManagerImpl::~wxMimeTypesManagerImpl()
423 {
424 ClearData();
425 }
426
427 wxFileType * wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
428 {
429 InitIfNeeded();
430
431 wxString strType = ftInfo.GetMimeType();
432 wxString strDesc = ftInfo.GetDescription();
433 wxString strIcon = ftInfo.GetIconFile();
434
435 wxMimeTypeCommands *entry = new wxMimeTypeCommands();
436
437 if ( ! ftInfo.GetOpenCommand().empty())
438 entry->Add(wxT("open=") + ftInfo.GetOpenCommand() + wxT(" %s "));
439 if ( ! ftInfo.GetPrintCommand().empty())
440 entry->Add(wxT("print=") + ftInfo.GetPrintCommand() + wxT(" %s "));
441
442 // now find where these extensions are in the data store and remove them
443 wxArrayString sA_Exts = ftInfo.GetExtensions();
444 wxString sExt, sExtStore;
445 size_t i, nIndex;
446 size_t nExtCount = sA_Exts.GetCount();
447 for (i=0; i < nExtCount; i++)
448 {
449 sExt = sA_Exts.Item(i);
450
451 // clean up to just a space before and after
452 sExt.Trim().Trim(false);
453 sExt = wxT(' ') + sExt + wxT(' ');
454 size_t nCount = m_aExtensions.GetCount();
455 for (nIndex = 0; nIndex < nCount; nIndex++)
456 {
457 sExtStore = m_aExtensions.Item(nIndex);
458 if (sExtStore.Replace(sExt, wxT(" ") ) > 0)
459 m_aExtensions.Item(nIndex) = sExtStore;
460 }
461 }
462
463 if ( !DoAssociation(strType, strIcon, entry, sA_Exts, strDesc) )
464 return NULL;
465
466 return GetFileTypeFromMimeType(strType);
467 }
468
469 bool wxMimeTypesManagerImpl::DoAssociation(const wxString& strType,
470 const wxString& strIcon,
471 wxMimeTypeCommands *entry,
472 const wxArrayString& strExtensions,
473 const wxString& strDesc)
474 {
475 int nIndex = AddToMimeData(strType, strIcon, entry, strExtensions, strDesc, true);
476
477 if ( nIndex == wxNOT_FOUND )
478 return false;
479
480 return true;
481 }
482
483 int wxMimeTypesManagerImpl::AddToMimeData(const wxString& strType,
484 const wxString& strIcon,
485 wxMimeTypeCommands *entry,
486 const wxArrayString& strExtensions,
487 const wxString& strDesc,
488 bool replaceExisting)
489 {
490 InitIfNeeded();
491
492 // ensure mimetype is always lower case
493 wxString mimeType = strType.Lower();
494
495 // is this a known MIME type?
496 int nIndex = m_aTypes.Index(mimeType);
497 if ( nIndex == wxNOT_FOUND )
498 {
499 // new file type
500 m_aTypes.Add(mimeType);
501 m_aIcons.Add(strIcon);
502 m_aEntries.Add(entry ? entry : new wxMimeTypeCommands);
503
504 // change nIndex so we can use it below to add the extensions
505 m_aExtensions.Add(wxEmptyString);
506 nIndex = m_aExtensions.size() - 1;
507
508 m_aDescriptions.Add(strDesc);
509 }
510 else // yes, we already have it
511 {
512 if ( replaceExisting )
513 {
514 // if new description change it
515 if ( !strDesc.empty())
516 m_aDescriptions[nIndex] = strDesc;
517
518 // if new icon change it
519 if ( !strIcon.empty())
520 m_aIcons[nIndex] = strIcon;
521
522 if ( entry )
523 {
524 delete m_aEntries[nIndex];
525 m_aEntries[nIndex] = entry;
526 }
527 }
528 else // add data we don't already have ...
529 {
530 // if new description add only if none
531 if ( m_aDescriptions[nIndex].empty() )
532 m_aDescriptions[nIndex] = strDesc;
533
534 // if new icon and no existing icon
535 if ( m_aIcons[nIndex].empty() )
536 m_aIcons[nIndex] = strIcon;
537
538 // add any new entries...
539 if ( entry )
540 {
541 wxMimeTypeCommands *entryOld = m_aEntries[nIndex];
542
543 size_t count = entry->GetCount();
544 for ( size_t i = 0; i < count; i++ )
545 {
546 const wxString& verb = entry->GetVerb(i);
547 if ( !entryOld->HasVerb(verb) )
548 {
549 entryOld->AddOrReplaceVerb(verb, entry->GetCmd(i));
550 }
551 }
552
553 // as we don't store it anywhere, it won't be deleted later as
554 // usual -- do it immediately instead
555 delete entry;
556 }
557 }
558 }
559
560 // always add the extensions to this mimetype
561 wxString& exts = m_aExtensions[nIndex];
562
563 // add all extensions we don't have yet
564 wxString ext;
565 size_t count = strExtensions.GetCount();
566 for ( size_t i = 0; i < count; i++ )
567 {
568 ext = strExtensions[i];
569 ext += wxT(' ');
570
571 if ( exts.Find(ext) == wxNOT_FOUND )
572 {
573 exts += ext;
574 }
575 }
576
577 // check data integrity
578 wxASSERT( m_aTypes.GetCount() == m_aEntries.GetCount() &&
579 m_aTypes.GetCount() == m_aExtensions.GetCount() &&
580 m_aTypes.GetCount() == m_aIcons.GetCount() &&
581 m_aTypes.GetCount() == m_aDescriptions.GetCount() );
582
583 return nIndex;
584 }
585
586 wxFileType * wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
587 {
588 if (ext.empty() )
589 return NULL;
590
591 InitIfNeeded();
592
593 size_t count = m_aExtensions.GetCount();
594 for ( size_t n = 0; n < count; n++ )
595 {
596 wxStringTokenizer tk(m_aExtensions[n], wxT(' '));
597
598 while ( tk.HasMoreTokens() )
599 {
600 // consider extensions as not being case-sensitive
601 if ( tk.GetNextToken().IsSameAs(ext, false /* no case */) )
602 {
603 // found
604 wxFileType *fileType = new wxFileType;
605 fileType->m_impl->Init(this, n);
606
607 return fileType;
608 }
609 }
610 }
611
612 return NULL;
613 }
614
615 wxFileType * wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType)
616 {
617 InitIfNeeded();
618
619 wxFileType * fileType = NULL;
620 // mime types are not case-sensitive
621 wxString mimetype(mimeType);
622 mimetype.MakeLower();
623
624 // first look for an exact match
625 int index = m_aTypes.Index(mimetype);
626
627 if ( index != wxNOT_FOUND )
628 {
629 fileType = new wxFileType;
630 fileType->m_impl->Init(this, index);
631 }
632
633 // then try to find "text/*" as match for "text/plain" (for example)
634 // NB: if mimeType doesn't contain '/' at all, BeforeFirst() will return
635 // the whole string - ok.
636
637 index = wxNOT_FOUND;
638 wxString strCategory = mimetype.BeforeFirst(wxT('/'));
639
640 size_t nCount = m_aTypes.GetCount();
641 for ( size_t n = 0; n < nCount; n++ )
642 {
643 if ( (m_aTypes[n].BeforeFirst(wxT('/')) == strCategory ) &&
644 m_aTypes[n].AfterFirst(wxT('/')) == wxT("*") )
645 {
646 index = n;
647 break;
648 }
649 }
650
651 if ( index != wxNOT_FOUND )
652 {
653 // don't throw away fileType that was already found
654 if (!fileType)
655 fileType = new wxFileType;
656 fileType->m_impl->Init(this, index);
657 }
658
659 return fileType;
660 }
661
662 wxString wxMimeTypesManagerImpl::GetCommand(const wxString & verb, size_t nIndex) const
663 {
664 wxString command, testcmd, sV, sTmp;
665 sV = verb + wxT("=");
666
667 // list of verb = command pairs for this mimetype
668 wxMimeTypeCommands * sPairs = m_aEntries [nIndex];
669
670 size_t i;
671 size_t nCount = sPairs->GetCount();
672 for ( i = 0; i < nCount; i++ )
673 {
674 sTmp = sPairs->GetVerbCmd (i);
675 if ( sTmp.Contains(sV) )
676 command = sTmp.AfterFirst(wxT('='));
677 }
678
679 return command;
680 }
681
682 void wxMimeTypesManagerImpl::AddFallback(const wxFileTypeInfo& filetype)
683 {
684 InitIfNeeded();
685
686 wxString extensions;
687 const wxArrayString& exts = filetype.GetExtensions();
688 size_t nExts = exts.GetCount();
689 for ( size_t nExt = 0; nExt < nExts; nExt++ )
690 {
691 if ( nExt > 0 )
692 extensions += wxT(' ');
693
694 extensions += exts[nExt];
695 }
696
697 AddMimeTypeInfo(filetype.GetMimeType(),
698 extensions,
699 filetype.GetDescription());
700 }
701
702 void wxMimeTypesManagerImpl::AddMimeTypeInfo(const wxString& strMimeType,
703 const wxString& strExtensions,
704 const wxString& strDesc)
705 {
706 // reading mailcap may find image/* , while
707 // reading mime.types finds image/gif and no match is made
708 // this means all the get functions don't work fix this
709 wxString strIcon;
710 wxString sTmp = strExtensions;
711
712 wxArrayString sExts;
713 sTmp.Trim().Trim(false);
714
715 while (!sTmp.empty())
716 {
717 sExts.Add(sTmp.AfterLast(wxT(' ')));
718 sTmp = sTmp.BeforeLast(wxT(' '));
719 }
720
721 AddToMimeData(strMimeType, strIcon, NULL, sExts, strDesc, true);
722 }
723
724 size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
725 {
726 InitIfNeeded();
727
728 mimetypes.Empty();
729
730 size_t count = m_aTypes.GetCount();
731 for ( size_t n = 0; n < count; n++ )
732 {
733 // don't return template types from here (i.e. anything containg '*')
734 const wxString &type = m_aTypes[n];
735 if ( type.Find(wxT('*')) == wxNOT_FOUND )
736 {
737 mimetypes.Add(type);
738 }
739 }
740
741 return mimetypes.GetCount();
742 }
743
744 // ----------------------------------------------------------------------------
745 // writing to MIME type files
746 // ----------------------------------------------------------------------------
747
748 bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft)
749 {
750 InitIfNeeded();
751
752 wxArrayString sMimeTypes;
753 ft->GetMimeTypes(sMimeTypes);
754
755 size_t i;
756 size_t nCount = sMimeTypes.GetCount();
757 for (i = 0; i < nCount; i ++)
758 {
759 const wxString &sMime = sMimeTypes.Item(i);
760 int nIndex = m_aTypes.Index(sMime);
761 if ( nIndex == wxNOT_FOUND)
762 {
763 // error if we get here ??
764 return false;
765 }
766 else
767 {
768 m_aTypes.RemoveAt(nIndex);
769 m_aEntries.RemoveAt(nIndex);
770 m_aExtensions.RemoveAt(nIndex);
771 m_aDescriptions.RemoveAt(nIndex);
772 m_aIcons.RemoveAt(nIndex);
773 }
774 }
775 // check data integrity
776 wxASSERT( m_aTypes.GetCount() == m_aEntries.GetCount() &&
777 m_aTypes.GetCount() == m_aExtensions.GetCount() &&
778 m_aTypes.GetCount() == m_aIcons.GetCount() &&
779 m_aTypes.GetCount() == m_aDescriptions.GetCount() );
780
781 return true;
782 }
783
784 #endif
785 // wxUSE_MIMETYPE && wxUSE_FILE