aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llurlwhitelist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llurlwhitelist.cpp')
-rw-r--r--linden/indra/newview/llurlwhitelist.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/linden/indra/newview/llurlwhitelist.cpp b/linden/indra/newview/llurlwhitelist.cpp
index 8992146..3a8c952 100644
--- a/linden/indra/newview/llurlwhitelist.cpp
+++ b/linden/indra/newview/llurlwhitelist.cpp
@@ -40,7 +40,7 @@ LLUrlWhiteList::LLUrlWhiteList () :
40 mLoaded ( false ), 40 mLoaded ( false ),
41 mFilename ( "url_whitelist.ini" ), 41 mFilename ( "url_whitelist.ini" ),
42 mUrlList ( 0 ), 42 mUrlList ( 0 ),
43 mUrlListIter ( 0 ) 43 mCurIndex ( 0 )
44{ 44{
45} 45}
46 46
@@ -121,10 +121,10 @@ bool LLUrlWhiteList::save ()
121 if ( file.is_open () ) 121 if ( file.is_open () )
122 { 122 {
123 // for each entry we have 123 // for each entry we have
124 for ( LLStringListIter iter = mUrlList.begin (); iter != mUrlList.end (); ++iter ) 124 for ( string_list_t::iterator iter = mUrlList.begin (); iter != mUrlList.end (); ++iter )
125 { 125 {
126 file << ( *iter ) << std::endl; 126 file << ( *iter ) << std::endl;
127 }; 127 }
128 128
129 file.close (); 129 file.close ();
130 130
@@ -140,8 +140,7 @@ bool LLUrlWhiteList::clear ()
140{ 140{
141 mUrlList.clear (); 141 mUrlList.clear ();
142 142
143 // invalidate iterator since we changed the contents 143 mCurIndex = 0;
144 mUrlListIter = mUrlList.end ();
145 144
146 return true; 145 return true;
147} 146}
@@ -175,7 +174,7 @@ bool LLUrlWhiteList::addItem ( const LLString& itemIn, bool saveAfterAdd )
175{ 174{
176 LLString item = url_cleanup(itemIn); 175 LLString item = url_cleanup(itemIn);
177 176
178 mUrlList.insert ( mUrlList.end (), item ); 177 mUrlList.push_back ( item );
179 178
180 // use this when all you want to do is call addItem ( ... ) where necessary 179 // use this when all you want to do is call addItem ( ... ) where necessary
181 if ( saveAfterAdd ) 180 if ( saveAfterAdd )
@@ -191,11 +190,8 @@ bool LLUrlWhiteList::getFirst ( LLString& valueOut )
191 if ( mUrlList.size () == 0 ) 190 if ( mUrlList.size () == 0 )
192 return false; 191 return false;
193 192
194 mUrlListIter = mUrlList.begin (); 193 mCurIndex = 0;
195 194 valueOut = mUrlList[mCurIndex++];
196 valueOut = * ( mUrlListIter );
197
198 ++mUrlListIter;
199 195
200 return true; 196 return true;
201} 197}
@@ -204,12 +200,10 @@ bool LLUrlWhiteList::getFirst ( LLString& valueOut )
204// 200//
205bool LLUrlWhiteList::getNext ( LLString& valueOut ) 201bool LLUrlWhiteList::getNext ( LLString& valueOut )
206{ 202{
207 if ( mUrlListIter == mUrlList.end () ) 203 if ( mCurIndex >= mUrlList.size () )
208 return false; 204 return false;
209 205
210 valueOut = * ( mUrlListIter ); 206 valueOut = mUrlList[mCurIndex++];
211
212 ++mUrlListIter;
213 207
214 return true; 208 return true;
215} 209}