summaryrefslogtreecommitdiffstats
path: root/toolkit/xre/ProfileReset.cpp
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2018-04-20 07:32:32 -0400
committerGitHub <noreply@github.com>2018-04-20 07:32:32 -0400
commitae4be7c9eb5d2ac6094296b83704c333105aa5d7 (patch)
treefd710aa8b8a9299977e992d41c9118a358648fc7 /toolkit/xre/ProfileReset.cpp
parent0216b346f004c22603511ae9b0b35eaea26f1275 (diff)
parent6d04705a97e1f16b370ecf7c97508a46a650ff46 (diff)
downloadUXP-ae4be7c9eb5d2ac6094296b83704c333105aa5d7.tar
UXP-ae4be7c9eb5d2ac6094296b83704c333105aa5d7.tar.gz
UXP-ae4be7c9eb5d2ac6094296b83704c333105aa5d7.tar.lz
UXP-ae4be7c9eb5d2ac6094296b83704c333105aa5d7.tar.xz
UXP-ae4be7c9eb5d2ac6094296b83704c333105aa5d7.zip
Merge pull request #212 from janekptacijarabaci/profile_resseting_1
moebius#84, #205: Fix: The profile - resetting (partially)
Diffstat (limited to 'toolkit/xre/ProfileReset.cpp')
-rw-r--r--toolkit/xre/ProfileReset.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/toolkit/xre/ProfileReset.cpp b/toolkit/xre/ProfileReset.cpp
index aef2d7746..c9e2ef8d4 100644
--- a/toolkit/xre/ProfileReset.cpp
+++ b/toolkit/xre/ProfileReset.cpp
@@ -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,