mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 718910 - Disable Spotlight on the cache directory on Mac; r=michal.novotny, f=smichaud,josh
This commit is contained in:
parent
349708da74
commit
db848ebf08
16
netwerk/cache/nsCacheService.cpp
vendored
16
netwerk/cache/nsCacheService.cpp
vendored
@ -40,6 +40,12 @@
|
||||
|
||||
#include "mozilla/net/NeckoCommon.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// for chflags()
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
/******************************************************************************
|
||||
@ -725,6 +731,16 @@ nsCacheProfilePrefObserver::ReadPrefs(nsIPrefBranch* branch)
|
||||
mDiskCacheParentDirectory = do_QueryInterface(directory, &rv);
|
||||
}
|
||||
if (mDiskCacheParentDirectory) {
|
||||
#ifdef XP_MACOSX
|
||||
// ensure that this directory is not indexed by Spotlight
|
||||
// (bug 718910). it may already exist, so we "just do it."
|
||||
nsAutoCString cachePD;
|
||||
if (NS_SUCCEEDED(mDiskCacheParentDirectory->GetNativePath(cachePD))) {
|
||||
if (chflags(cachePD.get(), UF_HIDDEN)) {
|
||||
NS_WARNING("Failed to set CacheParentDirectory to HIDDEN.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
bool firstSmartSizeRun;
|
||||
rv = branch->GetBoolPref(DISK_CACHE_SMART_SIZE_FIRST_RUN_PREF,
|
||||
&firstSmartSizeRun);
|
||||
|
Loading…
Reference in New Issue
Block a user