wxString sTmp = GetLine(i).AfterFirst(wxT('='));
return sTmp;
}
-
-protected:
- // we override this virtual method because we want to always use UTF-8
- // conversion allowing for invalid characters as MIME information files
- // often contain lines in different encodings and can't be read using any
- // single conversion in Unicode build, so we just try to read what we can
- // suing the most common encoding (UTF-8 is almost ubiquitous nowadays) and
- // ignore the rest
- virtual bool OnRead(const wxMBConv& WXUNUSED(conv))
- {
- return wxTextFile::OnRead(
- wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA));
- }
};
-// in case we're compiling in non-GUI mode
-class WXDLLEXPORT wxIcon;
-
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
wxString dirname = dirbase;
dirname << wxT("/mime-info");
+ // Don't complain if we don't have permissions to read - it confuses users
+ wxLogNull logNull;
+
if ( !wxDir::Exists(dirname) )
return;
{
wxFileName dirname(dirbase, wxEmptyString);
dirname.AppendDir(subdir);
+
+ // Don't complain if we don't have permissions to read - it confuses users
+ wxLogNull logNull;
+
wxDir dir(dirname.GetPath());
if(! dir.IsOpened())
return;
void wxMimeTypesManagerImpl::LoadKDELinkFilesFromDir(const wxString& dirname,
const wxArrayString& icondirs)
{
+ // Don't complain if we don't have permissions to read - it confuses users
+ wxLogNull logNull;
+
if(! wxDir::Exists(dirname))
return;
wxStringTokenizer tokenizer(mimetypes, _T(";"));
while(tokenizer.HasMoreTokens()) {
wxString mimetype = tokenizer.GetNextToken().Lower();
- int nIndex = m_aTypes.Index(mimetype);
+ nIndex = m_aTypes.Index(mimetype);
if(nIndex != wxNOT_FOUND) { // is this a known MIME type?
wxMimeTypeCommands* entry = m_aEntries[nIndex];
entry->AddOrReplaceVerb(wxT("open"), sCmd);
void wxMimeTypesManagerImpl::LoadKDEAppsFilesFromDir(const wxString& dirname)
{
+ // Don't complain if we don't have permissions to read - it confuses users
+ wxLogNull logNull;
+
if(! wxDir::Exists(dirname))
return;
wxDir dir(dirname);
Field_Type,
Field_OpenCmd,
Field_Other
- }
- currentToken = Field_Type;
+ } currentToken = Field_Type;
// the flags and field values on the current line
MailcapLineData data;