diff options
Diffstat (limited to 'connectivity/source/drivers/mozab/bootstrap')
-rw-r--r-- | connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx | 36 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx | 10 |
2 files changed, 25 insertions, 21 deletions
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx index 1adb8993fde0..b2ef4d9ffade 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx @@ -26,15 +26,21 @@ namespace connectivity { namespace mozab { - ProfileStruct::ProfileStruct(MozillaProductType aProduct, const OUString& aProfileName, - const OUString& aProfilePath - ) + ProfileStruct::ProfileStruct() + : product(css::mozilla::MozillaProductType_Default) { - product=aProduct; - profileName = aProfileName; - profilePath = aProfilePath; } - const OUString& ProfileStruct::getProfilePath() + + ProfileStruct::ProfileStruct(MozillaProductType aProduct, + const OUString& aProfileName, + const OUString& aProfilePath) + : product(aProduct) + , profileName(aProfileName) + , profilePath(aProfilePath) + { + } + + const OUString& ProfileStruct::getProfilePath() const { return profilePath; } @@ -42,6 +48,7 @@ namespace connectivity ProfileAccess::~ProfileAccess() { } + ProfileAccess::ProfileAccess() { LoadProductsInfo(); @@ -121,10 +128,7 @@ namespace connectivity fullProfilePath = profilePath; } - ProfileStruct* profileItem = new ProfileStruct(product,profileName, - fullProfilePath - ); - rProduct.mProfileList[profileName] = profileItem; + rProduct.mProfileList[profileName] = ProfileStruct(product,profileName,fullProfilePath); sal_Int32 isDefault = 0; if (!sIsDefault.isEmpty()) @@ -149,7 +153,7 @@ namespace connectivity return OUString(); } else - return rProduct.mProfileList[profileName]->getProfilePath(); + return rProduct.mProfileList[profileName].getProfilePath(); } ::sal_Int32 ProfileAccess::getProfileCount( css::mozilla::MozillaProductType product) @@ -168,8 +172,8 @@ namespace connectivity itor != rProduct.mProfileList.end(); ++itor) { - ProfileStruct * aProfile = (*itor).second; - list[i] = aProfile->getProfileName(); + const ProfileStruct& rProfile = (*itor).second; + list[i] = rProfile.getProfileName(); i++; } @@ -190,8 +194,8 @@ namespace connectivity //there are not any profiles return OUString(); } - ProfileStruct * aProfile = (*rProduct.mProfileList.begin()).second; - return aProfile->getProfileName(); + const ProfileStruct& rProfile = (*rProduct.mProfileList.begin()).second; + return rProfile.getProfileName(); } bool ProfileAccess::isProfileLocked( css::mozilla::MozillaProductType product, const OUString& profileName ) { diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx index 6cb9efe8edf4..395724ff0790 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx @@ -39,7 +39,7 @@ namespace connectivity class ProfileStruct; } } -typedef std::map < OUString, ::connectivity::mozab::ProfileStruct* > ProfileList; +typedef std::map<OUString, ::connectivity::mozab::ProfileStruct> ProfileList; namespace connectivity { namespace mozab @@ -47,10 +47,10 @@ namespace connectivity class ProfileStruct { public: - ProfileStruct(MozillaProductType aProduct, const OUString& aProfileName, - const OUString &aProfilePath); - const OUString& getProfileName(){ return profileName;} - const OUString& getProfilePath(); + ProfileStruct(); + ProfileStruct(MozillaProductType aProduct, const OUString& aProfileName, const OUString &aProfilePath); + const OUString& getProfileName() const { return profileName;} + const OUString& getProfilePath() const; private: MozillaProductType product; OUString profileName; |