mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
moebius#205: Fix: The profile - resetting (the custom profile name)
https://github.com/MoonchildProductions/moebius/pull/205
This commit is contained in:
parent
4d4535d84e
commit
6a0f3e8f3f
6 changed files with 696 additions and 28 deletions
|
|
@ -31,13 +31,19 @@ static const char kProfileProperties[] =
|
|||
* Creates a new profile with a timestamp in the name to use for profile reset.
|
||||
*/
|
||||
nsresult
|
||||
CreateResetProfile(nsIToolkitProfileService* aProfileSvc, nsIToolkitProfile* *aNewProfile)
|
||||
CreateResetProfile(nsIToolkitProfileService* aProfileSvc, const nsACString& aOldProfileName, nsIToolkitProfile* *aNewProfile)
|
||||
{
|
||||
MOZ_ASSERT(aProfileSvc, "NULL profile service");
|
||||
|
||||
nsCOMPtr<nsIToolkitProfile> newProfile;
|
||||
// Make the new profile "default-" + the time in seconds since epoch for uniqueness.
|
||||
nsAutoCString newProfileName("default-");
|
||||
// Make the new profile the old profile (or "default-") + the time in seconds since epoch for uniqueness.
|
||||
nsAutoCString newProfileName;
|
||||
if (!aOldProfileName.IsEmpty()) {
|
||||
newProfileName.Assign(aOldProfileName);
|
||||
newProfileName.Append("-");
|
||||
} else {
|
||||
newProfileName.Assign("default-");
|
||||
}
|
||||
newProfileName.Append(nsPrintfCString("%lld", PR_Now() / 1000));
|
||||
nsresult rv = aProfileSvc->CreateProfile(nullptr, // choose a default dir for us
|
||||
newProfileName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue