projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bad merge...
[wxWidgets.git]
/
src
/
unix
/
mimetype.cpp
diff --git
a/src/unix/mimetype.cpp
b/src/unix/mimetype.cpp
index c54a12b68ae50d64523ff281343b9613f32455b8..3015edf5f7a8b71e96c97aedc8ebca4501ee6f2d 100644
(file)
--- a/
src/unix/mimetype.cpp
+++ b/
src/unix/mimetype.cpp
@@
-40,7
+40,7
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "mimetype.h"
#endif
#pragma implementation "mimetype.h"
#endif
@@
-59,10
+59,6
@@
#ifndef WX_PRECOMP
#include "wx/string.h"
#ifndef WX_PRECOMP
#include "wx/string.h"
- #if wxUSE_GUI
- #include "wx/icon.h"
-
- #endif
#endif //WX_PRECOMP
#endif //WX_PRECOMP
@@
-77,6
+73,7
@@
#include "wx/dir.h"
#include "wx/utils.h"
#include "wx/tokenzr.h"
#include "wx/dir.h"
#include "wx/utils.h"
#include "wx/tokenzr.h"
+#include "wx/iconloc.h"
#include "wx/unix/mimetype.h"
#include "wx/unix/mimetype.h"
@@
-643,14
+640,12
@@
void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename,
void wxMimeTypesManagerImpl::LoadGnomeMimeTypesFromMimeFile(const wxString& filename)
{
wxTextFile textfile(filename);
void wxMimeTypesManagerImpl::LoadGnomeMimeTypesFromMimeFile(const wxString& filename)
{
wxTextFile textfile(filename);
-#if defined(__WXGTK20__) && wxUSE_UNICODE
- if ( !textfile.Open( wxConvUTF8) )
-#else
if ( !textfile.Open() )
if ( !textfile.Open() )
-#endif
return;
return;
- wxLogTrace(TRACE_MIME, wxT("--- Opened Gnome file %s ---"),
- filename.c_str());
+
+ wxLogTrace(TRACE_MIME,
+ wxT("--- Opened Gnome file %s ---"),
+ filename.c_str());
// values for the entry being parsed
wxString curMimeType, curExtList;
// values for the entry being parsed
wxString curMimeType, curExtList;
@@
-679,8
+674,9
@@
void wxMimeTypesManagerImpl::LoadGnomeMimeTypesFromMimeFile(const wxString& file
// end of the entry
if ( !!curMimeType && !!curExtList )
{
// end of the entry
if ( !!curMimeType && !!curExtList )
{
- wxLogTrace(TRACE_MIME, wxT("--- At end of Gnome file finding mimetype %s ---"),
- curMimeType.c_str());
+ wxLogTrace(TRACE_MIME,
+ wxT("--- At end of Gnome file finding mimetype %s ---"),
+ curMimeType.c_str());
AddMimeTypeInfo(curMimeType, curExtList, wxEmptyString);
}
AddMimeTypeInfo(curMimeType, curExtList, wxEmptyString);
}
@@
-702,20
+698,20
@@
void wxMimeTypesManagerImpl::LoadGnomeMimeTypesFromMimeFile(const wxString& file
// this is a field=value ling
pc++; // skip leading TAB
// this is a field=value ling
pc++; // skip leading TAB
- static const int lenField =
4; // strlen("ext:
")
- if ( wxStrncmp(pc, wxT("ext:"), lenField) == 0 )
+ static const int lenField =
5; // strlen("ext:
")
+ if ( wxStrncmp(pc, wxT("ext:
"), lenField) == 0 )
{
{
- // skip ' ' which follows and take everything left until the end
- // of line
- curExtList = pc + lenField + 1;
+ // skip it and take everything left until the end of line
+ curExtList = pc + lenField;
}
//else: some other field, we don't care
}
else
{
// this is the start of the new section
}
//else: some other field, we don't care
}
else
{
// this is the start of the new section
- wxLogTrace(TRACE_MIME, wxT("--- In Gnome file finding mimetype %s ---"),
- curMimeType.c_str());
+ wxLogTrace(TRACE_MIME,
+ wxT("--- In Gnome file finding mimetype %s ---"),
+ curMimeType.c_str());
if (! curMimeType.empty())
AddMimeTypeInfo(curMimeType, curExtList, wxEmptyString);
if (! curMimeType.empty())
AddMimeTypeInfo(curMimeType, curExtList, wxEmptyString);
@@
-1820,7
+1816,8
@@
int wxMimeTypesManagerImpl::AddToMimeData(const wxString& strType,
m_aEntries.Add(entry ? entry : new wxMimeTypeCommands);
// change nIndex so we can use it below to add the extensions
m_aEntries.Add(entry ? entry : new wxMimeTypeCommands);
// change nIndex so we can use it below to add the extensions
- nIndex = m_aExtensions.Add(wxEmptyString);
+ m_aExtensions.Add(wxEmptyString);
+ nIndex = m_aExtensions.size() - 1;
m_aDescriptions.Add(strDesc);
}
m_aDescriptions.Add(strDesc);
}