diff options
author | David Ostrovsky <david@ostrovsky.org> | 2012-09-30 19:53:40 +0200 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2012-10-10 13:35:13 +0530 |
commit | 36026a6ae5d2f42db5fa262a358a3bc8e33e036c (patch) | |
tree | b27b7da466dde7e719f1c4db0fb50516470021dc /connectivity/source/drivers/mork/MConnection.cxx | |
parent | f6739073edc1b593035f25becbd0e9d6d536ef0c (diff) |
mork driver: add list tables and unit test
Change-Id: I594b24341eb38c05523f578c1dc2e43d90544f30
Diffstat (limited to 'connectivity/source/drivers/mork/MConnection.cxx')
-rw-r--r-- | connectivity/source/drivers/mork/MConnection.cxx | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index a35badddc2c8..47525d2f946b 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -85,11 +85,11 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV nLen = url.indexOf(':',nLen+1); OSL_ENSURE( url.copy( 0, nLen ) == "sdbc:address", "OConnection::construct: invalid start of the URI - should never have survived XDriver::acceptsURL!" ); - ::rtl::OUString aAddrbookURI(url.copy(nLen+1)); + OUString aAddrbookURI(url.copy(nLen+1)); // Get Scheme nLen = aAddrbookURI.indexOf(':'); - ::rtl::OUString aAddrbookScheme; - ::rtl::OUString sAdditionalInfo; + OUString aAddrbookScheme; + OUString sAdditionalInfo; if ( nLen == -1 ) { // There isn't any subschema: - but could be just subschema @@ -112,13 +112,23 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV SAL_INFO("connectivity.mork", "URI = " << aAddrbookURI ); SAL_INFO("connectivity.mork", "Scheme = " << aAddrbookScheme ); - ::rtl::OUString defaultProfile = m_pProfileAccess->getDefaultProfile(::com::sun::star::mozilla::MozillaProductType_Thunderbird); - SAL_INFO("connectivity.mork", "DefaultProfile: " << defaultProfile); + OUString path; + const OUString UNITTEST_URL = "thunderbird:unittest:"; + sal_Int32 unittestIndex = url.indexOf(UNITTEST_URL); - ::rtl::OUString path = m_pProfileAccess->getProfilePath(::com::sun::star::mozilla::MozillaProductType_Thunderbird, defaultProfile); - SAL_INFO("connectivity.mork", "ProfilePath: " << path); - - path += rtl::OUString( "/abook.mab" ); + // production? + if (unittestIndex == -1) + { + OUString defaultProfile = m_pProfileAccess->getDefaultProfile(::com::sun::star::mozilla::MozillaProductType_Thunderbird); + path = m_pProfileAccess->getProfilePath(::com::sun::star::mozilla::MozillaProductType_Thunderbird, defaultProfile); + SAL_INFO("connectivity.mork", "DefaultProfile: " << defaultProfile); + SAL_INFO("connectivity.mork", "ProfilePath: " << path); + path += rtl::OUString( "/abook.mab" ); + } + else + { + path = aAddrbookURI.replaceFirst(UNITTEST_URL, ""); + } SAL_INFO("connectivity.mork", "AdressbookPath: " << path); |