}
ft = wxTheMimeTypesManager -> GetFileTypeFromExtension(ext);
- if (ft && (ft -> GetMimeType(&mime))) {
- delete ft;
- return mime;
- }
- else {
- delete ft;
- return wxEmptyString;
+ if ( !ft || !ft -> GetMimeType(&mime) ) {
+ mime = wxEmptyString;
}
+
+ delete ft;
+
+ return mime;
}
wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
{
wxString right = GetRightLocation(location);
- if (wxFileExists(right))
- return new wxFSFile(new wxFileInputStream(right),
- right,
- GetMimeTypeFromExt(location),
- GetAnchor(location),
- wxDateTime(wxFileModificationTime(right)));
- else return (wxFSFile*) NULL;
+ if (!wxFileExists(right))
+ return (wxFSFile*) NULL;
+
+ return new wxFSFile(new wxFileInputStream(right),
+ right,
+ GetMimeTypeFromExt(location),
+ GetAnchor(location),
+ wxDateTime(wxFileModificationTime(right)));
+
}
wxString wxLocalFSHandler::FindFirst(const wxString& spec, int flags)
meta = 0;
for (i = 0; i < ln; i++)
{
- if (!meta)
- switch (loc[i])
- {
- case wxT('/') : case wxT(':') : case wxT('#') : meta = loc[i];
- }
+ switch (loc[i])
+ {
+ case wxT('/') : case wxT(':') : case wxT('#') :
+ meta = loc[i];
+ break;
+ }
+ if (meta != 0) break;
}
m_LastName = wxEmptyString;