#if wxUSE_MIMETYPE
-// Doesn't compile in WIN16 mode
-#ifndef __WIN16__
-
#ifndef WX_PRECOMP
#include "wx/string.h"
#if wxUSE_GUI
wxCHECK_MSG( !ftInfo.GetExtensions().IsEmpty(), NULL,
_T("Associate() needs extension") );
- bool ok = FALSE ;
+ bool ok;
int iExtCount = 0 ;
wxString filetype;
wxString extWithDot;
filetype = filetypeOrig;
}
- ok = key.SetValue(wxEmptyString, filetype);
+ key.SetValue(wxEmptyString, filetype);
}
}
else
if (!filetypeOrig.empty())
{
filetype = filetypeOrig;
- ok = key.SetValue(wxEmptyString, filetype);
+ key.SetValue(wxEmptyString, filetype);
}
else
{
- ok = key.QueryValue(wxEmptyString, filetype);
+ key.QueryValue(wxEmptyString, filetype);
}
}
// now set a mimetypeif we have it, but ignore it if none
if ( ok )
{
// and provide a back link to the extension
- ok = keyMIME.SetValue(_T("Extension"), extWithDot);
+ keyMIME.SetValue(_T("Extension"), extWithDot);
}
}
}
extWithDot += ext;
wxRegKey key(wxRegKey::HKCR, extWithDot);
- if ( !key.Exists() ) ok = key.Create();
- ok = key.SetValue(wxEmptyString, filetype);
+ if ( !key.Exists() ) key.Create();
+ key.SetValue(wxEmptyString, filetype);
// now set any mimetypes we may have, but ignore it if none
const wxString& mimetype = ftInfo.GetMimeType();
if ( ok )
{
// and provide a back link to the extension
- ok = keyMIME.SetValue(_T("Extension"), extWithDot);
+ keyMIME.SetValue(_T("Extension"), extWithDot);
}
}
}
// create the filetype key itself (it will be empty for now, but
// SetCommand(), SetDefaultIcon() &c will use it later)
wxRegKey keyFT(wxRegKey::HKCR, filetype);
- ok = keyFT.Create();
+ keyFT.Create();
- wxFileType *ft = NULL;
- ft = CreateFileType(filetype, extWithDot);
+ wxFileType *ft = CreateFileType(filetype, extWithDot);
if (ft)
{
return !rkey.Exists() || rkey.DeleteSelf();
}
-#endif
- // __WIN16__
-
#endif // wxUSE_MIMETYPE