diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-01-28 16:23:59 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-28 15:08:27 +0100 |
commit | f9b4d981a8518974e31a4f79e83a7e06fa3f0fb5 (patch) | |
tree | 34b99ef241bea445c265483a47e86fa8c17f2e9f /Libraries | |
parent | f983dfe319978b47b4c5314df9ea3373e3d69c05 (diff) | |
download | serenity-f9b4d981a8518974e31a4f79e83a7e06fa3f0fb5.zip |
LibGUI+FileManager: Try better to detect executables
We will now consider a file to be an executable if any of the executable
permission bits are set.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/GFileSystemModel.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GFileSystemModel.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/GFileSystemModel.cpp b/Libraries/LibGUI/GFileSystemModel.cpp index c0ed10eb8c..ed532d5500 100644 --- a/Libraries/LibGUI/GFileSystemModel.cpp +++ b/Libraries/LibGUI/GFileSystemModel.cpp @@ -415,7 +415,7 @@ GIcon GFileSystemModel::icon_for_file(const mode_t mode, const String& name) con return m_symlink_icon; if (S_ISSOCK(mode)) return m_socket_icon; - if (mode & S_IXUSR) + if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) return m_executable_icon; if (name.to_lowercase().ends_with(".wav")) return m_filetype_sound_icon; diff --git a/Libraries/LibGUI/GFileSystemModel.h b/Libraries/LibGUI/GFileSystemModel.h index 4c01bf32cd..276c99df50 100644 --- a/Libraries/LibGUI/GFileSystemModel.h +++ b/Libraries/LibGUI/GFileSystemModel.h @@ -73,7 +73,7 @@ public: mutable RefPtr<GraphicsBitmap> thumbnail; bool is_directory() const { return S_ISDIR(mode); } - bool is_executable() const { return mode & S_IXUSR; } + bool is_executable() const { return mode & (S_IXUSR | S_IXGRP | S_IXOTH); } String full_path(const GFileSystemModel&) const; |