mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 921148 - Remove XRE_UPDATE_ROOT_DIR dir provider along with MOZ_APP_NAME, MOZ_APP_PROFILE, MOZ_APP_VENDOR, and MOZ_APP_BASENAME from xpcshell. r=bbondy
This commit is contained in:
parent
0617dcfc81
commit
b266d892b6
@ -38,7 +38,6 @@
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
// all this crap is needed to do the interactive shell stuff
|
||||
@ -1667,44 +1666,6 @@ XPCShellDirProvider::GetFile(const char *prop, bool *persistent,
|
||||
return NS_ERROR_FAILURE;
|
||||
NS_ADDREF(*result = file);
|
||||
return NS_OK;
|
||||
} else if (mAppFile && !strcmp(prop, XRE_UPDATE_ROOT_DIR)) {
|
||||
// For xpcshell, we pretend that the update root directory is always
|
||||
// the same as the GRE directory, except for Windows, where we immitate
|
||||
// the algorithm defined in nsXREDirProvider::GetUpdateRootDir.
|
||||
*persistent = true;
|
||||
#ifdef XP_WIN
|
||||
char appData[MAX_PATH] = {'\0'};
|
||||
char path[MAX_PATH] = {'\0'};
|
||||
LPITEMIDLIST pItemIDList;
|
||||
if (FAILED(SHGetSpecialFolderLocation(nullptr, CSIDL_LOCAL_APPDATA, &pItemIDList)) ||
|
||||
FAILED(SHGetPathFromIDListA(pItemIDList, appData))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsAutoString pathName;
|
||||
pathName.AssignASCII(appData);
|
||||
nsCOMPtr<nsIFile> localFile;
|
||||
nsresult rv = NS_NewLocalFile(pathName, true, getter_AddRefs(localFile));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef MOZ_APP_PROFILE
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_PROFILE));
|
||||
#else
|
||||
// MOZ_APP_VENDOR and MOZ_APP_BASENAME are optional.
|
||||
#ifdef MOZ_APP_VENDOR
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_VENDOR));
|
||||
#endif
|
||||
#ifdef MOZ_APP_BASENAME
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_BASENAME));
|
||||
#endif
|
||||
// However app name is always appended.
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_NAME));
|
||||
#endif
|
||||
return localFile->Clone(result);
|
||||
#else
|
||||
return mAppFile->GetParent(result);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -75,18 +75,6 @@ GENERATED_FILES = [
|
||||
'GeneratedEvents.h',
|
||||
]
|
||||
|
||||
# XPCShellImpl.cpp requires hardcoded vendor/profile/appname stuff on Windows
|
||||
# This sucks, bug 921148 tracks this.
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
if CONFIG['MOZ_APP_PROFILE']:
|
||||
DEFINES['MOZ_APP_PROFILE'] = '"%s"' % CONFIG['MOZ_APP_PROFILE']
|
||||
else:
|
||||
if CONFIG['MOZ_APP_VENDOR']:
|
||||
DEFINES['MOZ_APP_VENDOR'] = '"%s"' % CONFIG['MOZ_APP_VENDOR']
|
||||
if CONFIG['MOZ_APP_BASENAME']:
|
||||
DEFINES['MOZ_APP_BASENAME'] = '"%s"' % CONFIG['MOZ_APP_BASENAME']
|
||||
DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
|
||||
|
||||
DEFINES['JS_THREADSAFE'] = True
|
||||
|
||||
if CONFIG['MOZ_JSDEBUGGER']:
|
||||
|
Loading…
Reference in New Issue
Block a user