summaryrefslogtreecommitdiff
path: root/desktop/source/migration/migration.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-03-01 22:27:56 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-03-01 22:33:31 +0100
commit76e0d695a41326a5583dbc9702e0ce3b8219b514 (patch)
tree38de5d0702c9fde0e77b281acf9563844dfe3fb6 /desktop/source/migration/migration.cxx
parent780f5bf5b177f93c8fd9ebd7ff1a322885074c8c (diff)
Move migrateSettingsIfNecessary into create_user_install
...so that it is only done once (see mail thread starting at <http://lists.freedesktop.org/archives/libreoffice/2012-February/027058.html> "User installation migrated onto itself"). Also, checking for the existence of an old user installation needed to change from ucbhelper::Content::isDocument to osl::FileStatus::getFileType, as the UCB is not yet initialized at the time migrateSettingsIfNecessary is now called.
Diffstat (limited to 'desktop/source/migration/migration.cxx')
-rw-r--r--desktop/source/migration/migration.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 4df893a4057c..dd73e3a84400 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -44,7 +44,6 @@
#include <tools/urlobj.hxx>
#include <osl/file.hxx>
#include <osl/mutex.hxx>
-#include <ucbhelper/content.hxx>
#include <osl/security.hxx>
#include <unotools/configmgr.hxx>
@@ -576,17 +575,17 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions)
aUserInst += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
#endif
aUserInst += aProfileName;
- try
+ rtl::OUString url(
+ INetURLObject(aUserInst).GetMainURL(INetURLObject::NO_DECODE));
+ osl::DirectoryItem item;
+ osl::FileStatus stat(osl_FileStatus_Mask_Type);
+ if (osl::DirectoryItem::get(url, item) == osl::FileBase::E_None
+ && item.getFileStatus(stat) == osl::FileBase::E_None
+ && stat.getFileType() == osl::FileStatus::Directory)
{
- INetURLObject aObj(aUserInst);
- ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () );
- aCnt.isDocument();
- aInfo.userdata = aObj.GetMainURL( INetURLObject::NO_DECODE );
+ aInfo.userdata = url;
aInfo.productname = aVersion;
}
- catch (const uno::Exception&)
- {
- }
}
++i_ver;
}