mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1730891 - Set default preferredAction for handling files to save directly to disk on GNOME environments. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D125687
This commit is contained in:
parent
0a47b2e410
commit
136593a67b
@ -3,6 +3,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "nsGNOMERegistry.h"
|
||||
#include "nsString.h"
|
||||
#include "nsMIMEInfoUnix.h"
|
||||
@ -93,7 +94,10 @@ already_AddRefed<nsMIMEInfoBase> nsGNOMERegistry::GetFromType(
|
||||
giovfs->GetDescriptionForMimeType(aMIMEType, description);
|
||||
|
||||
mimeInfo->SetDefaultDescription(name);
|
||||
mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
|
||||
|
||||
mozilla::StaticPrefs::browser_download_improvements_to_download_panel()
|
||||
? mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk)
|
||||
: mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
|
||||
mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description));
|
||||
|
||||
return mimeInfo.forget();
|
||||
|
Loading…
Reference in New Issue
Block a user