From 837254a92cd4d158bb2210caeb3a0abe28f8c2b2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Wed, 23 Sep 2009 21:51:00 -0500 Subject: Moved many HippoGridManager methods defs out of the header. There's no good reason for these to be in the header, it just breaks encapsulation for no significant gain. --- linden/indra/newview/hippoGridManager.cpp | 211 +++++++++++++++++++++++++++++- linden/indra/newview/hippoGridManager.h | 91 +++++++------ 2 files changed, 254 insertions(+), 48 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp index 2143a40..ffac92d 100644 --- a/linden/indra/newview/hippoGridManager.cpp +++ b/linden/indra/newview/hippoGridManager.cpp @@ -48,6 +48,109 @@ HippoGridInfo::HippoGridInfo(const std::string &gridNick) : } +// ******************************************************************** +// Getters + +HippoGridInfo::Platform HippoGridInfo::getPlatform() +{ + return mPlatform; +} + +bool HippoGridInfo::isOpenSimulator() const +{ + return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM); +} + +bool HippoGridInfo::isSecondLife() const +{ + return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE); +} + +const std::string& HippoGridInfo::getGridNick() const +{ + return mGridNick; +} + +const std::string& HippoGridInfo::getGridName() const +{ + return mGridName; +} + +const std::string& HippoGridInfo::getLoginUri() const +{ + return mLoginUri; +} + +const std::string& HippoGridInfo::getLoginPage() const +{ + return mLoginPage; +} + +const std::string& HippoGridInfo::getHelperUri() const +{ + return mHelperUri; +} + +const std::string& HippoGridInfo::getWebSite() const +{ + return mWebSite; +} + +const std::string& HippoGridInfo::getSupportUrl() const +{ + return mSupportUrl; +} + +const std::string& HippoGridInfo::getRegisterUrl() const +{ + return mRegisterUrl; +} + +const std::string& HippoGridInfo::getPasswordUrl() const +{ + return mPasswordUrl; +} + +const std::string& HippoGridInfo::getSearchUrl() const +{ + return mSearchUrl; +} + +const std::string& HippoGridInfo::getFirstName() const +{ + return mFirstName; +} + +const std::string& HippoGridInfo::getLastName() const +{ + return mLastName; +} + +const std::string& HippoGridInfo::getAvatarPassword() const +{ + return mAvatarPassword; +} + +bool HippoGridInfo::isRenderCompat() const +{ + return mRenderCompat; +} + +const std::string& HippoGridInfo::getCurrencySymbol() const +{ + return mCurrencySymbol; +} + +const std::string& HippoGridInfo::getRealCurrencySymbol() const +{ + return mRealCurrencySymbol; +} + + + +// ******************************************************************** +// Setters + void HippoGridInfo::setPlatform(Platform platform) { mPlatform = platform; @@ -71,6 +174,89 @@ void HippoGridInfo::setPlatform(const std::string &platform) } } +void HippoGridInfo::setGridName(const std::string &gridName) +{ + mGridName = gridName; +} + +void HippoGridInfo::setLoginUri(const std::string &loginUri) +{ + mLoginUri = loginUri; + cleanUpUri(mLoginUri); +} + +void HippoGridInfo::setLoginPage(const std::string &loginPage) +{ + mLoginPage = loginPage; +} + +void HippoGridInfo::setHelperUri(const std::string &helperUri) +{ + mHelperUri = helperUri; + cleanUpUri(mHelperUri); +} + +void HippoGridInfo::setWebSite(const std::string &website) +{ + mWebSite = website; +} + +void HippoGridInfo::setSupportUrl(const std::string &url) +{ + mSupportUrl = url; +} + +void HippoGridInfo::setRegisterUrl(const std::string &url) +{ + mRegisterUrl = url; +} + +void HippoGridInfo::setPasswordUrl(const std::string &url) +{ + mPasswordUrl = url; +} + +void HippoGridInfo::setSearchUrl(const std::string &url) +{ + mSearchUrl = url; +} + +void HippoGridInfo::setFirstName(const std::string &firstName) +{ + mFirstName = firstName; +} + +void HippoGridInfo::setLastName(const std::string &lastName) +{ + mLastName = lastName; +} + +void HippoGridInfo::setAvatarPassword(const std::string &avatarPassword) +{ + mAvatarPassword = avatarPassword; +} + +void HippoGridInfo::setRenderCompat(bool compat) +{ + mRenderCompat = compat; +} + +void HippoGridInfo::setCurrencySymbol(const std::string &sym) +{ + mCurrencySymbol = sym.substr(0, 3); +} + +void HippoGridInfo::setRealCurrencySymbol(const std::string &sym) +{ + mRealCurrencySymbol = sym.substr(0, 3); +} + +void HippoGridInfo::setDirectoryFee(int fee) +{ + mDirectoryFee = fee; +} + + // ******************************************************************** // Grid Info @@ -355,7 +541,7 @@ void HippoGridManager::discardAndReload() // ******************************************************************** // Public Access -HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const +HippoGridInfo* HippoGridManager::getGrid(const std::string &grid) const { std::map::const_iterator it; it = mGridInfo.find(grid); @@ -367,7 +553,13 @@ HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const } -HippoGridInfo *HippoGridManager::getCurrentGrid() const +HippoGridInfo* HippoGridManager::getConnectedGrid() const +{ + return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); +} + + +HippoGridInfo* HippoGridManager::getCurrentGrid() const { HippoGridInfo *grid = getGrid(mCurrentGrid); if (grid) { @@ -377,6 +569,21 @@ HippoGridInfo *HippoGridManager::getCurrentGrid() const } } +const std::string& HippoGridManager::getDefaultGridNick() const +{ + return mDefaultGrid; +} + +const std::string& HippoGridManager::getCurrentGridNick() const +{ + return mCurrentGrid; +} + +void HippoGridManager::setCurrentGridAsConnected() +{ + mConnectedGrid = getCurrentGrid(); +} + void HippoGridManager::addGrid(HippoGridInfo *grid) { diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h index cd90ac1..de69e5b 100644 --- a/linden/indra/newview/hippoGridManager.h +++ b/linden/indra/newview/hippoGridManager.h @@ -35,51 +35,50 @@ public: explicit HippoGridInfo(const std::string &gridNick); - Platform getPlatform() const { return mPlatform; } - const std::string &getGridNick() const { return mGridNick; } - const std::string &getGridName() const { return mGridName; } - const std::string &getLoginUri() const { return mLoginUri; } - const std::string &getLoginPage() const { return mLoginPage; } - const std::string &getHelperUri() const { return mHelperUri; } - const std::string &getWebSite() const { return mWebSite; } - const std::string &getSupportUrl() const { return mSupportUrl; } - const std::string &getRegisterUrl() const { return mRegisterUrl; } - const std::string &getPasswordUrl() const { return mPasswordUrl; } - const std::string &getSearchUrl() const { return mSearchUrl; } - const std::string &getFirstName() const { return mFirstName; } - const std::string &getLastName() const { return mLastName; } - const std::string &getAvatarPassword() const { return mAvatarPassword; } + Platform getPlatform(); + bool isOpenSimulator() const; + bool isSecondLife() const; + const std::string& getGridNick() const; + const std::string& getGridName() const; + const std::string& getLoginUri() const; + const std::string& getLoginPage() const; + const std::string& getHelperUri() const; + const std::string& getWebSite() const; + const std::string& getSupportUrl() const; + const std::string& getRegisterUrl() const; + const std::string& getPasswordUrl() const; + const std::string& getSearchUrl() const; + const std::string& getFirstName() const; + const std::string& getLastName() const; + const std::string& getAvatarPassword() const; std::string getSearchUrl(SearchType ty) const; - bool isRenderCompat() const { return mRenderCompat; } + bool isRenderCompat() const; - const std::string &getCurrencySymbol() const { return mCurrencySymbol; } - const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; } - std::string getUploadFee() const; - std::string getGroupCreationFee() const; - std::string getDirectoryFee() const; - - bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); } - bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); } + const std::string& getCurrencySymbol() const; + const std::string& getRealCurrencySymbol() const; + std::string getUploadFee() const; + std::string getGroupCreationFee() const; + std::string getDirectoryFee() const; void setPlatform (const std::string &platform); void setPlatform (Platform platform); - void setGridName (const std::string &gridName) { mGridName = gridName; } - void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); } - void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; } - void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); } - void setWebSite (const std::string &website) { mWebSite = website; } - void setSupportUrl(const std::string &url) { mSupportUrl = url; } - void setRegisterUrl(const std::string &url) { mRegisterUrl = url; } - void setPasswordUrl(const std::string &url) { mPasswordUrl = url; } - void setSearchUrl(const std::string &url) { mSearchUrl = url; } - void setRenderCompat(bool compat) { mRenderCompat = compat; } - void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - void setLastName(const std::string &lastName) { mLastName = lastName; } - void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; } - - void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); } - void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); } - void setDirectoryFee(int fee) { mDirectoryFee = fee; } + void setGridName (const std::string &gridName); + void setLoginUri (const std::string &loginUri); + void setLoginPage(const std::string &loginPage); + void setHelperUri(const std::string &helperUri); + void setWebSite (const std::string &website); + void setSupportUrl(const std::string &url); + void setRegisterUrl(const std::string &url); + void setPasswordUrl(const std::string &url); + void setSearchUrl(const std::string &url); + void setRenderCompat(bool compat); + void setFirstName(const std::string &firstName); + void setLastName(const std::string &lastName); + void setAvatarPassword(const std::string &avatarPassword); + + void setCurrencySymbol(const std::string &sym); + void setRealCurrencySymbol(const std::string &sym); + void setDirectoryFee(int fee); bool retrieveGridInfo(); @@ -137,15 +136,15 @@ public: void saveFile(); void discardAndReload(); - HippoGridInfo *getGrid(const std::string &grid) const; - HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); } - HippoGridInfo *getCurrentGrid() const; - const std::string &getDefaultGridNick() const { return mDefaultGrid; } - const std::string &getCurrentGridNick() const { return mCurrentGrid; } + HippoGridInfo* getGrid(const std::string &grid) const; + HippoGridInfo* getConnectedGrid() const; + HippoGridInfo* getCurrentGrid() const; + const std::string& getDefaultGridNick() const; + const std::string& getCurrentGridNick() const; void setDefaultGrid(const std::string &grid); void setCurrentGrid(const std::string &grid); - void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); } + void setCurrentGridAsConnected(); void addGrid(HippoGridInfo *grid); void deleteGrid(const std::string &grid); -- cgit v1.1