#81164# retrieve the user name from Settings
This commit is contained in:
parent
ac35738293
commit
a414f86a09
3 changed files with 29 additions and 11 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: confprovider2.cxx,v $
|
||||
*
|
||||
* $Revision: 1.9 $
|
||||
* $Revision: 1.10 $
|
||||
*
|
||||
* last change: $Author: fs $ $Date: 2000-12-01 13:55:35 $
|
||||
* last change: $Author: dg $ $Date: 2000-12-03 11:45:59 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -189,7 +189,7 @@ namespace configmgr
|
|||
IConfigSession* pNewSession = m_aModule.connect(_rSettings);
|
||||
if (!pNewSession)
|
||||
throw uno::Exception(::rtl::OUString::createFromAscii("Could not connect to the configuration registry. Please check your settings."), NULL);
|
||||
m_pImpl = new OConfigurationProviderImpl(this, pNewSession, m_aModule);
|
||||
m_pImpl = new OConfigurationProviderImpl(this, pNewSession, m_aModule, _rSettings);
|
||||
m_aModule.setProvider(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: confproviderimpl2.cxx,v $
|
||||
*
|
||||
* $Revision: 1.11 $
|
||||
* $Revision: 1.12 $
|
||||
*
|
||||
* last change: $Author: lla $ $Date: 2000-11-30 15:45:28 $
|
||||
* last change: $Author: dg $ $Date: 2000-12-03 11:45:59 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -101,8 +101,8 @@ namespace configmgr
|
|||
//= OConfigurationProviderImpl
|
||||
//=============================================================================
|
||||
//-----------------------------------------------------------------------------------
|
||||
OConfigurationProviderImpl::OConfigurationProviderImpl(OConfigurationProvider* _pProvider, IConfigSession* _pSession, Module& _rModule)
|
||||
:OProviderImpl(_pProvider, _pSession, _rModule)
|
||||
OConfigurationProviderImpl::OConfigurationProviderImpl(OConfigurationProvider* _pProvider, IConfigSession* _pSession, Module& _rModule, const ConnectionSettings& _rSettings)
|
||||
:OProviderImpl(_pProvider, _pSession, _rModule, _rSettings)
|
||||
{
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: providerimpl.cxx,v $
|
||||
*
|
||||
* $Revision: 1.9 $
|
||||
* $Revision: 1.10 $
|
||||
*
|
||||
* last change: $Author: lla $ $Date: 2000-11-30 15:45:28 $
|
||||
* last change: $Author: dg $ $Date: 2000-12-03 11:45:59 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -68,6 +68,10 @@
|
|||
#include "noderef.hxx"
|
||||
#include "objectregistry.hxx"
|
||||
|
||||
#ifndef CONFIGMGR_BOOTSTRAP_HXX_
|
||||
#include "bootstrap.hxx"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIGMGR_API_PROVIDER_HXX_
|
||||
#include "provider.hxx"
|
||||
#endif
|
||||
|
@ -141,7 +145,7 @@ namespace configmgr
|
|||
//-----------------------------------------------------------------------------
|
||||
OProviderImpl::OProviderImpl(OProvider* _pProvider,
|
||||
IConfigSession* _pSession,
|
||||
Module& _rModule)
|
||||
Module& _rModule, const ConnectionSettings& _rSettings)
|
||||
:m_xDefaultOptions(new OOptions(_rModule.getConverter()))
|
||||
,m_pTreeMgr(new TreeManager(_pSession, m_xDefaultOptions))
|
||||
,m_pNewProviders(0)
|
||||
|
@ -157,7 +161,21 @@ namespace configmgr
|
|||
rtl::OUString sDefaultLocale(ssDefaultLocale);
|
||||
try
|
||||
{
|
||||
ISubtree* pSubTree = m_pTreeMgr->requestSubtree(ssUserProfile, m_xDefaultOptions);
|
||||
// if we have a user name, we have to add it for the request and we remember it for the session
|
||||
rtl::OUString sUserName;
|
||||
rtl::OUString sProfile;
|
||||
if (_rSettings.hasUser())
|
||||
{
|
||||
// the username is also part of the connection settings
|
||||
m_xDefaultOptions->setUser(_rSettings.getUser());
|
||||
|
||||
sProfile = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("["));
|
||||
sProfile += _rSettings.getUser();
|
||||
sProfile += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]/"));
|
||||
}
|
||||
sProfile += ssUserProfile;
|
||||
|
||||
ISubtree* pSubTree = m_pTreeMgr->requestSubtree(sProfile, m_xDefaultOptions);
|
||||
if (pSubTree)
|
||||
{
|
||||
INode* pNode = pSubTree->getChild(ssInternational);
|
||||
|
|
Loading…
Reference in a new issue