feat: modify profile name

(cherry picked from commit 15940da685e89c698162c24e67587a18189a2ac9)
This commit is contained in:
Alex Kontos
2021-09-17 12:10:46 +01:00
committed by Alex Kontos
parent 6ab05a96be
commit 432f0515db

View File

@@ -75,7 +75,7 @@
using namespace mozilla;
#define DEV_EDITION_NAME "dev-edition-default"
#define DEFAULT_NAME "default"
#define DEFAULT_NAME "68-edition-default"
#define COMPAT_FILE u"compatibility.ini"_ns
#define PROFILE_DB_VERSION "2"
#define INSTALL_PREFIX "Install"
@@ -1218,6 +1218,21 @@ nsresult nsToolkitProfileService::Init() {
}
}
// Safety net for nonDevEdition builds:
// If we detected a first run but there is exactly one profile and it was
// classified as "dev-edition default" (due to a name collision), treat it as
// the normal default instead of creating a new profile.
if (!mUseDevEditionProfile && mDevEditionDefault && !mNormalDefault &&
nonDevEditionProfiles == 0 && mProfiles.getFirst() == mProfiles.getLast()) {
SetNormalDefault(mDevEditionDefault);
// For non-dedicated profiles, directly avoid first-run.
if (!mUseDedicatedProfile) {
mIsFirstRun = false;
}
// In dedicated-profile mode, keep mIsFirstRun as-is so the adoption path
// in SelectStartupProfile can run with mNormalDefault set.
}
return NS_OK;
}