summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-03-02 12:48:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-03-02 12:49:05 +0100
commitf97c9c25396fb6487da3b9b5284c6250c7927156 (patch)
tree2fa4f879d4fb5b11fa30d9250c9fe43eaaa66587
parent02888164e76fd08a7a6d02e526669f1c4e3a0239 (diff)
migrateSettingsIfNecessary must be called later after all
...once e.g. UCB is already initialized, as the invoked migration services use it.
-rw-r--r--desktop/source/app/app.cxx34
-rw-r--r--desktop/source/app/userinstall.cxx13
-rw-r--r--desktop/source/app/userinstall.hxx7
3 files changed, 28 insertions, 26 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 61746be49902..5610637297e5 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -36,6 +36,7 @@
#include "userinstall.hxx"
#include "desktopcontext.hxx"
#include "exithelper.hxx"
+#include "migration.hxx"
#include <svtools/javacontext.hxx>
#include <com/sun/star/frame/XSessionManagerListener.hpp>
@@ -1476,23 +1477,21 @@ int Desktop::Main()
SetSplashScreenProgress(10);
+ UserInstall::UserInstallStatus inst_fin = UserInstall::finalize();
+ if (inst_fin != UserInstall::Ok && inst_fin != UserInstall::Created)
{
- UserInstall::UserInstallError instErr_fin = UserInstall::finalize();
- if ( instErr_fin != UserInstall::E_None)
- {
- OSL_FAIL("userinstall failed");
- if ( instErr_fin == UserInstall::E_NoDiskSpace )
- HandleBootstrapErrors( BE_USERINSTALL_NOTENOUGHDISKSPACE );
- else if ( instErr_fin == UserInstall::E_NoWriteAccess )
- HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS );
- else
- HandleBootstrapErrors( BE_USERINSTALL_FAILED );
- return EXIT_FAILURE;
- }
- // refresh path information
- utl::Bootstrap::reloadData();
- SetSplashScreenProgress(20);
+ OSL_FAIL("userinstall failed");
+ if ( inst_fin == UserInstall::E_NoDiskSpace )
+ HandleBootstrapErrors( BE_USERINSTALL_NOTENOUGHDISKSPACE );
+ else if ( inst_fin == UserInstall::E_NoWriteAccess )
+ HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS );
+ else
+ HandleBootstrapErrors( BE_USERINSTALL_FAILED );
+ return EXIT_FAILURE;
}
+ // refresh path information
+ utl::Bootstrap::reloadData();
+ SetSplashScreenProgress(20);
Reference< XMultiServiceFactory > xSMgr =
::comphelper::getProcessServiceFactory();
@@ -1623,6 +1622,11 @@ int Desktop::Main()
// check whether the shutdown is caused by restart
pExecGlobals->bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+
+ if (inst_fin == UserInstall::Created)
+ {
+ Migration::migrateSettingsIfNecessary();
+ }
#endif
// keep a language options instance...
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 26d2ef7e5ddc..f6d0c7b54844 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -28,7 +28,6 @@
#include "sal/config.h"
-#include "migration.hxx"
#include "userinstall.hxx"
#include "langselect.hxx"
@@ -68,7 +67,7 @@ using namespace com::sun::star::util;
namespace desktop {
- static UserInstall::UserInstallError create_user_install(OUString&);
+ static UserInstall::UserInstallStatus create_user_install(OUString&);
static bool is_user_install()
{
@@ -95,7 +94,7 @@ namespace desktop {
return false;
}
- UserInstall::UserInstallError UserInstall::finalize()
+ UserInstall::UserInstallStatus UserInstall::finalize()
{
OUString aUserInstallPath;
utl::Bootstrap::PathStatus aLocateResult =
@@ -114,7 +113,7 @@ namespace desktop {
// path exists, check if an installation lives there
if ( is_user_install() )
{
- return E_None;
+ return Ok;
}
// Note: fall-thru intended.
}
@@ -185,7 +184,7 @@ namespace desktop {
return err;
}
- static UserInstall::UserInstallError create_user_install(OUString& aUserPath)
+ static UserInstall::UserInstallStatus create_user_install(OUString& aUserPath)
{
OUString aBasePath;
if (utl::Bootstrap::locateBaseInstallation(aBasePath) != utl::Bootstrap::PATH_EXISTS)
@@ -216,8 +215,6 @@ namespace desktop {
else
return UserInstall::E_Creation;
}
-
- Migration::migrateSettingsIfNecessary();
#endif
boost::shared_ptr< comphelper::ConfigurationChanges > batch(
@@ -225,7 +222,7 @@ namespace desktop {
officecfg::Setup::Office::ooSetupInstCompleted::set(true, batch);
batch->commit();
- return UserInstall::E_None;
+ return UserInstall::Created;
}
}
diff --git a/desktop/source/app/userinstall.hxx b/desktop/source/app/userinstall.hxx
index 6dcb5e91db41..5fa1a2d65af8 100644
--- a/desktop/source/app/userinstall.hxx
+++ b/desktop/source/app/userinstall.hxx
@@ -36,8 +36,9 @@ namespace desktop
class UserInstall
{
public:
- enum UserInstallError {
- E_None, // no error
+ enum UserInstallStatus {
+ Ok, // no error, existing user installation found
+ Created, // no error, new user installation created
E_Creation, // error while creating user install
E_InvalidBaseinstall, // corrupt base installation
E_SetupFailed, // external setup did not run correctly
@@ -48,7 +49,7 @@ public:
E_Unknown // unknown error
};
- static UserInstallError finalize();
+ static UserInstallStatus finalize();
};
}