|
Registered User
Joined: 18 Apr 2009
Posts: 3
|
Hi, I've been trying to build E on Linux today (Fedora 10 to be exact), and I've gotten to the point that E builds and runs, but it still has many problems. Besides the constant popups about failed assertions, I also couldn't see any files because wxTheMimeTypesManager failed to resolve the extensions.
While this issue is with not E's fault (the mimetype list on my system is simply incomplete), the way E handled this was kind of strange: it just bailed out. The result was that all files with an extension that didn't resolve were not displayed in the ProjectPane.
I've modified the code so that when the mime type can't be resolved, the default file icon is used. The fix shouldn't break anything else, so I hope please use it:
Here is the patch:
Code: --- a/src/ProjectPane.cpp
+++ b/src/ProjectPane.cpp
@@ -2138,7 +2138,12 @@ bool ProjectPane::GetIconFromFilePath(const wxString& path, wxIcon &icon) {
if (NULL == (FileType = wxTheMimeTypesManager->GetFileTypeFromExtension(FileExt))) {
wxLogDebug(wxT("ProjectPane::%s() Can't get file type from ext=%s"),
wxString(__FUNCTION__, wxConvUTF8).c_str(), FileExt.c_str());
- return false;
+ // FIX: use default icon here as well.
+ icon = wxArtProvider::GetIcon(wxART_NORMAL_FILE);
+ if (!icon.IsOk()) {
+ return false;
+ }
+ return true;
}
if ((!FileType->GetIcon(&IconLoc)) || !IconLoc.IsOk()) {
wxLogDebug(wxT("ProjectPane::%s() Can't get icon location"),
|
|
|