projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bring through upstream version tagged PKGCONF_0_20.
[wxWidgets.git]
/
src
/
unix
/
mimetype.cpp
diff --git
a/src/unix/mimetype.cpp
b/src/unix/mimetype.cpp
index c39e2545456ed9d53989e86b7f3759c6d58f6e16..e2e68bd09a8ffdabfa24dda23e0aeb15e3c4f2f6 100644
(file)
--- a/
src/unix/mimetype.cpp
+++ b/
src/unix/mimetype.cpp
@@
-38,28
+38,30
@@
#if wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE
#if wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE
+#include "wx/unix/mimetype.h"
+
#ifndef WX_PRECOMP
#ifndef WX_PRECOMP
+ #include "wx/dynarray.h"
#include "wx/string.h"
#include "wx/string.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/utils.h"
#endif
#endif
-#include "wx/log.h"
#include "wx/file.h"
#include "wx/file.h"
-#include "wx/intl.h"
-#include "wx/dynarray.h"
#include "wx/confbase.h"
#include "wx/ffile.h"
#include "wx/textfile.h"
#include "wx/dir.h"
#include "wx/confbase.h"
#include "wx/ffile.h"
#include "wx/textfile.h"
#include "wx/dir.h"
-#include "wx/utils.h"
#include "wx/tokenzr.h"
#include "wx/iconloc.h"
#include "wx/filename.h"
#include "wx/tokenzr.h"
#include "wx/iconloc.h"
#include "wx/filename.h"
-#i
nclude "wx/unix/mimetype.h"
-
-// Not GUI dependent
-#
include "wx/gtk/gnome/gvfs.h"
+#i
f wxUSE_LIBGNOMEVFS
+ // Not GUI dependent
+ #include "wx/gtk/gnome/gvfs.h"
+#
endif
// other standard headers
#include <ctype.h>
// other standard headers
#include <ctype.h>
@@
-278,7
+280,7
@@
void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename,
{
wxTextFile textfile(filename);
#if defined(__WXGTK20__) && wxUSE_UNICODE
{
wxTextFile textfile(filename);
#if defined(__WXGTK20__) && wxUSE_UNICODE
- if ( !textfile.Open(wx
ConvUTF8
) )
+ if ( !textfile.Open(wx
MBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_OCTAL)
) )
#else
if ( !textfile.Open() )
#endif
#else
if ( !textfile.Open() )
#endif
@@
-1432,7
+1434,7
@@
bool wxMimeTypesManagerImpl::WriteToMimeTypes(int index, bool delete_index)
nIndex = file.pIndexOf(wxT("#--Netscape"));
if (nIndex != wxNOT_FOUND)
{
nIndex = file.pIndexOf(wxT("#--Netscape"));
if (nIndex != wxNOT_FOUND)
{
- wx
ASSERT_MSG(false,wxT("Error in .mime.types \nTrying to mix Netscape and Metamail formats\nFile not modiif
ed"));
+ wx
FAIL_MSG(wxT("Error in .mime.types\nTrying to mix Netscape and Metamail formats\nFile not modifi
ed"));
return false;
}
return false;
}
@@
-1499,7
+1501,7
@@
bool wxMimeTypesManagerImpl::WriteToNSMimeTypes(int index, bool delete_index)
// metamail entreies
if (file.GetLineCount() > 0)
{
// metamail entreies
if (file.GetLineCount() > 0)
{
- wx
ASSERT_MSG(false,
wxT(".mime.types File not in Netscape format\nNo entries written to\n.mime.types or to .mailcap"));
+ wx
FAIL_MSG(
wxT(".mime.types File not in Netscape format\nNo entries written to\n.mime.types or to .mailcap"));
return false;
}
return false;
}
@@
-2641,6
+2643,8
@@
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft)
{
bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft)
{
+ InitIfNeeded();
+
wxArrayString sMimeTypes;
ft->GetMimeTypes(sMimeTypes);
wxArrayString sMimeTypes;
ft->GetMimeTypes(sMimeTypes);