summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2001-10-31 13:57:43 +0000
committerAndreas Bille <abi@openoffice.org>2001-10-31 13:57:43 +0000
commit33b162894cf4c1260b28263159a00194b042713f (patch)
treef960d47a3d972a366a48358c3fd88fe2270730a3 /ucb
parent3885a522ca616a8546409304f518deec81cae86a (diff)
#80891#
Now the FileContentProvider has the property HomeDirectory
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/file/prov.cxx43
-rw-r--r--ucb/source/ucp/file/prov.hxx7
2 files changed, 38 insertions, 12 deletions
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index a829c3c7c2ba..61ea2932c382 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prov.cxx,v $
*
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
*
- * last change: $Author: hr $ $Date: 2001-10-24 16:20:07 $
+ * last change: $Author: abi $ $Date: 2001-10-31 14:57:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,6 +58,9 @@
*
*
************************************************************************/
+#ifndef _OSL_SECURITY_HXX_
+#include <osl/security.hxx>
+#endif
#ifndef _OSL_FILE_HXX_
#include <osl/file.hxx>
#endif
@@ -640,17 +643,22 @@ private:
XPropertySetInfoImpl2::XPropertySetInfoImpl2()
- : m_seq( 2 )
+ : m_seq( 3 )
{
m_seq[0] = Property( rtl::OUString::createFromAscii( "HostName" ),
- -1,
- getCppuType( static_cast< rtl::OUString* >( 0 ) ),
- PropertyAttribute::READONLY );
+ -1,
+ getCppuType( static_cast< rtl::OUString* >( 0 ) ),
+ PropertyAttribute::READONLY );
+
+ m_seq[1] = Property( rtl::OUString::createFromAscii( "HomeDirectory" ),
+ -1,
+ getCppuType( static_cast< rtl::OUString* >( 0 ) ),
+ PropertyAttribute::READONLY );
- m_seq[1] = Property( rtl::OUString::createFromAscii( "FileSystemNotation" ),
- -1,
- getCppuType( static_cast< sal_Int32* >( 0 ) ),
- PropertyAttribute::READONLY );
+ m_seq[2] = Property( rtl::OUString::createFromAscii( "FileSystemNotation" ),
+ -1,
+ getCppuType( static_cast< sal_Int32* >( 0 ) ),
+ PropertyAttribute::READONLY );
}
@@ -730,6 +738,7 @@ XPropertySetInfoImpl2::hasPropertyByName(
void SAL_CALL FileProvider::initProperties( void )
{
+ vos::OGuard aGuard( m_aMutex );
if( ! m_xPropertySetInfo.is() )
{
osl_getLocalHostname( &m_HostName.pData );
@@ -741,6 +750,13 @@ void SAL_CALL FileProvider::initProperties( void )
#else
m_FileSystemNotation = FileSystemNotation::UNKNOWN_NOTATION;
#endif
+ if( ! m_pMyShell->m_bFaked )
+ {
+ osl::Security aSecurity;
+ aSecurity.getHomeDir( m_HomeDirectory );
+ }
+ else
+ m_HomeDirectory = rtl::OUString::createFromAscii( "file:///user/work" );
// static const sal_Int32 UNKNOWN_NOTATION = (sal_Int32)0;
// static const sal_Int32 UNIX_NOTATION = (sal_Int32)1;
@@ -774,6 +790,7 @@ FileProvider::setPropertyValue( const rtl::OUString& aPropertyName,
RuntimeException )
{
if( aPropertyName.compareToAscii( "FileSystemNotation" ) == 0 ||
+ aPropertyName.compareToAscii( "HomeDirectory" ) == 0 ||
aPropertyName.compareToAscii( "HostName" ) == 0 )
return;
else
@@ -796,6 +813,12 @@ FileProvider::getPropertyValue(
aAny <<= m_FileSystemNotation;
return aAny;
}
+ else if( aPropertyName.compareToAscii( "HomeDirectory" ) == 0 )
+ {
+ Any aAny;
+ aAny <<= m_HomeDirectory;
+ return aAny;
+ }
else if( aPropertyName.compareToAscii( "HostName" ) == 0 )
{
Any aAny;
diff --git a/ucb/source/ucp/file/prov.hxx b/ucb/source/ucp/file/prov.hxx
index caa10d968720..9858122b6258 100644
--- a/ucb/source/ucp/file/prov.hxx
+++ b/ucb/source/ucp/file/prov.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prov.hxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: hr $ $Date: 2001-10-24 16:20:07 $
+ * last change: $Author: abi $ $Date: 2001-10-31 14:57:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -279,8 +279,11 @@ namespace fileaccess {
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory;
void SAL_CALL initProperties( void );
+ vos::OMutex m_aMutex;
rtl::OUString m_HostName;
+ rtl::OUString m_HomeDirectory;
sal_Int32 m_FileSystemNotation;
+
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > m_xPropertySetInfo;
shell* m_pMyShell;