Opened 11 years ago
Last modified 11 years ago
#9401 new Patch
Get file icons on linux
Reported by: | Francois Ferrand | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | FileZilla Client |
Keywords: | Cc: | ||
Component version: | Operating system type: | Linux | |
Operating system version: |
Description
wxFileType::GetIcon() is not implemented in wxGtk.
This patch replaces calls to wxTheMimeTypesManager and wxFileType::GetIcon() with calls to gnome.
Other platforms are not affected.
In addition, wxStat is used to properly detect 'local' wxLstat.
Attachments (3)
Change History (6)
by , 11 years ago
Attachment: | 0001-Get-file-icons-on-linux.patch added |
---|
comment:1 by , 11 years ago
Status: | new → moreinfo |
---|
comment:2 by , 11 years ago
Status: | moreinfo → new |
---|
I attached a new patch with the changes, as documented bellow.
Not all issues are fixed, see my answer below and please provide some feedback.
1) Including GTK/GIO-specific headers without checking for their existence first in
the configure script.
gio.h is part of GLib, and gtk.h is part of Gtk: both are already needed to compile with wxGTK (i.e. GTK on linux). Do we need extra checks? If so, would you have any pointers on on how to do this (I have very limited knowledge of autotools...)?
2) No runtime fallback on the old behavior if there is no Gnome
Done.
3) You're bypassing the cache which will have a measureable runtime impact. Please
tell me: How long does it take to list a directory containing a million files both
with and without the patch applied?
I think I am still going through the cache: lookup is unaffected (before the call to GetFileIcon()), and insertion is still done at the end of the CSystemImageList::GetIconIndex() function. Or am I missing something here?
4) wxFileName is very slow. Consider using FileZilla's CLocalFileSystem instead.
Done.
5) You are using various magic constants, e.g. the various GNOME_ICON_LOOKUP_FLAGS.
Why not use the Gnome headers for this which surely must contain this information?
The Gnome headers will certainly contain the information. However, this would mean the Gnome libs are needed for compilation, which is not the case at the moment. Would it be better to change this?
by , 11 years ago
Attachment: | 0001-Get-file-icons-on-linux.3.patch added |
---|
comment:3 by , 11 years ago
patch v3, just fix a crash in previous patch, which now happens with wxWidgets 3.0.
Thank you for your patch.
Could you please address the following issues in a revised patch?
1) Including GTK/GIO-specific headers without checking for their existence first in the configure script.
2) No runtime fallback on the old behavior if there is no Gnome
3) You're bypassing the cache which will have a measureable runtime impact. Please tell me: How long does it take to list a directory containing a million files both with and without the patch applied?
4) wxFileName is very slow. Consider using FileZilla's CLocalFileSystem instead.
5) You are using various magic constants, e.g. the various GNOME_ICON_LOOKUP_FLAGS. Why not use the Gnome headers for this which surely must contain this information?