Linux: fix Nautilus not detected as file manager on some Gnome based destributions.

This commit is contained in:
Mounir IDRASSI 2015-12-02 11:10:30 +01:00
parent 613ea66c95
commit 3a9db8d98c

View File

@ -834,8 +834,10 @@ namespace VeraCrypt
#else
// MIME handler for directory seems to be unavailable through wxWidgets
wxString desktop = GetTraits()->GetDesktopEnvironment();
bool xdgOpenPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open"));
bool nautilusPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/nautilus"));
if (desktop == L"GNOME")
if (desktop == L"GNOME" || (desktop.empty() && !xdgOpenPresent && nautilusPresent))
{
args.push_back ("--no-default-window");
args.push_back ("--no-desktop");
@ -868,7 +870,7 @@ namespace VeraCrypt
catch (exception &e) { ShowError (e); }
}
}
else if (wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open")))
else if (xdgOpenPresent)
{
// Fallback on the standard xdg-open command
// which is not always available by default