diff options
author | Jacek Antonelli | 2009-09-23 21:51:00 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-09-25 22:39:18 -0500 |
commit | 837254a92cd4d158bb2210caeb3a0abe28f8c2b2 (patch) | |
tree | 7396ed711c4e5116580330b7b515e1f91428462a /linden/indra/newview/hippoGridManager.cpp | |
parent | Merge branch 'gridmanager' into next (diff) | |
download | meta-impy-837254a92cd4d158bb2210caeb3a0abe28f8c2b2.zip meta-impy-837254a92cd4d158bb2210caeb3a0abe28f8c2b2.tar.gz meta-impy-837254a92cd4d158bb2210caeb3a0abe28f8c2b2.tar.bz2 meta-impy-837254a92cd4d158bb2210caeb3a0abe28f8c2b2.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/hippoGridManager.cpp | 211 |
1 files changed, 209 insertions, 2 deletions
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) : | |||
48 | } | 48 | } |
49 | 49 | ||
50 | 50 | ||
51 | // ******************************************************************** | ||
52 | // Getters | ||
53 | |||
54 | HippoGridInfo::Platform HippoGridInfo::getPlatform() | ||
55 | { | ||
56 | return mPlatform; | ||
57 | } | ||
58 | |||
59 | bool HippoGridInfo::isOpenSimulator() const | ||
60 | { | ||
61 | return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM); | ||
62 | } | ||
63 | |||
64 | bool HippoGridInfo::isSecondLife() const | ||
65 | { | ||
66 | return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE); | ||
67 | } | ||
68 | |||
69 | const std::string& HippoGridInfo::getGridNick() const | ||
70 | { | ||
71 | return mGridNick; | ||
72 | } | ||
73 | |||
74 | const std::string& HippoGridInfo::getGridName() const | ||
75 | { | ||
76 | return mGridName; | ||
77 | } | ||
78 | |||
79 | const std::string& HippoGridInfo::getLoginUri() const | ||
80 | { | ||
81 | return mLoginUri; | ||
82 | } | ||
83 | |||
84 | const std::string& HippoGridInfo::getLoginPage() const | ||
85 | { | ||
86 | return mLoginPage; | ||
87 | } | ||
88 | |||
89 | const std::string& HippoGridInfo::getHelperUri() const | ||
90 | { | ||
91 | return mHelperUri; | ||
92 | } | ||
93 | |||
94 | const std::string& HippoGridInfo::getWebSite() const | ||
95 | { | ||
96 | return mWebSite; | ||
97 | } | ||
98 | |||
99 | const std::string& HippoGridInfo::getSupportUrl() const | ||
100 | { | ||
101 | return mSupportUrl; | ||
102 | } | ||
103 | |||
104 | const std::string& HippoGridInfo::getRegisterUrl() const | ||
105 | { | ||
106 | return mRegisterUrl; | ||
107 | } | ||
108 | |||
109 | const std::string& HippoGridInfo::getPasswordUrl() const | ||
110 | { | ||
111 | return mPasswordUrl; | ||
112 | } | ||
113 | |||
114 | const std::string& HippoGridInfo::getSearchUrl() const | ||
115 | { | ||
116 | return mSearchUrl; | ||
117 | } | ||
118 | |||
119 | const std::string& HippoGridInfo::getFirstName() const | ||
120 | { | ||
121 | return mFirstName; | ||
122 | } | ||
123 | |||
124 | const std::string& HippoGridInfo::getLastName() const | ||
125 | { | ||
126 | return mLastName; | ||
127 | } | ||
128 | |||
129 | const std::string& HippoGridInfo::getAvatarPassword() const | ||
130 | { | ||
131 | return mAvatarPassword; | ||
132 | } | ||
133 | |||
134 | bool HippoGridInfo::isRenderCompat() const | ||
135 | { | ||
136 | return mRenderCompat; | ||
137 | } | ||
138 | |||
139 | const std::string& HippoGridInfo::getCurrencySymbol() const | ||
140 | { | ||
141 | return mCurrencySymbol; | ||
142 | } | ||
143 | |||
144 | const std::string& HippoGridInfo::getRealCurrencySymbol() const | ||
145 | { | ||
146 | return mRealCurrencySymbol; | ||
147 | } | ||
148 | |||
149 | |||
150 | |||
151 | // ******************************************************************** | ||
152 | // Setters | ||
153 | |||
51 | void HippoGridInfo::setPlatform(Platform platform) | 154 | void HippoGridInfo::setPlatform(Platform platform) |
52 | { | 155 | { |
53 | mPlatform = platform; | 156 | mPlatform = platform; |
@@ -71,6 +174,89 @@ void HippoGridInfo::setPlatform(const std::string &platform) | |||
71 | } | 174 | } |
72 | } | 175 | } |
73 | 176 | ||
177 | void HippoGridInfo::setGridName(const std::string &gridName) | ||
178 | { | ||
179 | mGridName = gridName; | ||
180 | } | ||
181 | |||
182 | void HippoGridInfo::setLoginUri(const std::string &loginUri) | ||
183 | { | ||
184 | mLoginUri = loginUri; | ||
185 | cleanUpUri(mLoginUri); | ||
186 | } | ||
187 | |||
188 | void HippoGridInfo::setLoginPage(const std::string &loginPage) | ||
189 | { | ||
190 | mLoginPage = loginPage; | ||
191 | } | ||
192 | |||
193 | void HippoGridInfo::setHelperUri(const std::string &helperUri) | ||
194 | { | ||
195 | mHelperUri = helperUri; | ||
196 | cleanUpUri(mHelperUri); | ||
197 | } | ||
198 | |||
199 | void HippoGridInfo::setWebSite(const std::string &website) | ||
200 | { | ||
201 | mWebSite = website; | ||
202 | } | ||
203 | |||
204 | void HippoGridInfo::setSupportUrl(const std::string &url) | ||
205 | { | ||
206 | mSupportUrl = url; | ||
207 | } | ||
208 | |||
209 | void HippoGridInfo::setRegisterUrl(const std::string &url) | ||
210 | { | ||
211 | mRegisterUrl = url; | ||
212 | } | ||
213 | |||
214 | void HippoGridInfo::setPasswordUrl(const std::string &url) | ||
215 | { | ||
216 | mPasswordUrl = url; | ||
217 | } | ||
218 | |||
219 | void HippoGridInfo::setSearchUrl(const std::string &url) | ||
220 | { | ||
221 | mSearchUrl = url; | ||
222 | } | ||
223 | |||
224 | void HippoGridInfo::setFirstName(const std::string &firstName) | ||
225 | { | ||
226 | mFirstName = firstName; | ||
227 | } | ||
228 | |||
229 | void HippoGridInfo::setLastName(const std::string &lastName) | ||
230 | { | ||
231 | mLastName = lastName; | ||
232 | } | ||
233 | |||
234 | void HippoGridInfo::setAvatarPassword(const std::string &avatarPassword) | ||
235 | { | ||
236 | mAvatarPassword = avatarPassword; | ||
237 | } | ||
238 | |||
239 | void HippoGridInfo::setRenderCompat(bool compat) | ||
240 | { | ||
241 | mRenderCompat = compat; | ||
242 | } | ||
243 | |||
244 | void HippoGridInfo::setCurrencySymbol(const std::string &sym) | ||
245 | { | ||
246 | mCurrencySymbol = sym.substr(0, 3); | ||
247 | } | ||
248 | |||
249 | void HippoGridInfo::setRealCurrencySymbol(const std::string &sym) | ||
250 | { | ||
251 | mRealCurrencySymbol = sym.substr(0, 3); | ||
252 | } | ||
253 | |||
254 | void HippoGridInfo::setDirectoryFee(int fee) | ||
255 | { | ||
256 | mDirectoryFee = fee; | ||
257 | } | ||
258 | |||
259 | |||
74 | 260 | ||
75 | // ******************************************************************** | 261 | // ******************************************************************** |
76 | // Grid Info | 262 | // Grid Info |
@@ -355,7 +541,7 @@ void HippoGridManager::discardAndReload() | |||
355 | // ******************************************************************** | 541 | // ******************************************************************** |
356 | // Public Access | 542 | // Public Access |
357 | 543 | ||
358 | HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const | 544 | HippoGridInfo* HippoGridManager::getGrid(const std::string &grid) const |
359 | { | 545 | { |
360 | std::map<std::string, HippoGridInfo*>::const_iterator it; | 546 | std::map<std::string, HippoGridInfo*>::const_iterator it; |
361 | it = mGridInfo.find(grid); | 547 | it = mGridInfo.find(grid); |
@@ -367,7 +553,13 @@ HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const | |||
367 | } | 553 | } |
368 | 554 | ||
369 | 555 | ||
370 | HippoGridInfo *HippoGridManager::getCurrentGrid() const | 556 | HippoGridInfo* HippoGridManager::getConnectedGrid() const |
557 | { | ||
558 | return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); | ||
559 | } | ||
560 | |||
561 | |||
562 | HippoGridInfo* HippoGridManager::getCurrentGrid() const | ||
371 | { | 563 | { |
372 | HippoGridInfo *grid = getGrid(mCurrentGrid); | 564 | HippoGridInfo *grid = getGrid(mCurrentGrid); |
373 | if (grid) { | 565 | if (grid) { |
@@ -377,6 +569,21 @@ HippoGridInfo *HippoGridManager::getCurrentGrid() const | |||
377 | } | 569 | } |
378 | } | 570 | } |
379 | 571 | ||
572 | const std::string& HippoGridManager::getDefaultGridNick() const | ||
573 | { | ||
574 | return mDefaultGrid; | ||
575 | } | ||
576 | |||
577 | const std::string& HippoGridManager::getCurrentGridNick() const | ||
578 | { | ||
579 | return mCurrentGrid; | ||
580 | } | ||
581 | |||
582 | void HippoGridManager::setCurrentGridAsConnected() | ||
583 | { | ||
584 | mConnectedGrid = getCurrentGrid(); | ||
585 | } | ||
586 | |||
380 | 587 | ||
381 | void HippoGridManager::addGrid(HippoGridInfo *grid) | 588 | void HippoGridManager::addGrid(HippoGridInfo *grid) |
382 | { | 589 | { |