diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-10-12 13:25:54 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-10-12 14:08:55 +0000 |
commit | 5f1a338d54966f77e8aef2c77e5d01260f2f5bbe (patch) | |
tree | 6488e800cee0e5d53d50ef4cdbc750915f8dde51 /configmgr | |
parent | 802f2a420859f6787c86a960aa331245423d5820 (diff) |
profilesafe: Multiple adaptions
Added own directory in User config to where the
saved content is written and taken from, adapted
to also handle ExtensionConfiguration, changed
point for creating backups of configuration to
doShutdown, create no configuration when a restart
is triggered (untested configuration)
Change-Id: Id7a96195b765842c31cacf81cc08d2965a205281
Reviewed-on: https://gerrit.libreoffice.org/29729
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/components.cxx | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 17f09a3c0c72..9072da43e844 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -613,18 +613,22 @@ Components::Components( Components::~Components() { - // get flag if _exit was already called which is a sign to not to secure user config + // get flag if _exit was already called which is a sign to not secure user config. + // this is used for win only currently where calling _exit() unfortunately still + // calls destructors (what is not wanted). May be needed for other systems, too + // (unknown yet) but can do no harm const bool bExitWasCalled(comphelper::BackupFileHelper::getExitWasCalled()); #ifndef WNT // we can add a SAL_WARN here for other systems where the destructor gets called after - // an _exit() call - which should not happen. Still safe - the getExitWasCalled() is - // used, but a hint that _exit behaves different on a system + // an _exit() call. Still safe - the getExitWasCalled() is used, but a hint that _exit + // behaves different on a system SAL_WARN_IF(bExitWasCalled, "configmgr", "Components::~Components() called after _exit() call"); #endif if (bExitWasCalled) { + // do not write, re-join thereads osl::MutexGuard g(*lock_); if (writeThread_.is()) @@ -634,30 +638,13 @@ Components::~Components() } else { + // write changes flushModifications(); } for (WeakRootSet::iterator i(roots_.begin()); i != roots_.end(); ++i) { (*i)->setAlive(false); } - - if (!bExitWasCalled && - ModificationTarget::File == modificationTarget_ && - !modificationFileUrl_.isEmpty()) - { - // test backup of registrymodifications - sal_uInt16 nSecureUserConfigNumCopies(0); - - // read configuration from soffice.ini - const bool bSecureUserConfig(comphelper::BackupFileHelper::getSecureUserConfig(nSecureUserConfigNumCopies)); - - if (bSecureUserConfig) - { - comphelper::BackupFileHelper aBackupFileHelper(modificationFileUrl_, nSecureUserConfigNumCopies); - - aBackupFileHelper.tryPush(); - } - } } void Components::parseFileLeniently( |