mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 22:27:31 +09:00
Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.
This also removes some PP abuse and takes file entries out of PP when no longer needed without XP_MACOSX conditionals.
This commit is contained in:
parent
02c59100a8
commit
a4b0f333ba
153 changed files with 173 additions and 4556 deletions
|
|
@ -116,11 +116,7 @@ function checkCurrentInput(currentInput)
|
|||
|
||||
if (!errorMessage) {
|
||||
finishText.className = "";
|
||||
#ifdef XP_MACOSX
|
||||
finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishTextMac");
|
||||
#else
|
||||
finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishText");
|
||||
#endif
|
||||
canAdvance = true;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -31,14 +31,10 @@
|
|||
<description>&profileCreationExplanation_2.text;</description>
|
||||
<description>&profileCreationExplanation_3.text;</description>
|
||||
<spacer flex="1"/>
|
||||
#ifdef XP_MACOSX
|
||||
<description>&profileCreationExplanation_4Mac.text;</description>
|
||||
#else
|
||||
#ifdef XP_UNIX
|
||||
<description>&profileCreationExplanation_4Gnome.text;</description>
|
||||
#else
|
||||
<description>&profileCreationExplanation_4.text;</description>
|
||||
#endif
|
||||
#endif
|
||||
</wizardpage>
|
||||
|
||||
|
|
|
|||
|
|
@ -134,9 +134,7 @@ function onProfilesKey(aEvent)
|
|||
switch ( aEvent.keyCode )
|
||||
{
|
||||
case KeyEvent.DOM_VK_BACK_SPACE:
|
||||
#ifndef XP_MACOSX
|
||||
break;
|
||||
#endif
|
||||
case KeyEvent.DOM_VK_DELETE:
|
||||
ConfirmDelete();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
toolkit.jar:
|
||||
* content/mozapps/profile/createProfileWizard.js (content/createProfileWizard.js)
|
||||
content/mozapps/profile/createProfileWizard.js (content/createProfileWizard.js)
|
||||
* content/mozapps/profile/createProfileWizard.xul (content/createProfileWizard.xul)
|
||||
* content/mozapps/profile/profileSelection.js (content/profileSelection.js)
|
||||
content/mozapps/profile/profileSelection.js (content/profileSelection.js)
|
||||
content/mozapps/profile/profileSelection.xul (content/profileSelection.xul)
|
||||
|
|
|
|||
|
|
@ -13,11 +13,6 @@
|
|||
#include "nsAutoPtr.h"
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
#ifdef XP_UNIX
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
|
@ -426,10 +421,7 @@ nsresult nsProfileLock::GetReplacedLockTime(PRTime *aResult) {
|
|||
nsresult nsProfileLock::Lock(nsIFile* aProfileDir,
|
||||
nsIProfileUnlocker* *aUnlocker)
|
||||
{
|
||||
#if defined (XP_MACOSX)
|
||||
NS_NAMED_LITERAL_STRING(LOCKFILE_NAME, ".parentlock");
|
||||
NS_NAMED_LITERAL_STRING(OLD_LOCKFILE_NAME, "parent.lock");
|
||||
#elif defined (XP_UNIX)
|
||||
#if defined (XP_UNIX)
|
||||
NS_NAMED_LITERAL_STRING(OLD_LOCKFILE_NAME, "lock");
|
||||
NS_NAMED_LITERAL_STRING(LOCKFILE_NAME, ".parentlock");
|
||||
#else
|
||||
|
|
@ -458,67 +450,7 @@ nsresult nsProfileLock::Lock(nsIFile* aProfileDir,
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
// First, try locking using fcntl. It is more reliable on
|
||||
// a local machine, but may not be supported by an NFS server.
|
||||
|
||||
rv = LockWithFcntl(lockFile);
|
||||
if (NS_FAILED(rv) && (rv != NS_ERROR_FILE_ACCESS_DENIED))
|
||||
{
|
||||
// If that failed for any reason other than NS_ERROR_FILE_ACCESS_DENIED,
|
||||
// assume we tried an NFS that does not support it. Now, try with symlink.
|
||||
rv = LockWithSymlink(lockFile, false);
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
// Check for the old-style lock used by pre-mozilla 1.3 builds.
|
||||
// Those builds used an earlier check to prevent the application
|
||||
// from launching if another instance was already running. Because
|
||||
// of that, we don't need to create an old-style lock as well.
|
||||
struct LockProcessInfo
|
||||
{
|
||||
ProcessSerialNumber psn;
|
||||
unsigned long launchDate;
|
||||
};
|
||||
|
||||
PRFileDesc *fd = nullptr;
|
||||
int32_t ioBytes;
|
||||
ProcessInfoRec processInfo;
|
||||
LockProcessInfo lockProcessInfo;
|
||||
|
||||
rv = lockFile->SetLeafName(OLD_LOCKFILE_NAME);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
rv = lockFile->OpenNSPRFileDesc(PR_RDONLY, 0, &fd);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
ioBytes = PR_Read(fd, &lockProcessInfo, sizeof(LockProcessInfo));
|
||||
PR_Close(fd);
|
||||
|
||||
if (ioBytes == sizeof(LockProcessInfo))
|
||||
{
|
||||
#ifdef __LP64__
|
||||
processInfo.processAppRef = nullptr;
|
||||
#else
|
||||
processInfo.processAppSpec = nullptr;
|
||||
#endif
|
||||
processInfo.processName = nullptr;
|
||||
processInfo.processInfoLength = sizeof(ProcessInfoRec);
|
||||
if (::GetProcessInformation(&lockProcessInfo.psn, &processInfo) == noErr &&
|
||||
processInfo.processLaunchDate == lockProcessInfo.launchDate)
|
||||
{
|
||||
return NS_ERROR_FILE_ACCESS_DENIED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_WARNING("Could not read lock file - ignoring lock");
|
||||
}
|
||||
}
|
||||
rv = NS_OK; // Don't propagate error from OpenNSPRFileDesc.
|
||||
}
|
||||
#elif defined(XP_UNIX)
|
||||
#if defined(XP_UNIX)
|
||||
// Get the old lockfile name
|
||||
nsCOMPtr<nsIFile> oldLockFile;
|
||||
rv = aProfileDir->Clone(getter_AddRefs(oldLockFile));
|
||||
|
|
|
|||
|
|
@ -26,11 +26,6 @@
|
|||
#include "nsIFile.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include "nsILocalFileMac.h"
|
||||
#endif
|
||||
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
|
||||
|
|
@ -1025,33 +1020,7 @@ NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult)
|
|||
nsresult
|
||||
XRE_GetFileFromPath(const char *aPath, nsIFile* *aResult)
|
||||
{
|
||||
#if defined(XP_MACOSX)
|
||||
int32_t pathLen = strlen(aPath);
|
||||
if (pathLen > MAXPATHLEN)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
CFURLRef fullPath =
|
||||
CFURLCreateFromFileSystemRepresentation(nullptr, (const UInt8 *) aPath,
|
||||
pathLen, true);
|
||||
if (!fullPath)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIFile> lf;
|
||||
nsresult rv = NS_NewNativeLocalFile(EmptyCString(), true,
|
||||
getter_AddRefs(lf));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsILocalFileMac> lfMac = do_QueryInterface(lf, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = lfMac->InitWithCFURL(fullPath);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
lf.forget(aResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
CFRelease(fullPath);
|
||||
return rv;
|
||||
|
||||
#elif defined(XP_UNIX)
|
||||
#if defined(XP_UNIX)
|
||||
char fullPath[MAXPATHLEN];
|
||||
|
||||
if (!realpath(aPath, fullPath))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue