зеркало из https://github.com/mozilla/pjs.git
Use the browser.helperApps.deleteTempFileOnExit pref, if set, to decide whether
to delete helper app temp files on exit. Bug 302433, r=biesi, sr=sfraser
This commit is contained in:
Родитель
850e79b651
Коммит
eb891afa08
|
@ -2310,12 +2310,28 @@ nsresult nsExternalAppHandler::OpenWithApplication()
|
|||
}
|
||||
else
|
||||
{
|
||||
PRBool deleteTempFileOnExit;
|
||||
nsresult result = NS_ERROR_NOT_AVAILABLE; // don't return this!
|
||||
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
if (prefs) {
|
||||
result = prefs->GetBoolPref("browser.helperApps.deleteTempFileOnExit",
|
||||
&deleteTempFileOnExit);
|
||||
}
|
||||
if (NS_FAILED(result)) {
|
||||
// No pref set; use default value
|
||||
#if !defined(XP_MAC) && !defined (XP_MACOSX)
|
||||
NS_ASSERTION(sSrv, "Service gone away!?");
|
||||
// Mac users have been very verbal about temp files being deleted on app exit - they
|
||||
// don't like it - but we'll continue to do this on other platforms for now
|
||||
sSrv->DeleteTemporaryFileOnExit(mFinalFileDestination);
|
||||
// Mac users have been very verbal about temp files being deleted on
|
||||
// app exit - they don't like it - but we'll continue to do this on
|
||||
// other platforms for now.
|
||||
deleteTempFileOnExit = PR_TRUE;
|
||||
#else
|
||||
deleteTempFileOnExit = PR_FALSE;
|
||||
#endif
|
||||
}
|
||||
if (deleteTempFileOnExit) {
|
||||
NS_ASSERTION(sSrv, "Service gone away!?");
|
||||
sSrv->DeleteTemporaryFileOnExit(mFinalFileDestination);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче