// other standard headers
#include <ctype.h>
+#ifdef __VMS
+/* silence warnings for comparing unsigned int's <0 */
+# pragma message disable unscomzer
+#endif
+
// this is a class to extend wxArrayString...
class wxMimeArrayString : public wxArrayString
{
// a) for "brief" format:
// <mime type> <space separated list of extensions>
// b) for "expanded" format:
-// type=<mime type> \
-// desc="<description>" \
+// type=<mime type> BACKSLASH
+// desc="<description>" BACKSLASH
// exts="<comma separated list of extensions>"
//
+// (where BACKSLASH is a literal '\\' which we can't put here because cpp
+// misinterprets it)
+//
// We try to autodetect the format of mime.types: if a non-comment line starts
// with "type=" we assume the second format, otherwise the first one.
return wxFileType::ExpandCommand(sTmp, params);
}
-bool wxFileTypeImpl::GetIcon(wxIcon *icon, wxString *iconFile /*= NULL */,
- int *iconIndex /*= NULL*/) const
+bool wxFileTypeImpl::GetIcon(wxIcon *icon,
+ wxString *iconFile /*= NULL */,
+ int *iconIndex /*= NULL*/) const
{
+#if wxUSE_GUI
wxString sTmp;
size_t i = 0;
while ( (i < m_index.GetCount() ) && sTmp.IsEmpty() )
- {
- sTmp = m_manager->m_aIcons[m_index[i]];
- i ++;
- }
+ {
+ sTmp = m_manager->m_aIcons[m_index[i]];
+ i ++;
+ }
if ( sTmp.IsEmpty () ) return FALSE;
wxIcon icn;
icn = wxIcon(sTmp, wxBITMAP_TYPE_ANY);
if ( icn.Ok() )
- {
- *icon = icn;
- if (iconFile) *iconFile = sTmp;
- if (iconIndex) *iconIndex = 0;
- return TRUE;
- }
- return FALSE;
+ {
+ *icon = icn;
+ if (iconFile) *iconFile = sTmp;
+ if (iconIndex) *iconIndex = 0;
+ return TRUE;
}
+#endif // wxUSE_GUI
+
+ return FALSE;
+}
bool
const wxString& sExtraDir)
{
// read mimecap amd mime.types
- if ( (mailcapStyles & wxMAILCAP_NETSCAPE) || (mailcapStyles & wxMAILCAP_BASE) )
+ if ( (mailcapStyles & wxMAILCAP_NETSCAPE) ||
+ (mailcapStyles & wxMAILCAP_STANDARD) )
GetMimeInfo(sExtraDir);
// read GNOME tables
bool wxMimeTypesManagerImpl::WriteToMimeTypes (int index, bool delete_index)
{
// check we have the right manager
- if (! ( m_mailcapStylesInited & wxMAILCAP_BASE) )
+ if (! ( m_mailcapStylesInited & wxMAILCAP_STANDARD) )
return FALSE;
bool bTemp;
{
//check we have the right managers
if ( !( ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE) ||
- ( m_mailcapStylesInited & wxMAILCAP_BASE) ) )
+ ( m_mailcapStylesInited & wxMAILCAP_STANDARD) ) )
return FALSE;
bool bTemp;
sTmp = sTmp + wxT(";") + sCmd ; //includes wxT(" %s ");
// write it in the format that Netscape uses (default)
- if (! ( m_mailcapStylesInited & wxMAILCAP_BASE ) )
+ if (! ( m_mailcapStylesInited & wxMAILCAP_STANDARD ) )
{
if (! delete_index) file.InsertLine (sTmp, nIndex);
nIndex ++;
{
bool ok = TRUE;
- if ( m_mailcapStylesInited & wxMAILCAP_BASE )
+ if ( m_mailcapStylesInited & wxMAILCAP_STANDARD )
{
// write in metamail format;
if (WriteToMimeTypes (nIndex, delete_mime) )
// the flags and field values on the current line
bool needsterminal = FALSE,
copiousoutput = FALSE;
- wxMimeArrayString *entry;
+ wxMimeArrayString *entry = NULL; // suppress compiler warning
wxString strType,
strOpenCmd,