// Created: 23.09.98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence: wxWindows license (part of wxExtra library)
+// Licence: wxWindows licence (part of wxExtra library)
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// wxFileTypeInfo
// ----------------------------------------------------------------------------
-wxFileTypeInfo::wxFileTypeInfo(const char *mimeType,
- const char *openCmd,
- const char *printCmd,
- const char *desc,
+wxFileTypeInfo::wxFileTypeInfo(const wxChar *mimeType,
+ const wxChar *openCmd,
+ const wxChar *printCmd,
+ const wxChar *desc,
...)
: m_mimeType(mimeType),
m_openCmd(openCmd),
for ( ;; )
{
- const char *ext = va_arg(argptr, const char *);
+ const wxChar *ext = va_arg(argptr, const wxChar *);
if ( !ext )
{
// NULL terminates the list
return m_impl->GetOpenCommand(openCmd, params);
}
+wxString wxFileType::GetOpenCommand(const wxString& filename) const
+{
+ wxString cmd;
+ if ( !GetOpenCommand(&cmd, filename) )
+ {
+ // return empty string to indicate an error
+ cmd.clear();
+ }
+
+ return cmd;
+}
+
bool
wxFileType::GetPrintCommand(wxString *printCmd,
const wxFileType::MessageParameters& params) const
// VZ: should we do this?
// chris elliott : only makes sense in MS windows
if ( sTmp.empty() )
- GetOpenCommand(&sTmp, wxFileType::MessageParameters("", ""));
+ GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxT(""), wxT("")));
#endif
wxCHECK_MSG( !sTmp.empty(), FALSE, _T("need the icon file") );
bool wxMimeTypesManager::Unassociate(wxFileType *ft)
{
-#if defined(__UNIX__) && !defined(__WXPM__)
+#if defined(__UNIX__) && !defined(__WXPM__) && !defined(__CYGWIN__) && !defined(__WINE__)
return m_impl->Unassociate(ft);
#else
return ft->Unassociate();
void wxMimeTypesManager::Initialize(int mcapStyle,
const wxString& sExtraDir)
{
-#if defined(__UNIX__) && !defined(__WXPM__)
+#if defined(__UNIX__) && !defined(__WXPM__) && !defined(__CYGWIN__) && !defined(__WINE__)
EnsureImpl();
m_impl->Initialize(mcapStyle, sExtraDir);
// and this function clears all the data from the manager
void wxMimeTypesManager::ClearData()
{
-#if defined(__UNIX__) && !defined(__WXPM__)
+#if defined(__UNIX__) && !defined(__WXPM__) && !defined(__CYGWIN__) && !defined(__WINE__)
EnsureImpl();
m_impl->ClearData();
{
delete gs_mimeTypesManager.m_impl;
gs_mimeTypesManager.m_impl = NULL;
+ gs_mimeTypesManager.m_fallbacks.Clear();
}
}