summaryrefslogtreecommitdiff
authorNoel Power <noel.power@novell.com>2011-06-13 09:38:18 (GMT)
committer Noel Power <noel.power@novell.com>2011-06-13 09:45:45 (GMT)
commit6b522673373797bbf53d795d53e0ec45175a5d67 (patch) (side-by-side diff)
tree1f68cf37619300fd5ffe518c077b00590d6c5ebf
parentd1e8ef8c46b0f3409396eaadd0a3743feb6a5f44 (diff)
downloadcore-6b522673373797bbf53d795d53e0ec45175a5d67.zip
core-6b522673373797bbf53d795d53e0ec45175a5d67.tar.gz
default config location has changed, look in old config dir when migrating
A previous patch (boostrap:25bd2eec77ed774a37d1cddd0d72312e23d5e9fd) changed the default configuration directory location ( on unix ) When evaluating user configurations for migration we need to search the old default config dir and not the new default config directory,
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--desktop/source/migration/migration.cxx19
-rw-r--r--officecfg/registry/data/org/openoffice/Setup.xcu4
2 files changed, 21 insertions, 2 deletions
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index be970b1..2cade3a 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -88,6 +88,9 @@ static const ::rtl::OUString MENU_SEPERATOR(RTL_CONSTASCII_USTRINGPARAM(" | "));
static const ::rtl::OUString MENU_SUBMENU(RTL_CONSTASCII_USTRINGPARAM("..."));
static const ::rtl::OUString MIGRATION_STAMP_NAME(RTL_CONSTASCII_USTRINGPARAM("/MIGRATED"));
+
+static const char XDG_CONFIG_PART[] = "/.config";
+
::rtl::OUString retrieveLabelFromCommand(const ::rtl::OUString& sCommand, const ::rtl::OUString& sModuleIdentifier)
{
::rtl::OUString sLabel;
@@ -553,6 +556,22 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions)
{
::rtl::OUString aUserInst;
osl::Security().getConfigDir( aUserInst );
+#if defined UNX && ! defined MACOSX
+ const char* pXDGCfgHome = getenv("XDG_CONFIG_HOME");
+ // cater for XDG_CONFIG_HOME change
+ // If XDG_CONFIG_HOME is set then we;
+ // assume the user knows what they are doing ( room for improvement here, we could
+ // of course search the default config dir etc. also - but this is more complex,
+ // we would need to weigh results from the current config dir against matches in
+ // the 'old' config dir etc. ) - currently we just use the returned config dir.
+ // If XDG_CONFIG_HOME is NOT set;
+ // assume then we should now using the default $HOME/,config config location for
+ // our user profiles, however *all* previous libreoffice and openoffice.org
+ // configurations will be in the 'old' config directory and that's where we need
+ // to search - we convert the returned config dir to the 'old' dir
+ if ( !pXDGCfgHome && aUserInst.endsWithAsciiL( XDG_CONFIG_PART, sizeof( XDG_CONFIG_PART ) - 1 ) )
+ aUserInst = aUserInst.copy( 0, aUserInst.getLength() - sizeof( XDG_CONFIG_PART ) + 2 ); // remove trailing '.config' ( but leave the terminating '/' )
+#endif
if ( aUserInst.getLength() && aUserInst[ aUserInst.getLength()-1 ] != '/' )
aUserInst += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
#if defined UNX && ! defined MACOSX
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index e72e61b..7ce9065 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -783,12 +783,12 @@
</node>
<node oor:name="Migration">
<node oor:name="SupportedVersions">
- <node oor:name="OpenOffice.org3+OpenOffice.org2+StarOffice8+StarSuite8" oor:op="replace">
+ <node oor:name="OpenOffice.org3+OpenOffice.org2+StarOffice8+StarSuite8+Libreoffice3" oor:op="replace">
<prop oor:name="Priority">
<value>10</value>
</prop>
<prop oor:name="VersionIdentifiers">
- <value oor:separator=",">Openofice.org 3=openoffice.org/3,OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8</value>
+ <value oor:separator=",">Libreoffice 3=libreoffice/3,Openofice.org 3=openoffice.org/3,OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8</value>
</prop>
<node oor:name="MigrationSteps">
<node oor:name="Datasources" oor:op="replace">