diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-06-14 13:05:46 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-06-14 13:05:46 +0200 |
commit | aa892d2b432319f949d0b45a0529036984f1aad7 (patch) | |
tree | 76915ebb9903a33aeff428de620b01d63960ff87 /ucbhelper | |
parent | dc2d434687f701884f7c11e130669f63fb606074 (diff) |
Fix support for "dummy" content providers
...and use it so that private: URLs are not needlessly passed to the gio or
gnome-vfs "catch-all" UCPs.
Change-Id: I85d100567d1641130449fe21ccd072bcc0ec0979
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/provider/registerucb.cxx | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/ucbhelper/source/provider/registerucb.cxx b/ucbhelper/source/provider/registerucb.cxx index bce135f0c812..a7b4384d61b1 100644 --- a/ucbhelper/source/provider/registerucb.cxx +++ b/ucbhelper/source/provider/registerucb.cxx @@ -58,31 +58,35 @@ registerAtUcb( copy(RTL_CONSTASCII_LENGTH("{noproxy}")) : rArguments); - // First, try to instantiate proxy for provider: uno::Reference< ucb::XContentProvider > xProvider; - if (!bNoProxy) + + if (!rName.isEmpty()) { - uno::Reference< ucb::XContentProviderFactory > xProxyFactory; - try + // First, try to instantiate proxy for provider: + if (!bNoProxy) { - xProxyFactory = ucb::ContentProviderProxyFactory::create( rxContext ); + uno::Reference< ucb::XContentProviderFactory > xProxyFactory; + try + { + xProxyFactory = ucb::ContentProviderProxyFactory::create( rxContext ); + } + catch (uno::Exception const &) {} + OSL_ENSURE(xProxyFactory.is(), "No ContentProviderProxyFactory"); + if (xProxyFactory.is()) + xProvider = xProxyFactory->createContentProvider(rName); } - catch (uno::Exception const &) {} - OSL_ENSURE(xProxyFactory.is(), "No ContentProviderProxyFactory"); - if (xProxyFactory.is()) - xProvider = xProxyFactory->createContentProvider(rName); - } - // Then, try to instantiate provider directly: - if (!xProvider.is()) - try - { - xProvider = uno::Reference< ucb::XContentProvider >( - rxContext->getServiceManager()->createInstanceWithContext(rName, rxContext), - uno::UNO_QUERY); - } - catch (uno::RuntimeException const &) { throw; } - catch (uno::Exception const &) {} + // Then, try to instantiate provider directly: + if (!xProvider.is()) + try + { + xProvider = uno::Reference< ucb::XContentProvider >( + rxContext->getServiceManager()->createInstanceWithContext(rName, rxContext), + uno::UNO_QUERY); + } + catch (uno::RuntimeException const &) { throw; } + catch (uno::Exception const &) {} + } uno::Reference< ucb::XParameterizedContentProvider > xParameterized(xProvider, uno::UNO_QUERY); @@ -104,7 +108,7 @@ registerAtUcb( } bool bSuccess = false; - if (rManager.is() && xProvider.is()) + if (rManager.is() && (rName.isEmpty() || xProvider.is())) { try { |