On 08/06/11 14:19, Noel Power wrote:
On 08/06/11 13:55, Takeshi Abe wrote:

OK, so do you mean libs-core/desktop/source/migration?, which functionality
I have not yet recognized clearly.
It would be great if anyone familiar with the code suggests a starting
point to dig into.
I *think* this ( see attached patch ) will fix it, not had a chance to test it yet
Well that patch isn't quite enough :-( it seems the migration process doesn't cater for the config directory changing so when looking for candidates to migrate when creating a new user dir it looks relative to the new config directory ( e.g. ~/.config ) and of course finds nothing.

I guess we can easily hack around this by tweaking the config directory returned ( see attached ) and this seems ok for a 3.4 release where there can only be user configurations in $HOME. However subsequent releases >= 4.0 will probably have to start making things more complicated by searching the old ( for openoffice configurations ) and new & old directories for libreoffice (3) configurations, thoughts
diff --git desktop/source/migration/migration.cxx desktop/source/migration/migration.cxx
index 8248af0..2280eb4 100644
--- desktop/source/migration/migration.cxx
+++ 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,11 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions)
         {
             ::rtl::OUString aUserInst;
             osl::Security().getConfigDir( aUserInst );
+#if defined UNX && ! defined MACOSX
+            // cater for XDG_CONFIG_HOME change
+            if ( aUserInst.endsWithAsciiL( XDG_CONFIG_PART, sizeof( XDG_CONFIG_PART ) - 1 )  )
+                aUserInst = aUserInst.copy( 0, aUserInst.getLength() - sizeof(  XDG_CONFIG_PART ) + 2 );
+#endif
             if ( aUserInst.getLength() && aUserInst[ aUserInst.getLength()-1 ] != '/' )
                 aUserInst += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
 #if defined UNX && ! defined MACOSX
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to