summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/datamgr.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp
index e7fb75a..96c28c0 100644
--- a/noncore/settings/aqpkg/datamgr.cpp
+++ b/noncore/settings/aqpkg/datamgr.cpp
@@ -39,34 +39,32 @@ DataManager::~DataManager()
39{ 39{
40} 40}
41 41
42Server *DataManager :: getServer( const char *name ) 42vector<Server>::iterator DataManager :: getServer( const char *name )
43{ 43{
44 Server *s = 0; 44 vector<Server>::iterator it = serverList.begin();
45 vector<Server>::iterator it = serverList.begin(); 45 while ( it != serverList.end() )
46 while ( it != serverList.end() && s == 0 )
47 { 46 {
48 if ( it->getServerName() == name ) 47 if ( it->getServerName() == name )
49 s = &(*it); 48 return it;
50 49
51 ++it; 50 ++it;
52 } 51 }
53 52
54 return s; 53 return serverList.end();
55} 54}
56 55
57Destination *DataManager :: getDestination( const char *name ) 56vector<Destination>::iterator DataManager :: getDestination( const char *name )
58{ 57{
59 Destination *d = 0;
60 vector<Destination>::iterator it = destList.begin(); 58 vector<Destination>::iterator it = destList.begin();
61 while ( it != destList.end() && d == 0 ) 59 while ( it != destList.end() )
62 { 60 {
63 if ( it->getDestinationName() == name ) 61 if ( it->getDestinationName() == name )
64 d = &(*it); 62 return it;
65 63
66 ++it; 64 ++it;
67 } 65 }
68 66
69 return d; 67 return destList.end();
70} 68}
71 69
72void DataManager :: loadServers() 70void DataManager :: loadServers()
@@ -150,11 +148,6 @@ void DataManager :: loadServers()
150 } 148 }
151 fclose( fp ); 149 fclose( fp );
152 150
153 cout << "httpProxy = " << httpProxy << endl;
154 cout << "ftpProxy = " << ftpProxy << endl;
155 cout << "proxyUsername = " << proxyUsername << endl;
156 cout << "proxyPassword = " << proxyPassword << endl;
157
158 reloadServerData( ); 151 reloadServerData( );
159} 152}
160 153
@@ -171,9 +164,9 @@ void DataManager :: reloadServerData( )
171 if ( it->getServerName() == LOCAL_SERVER ) 164 if ( it->getServerName() == LOCAL_SERVER )
172 it->readStatusFile( destList ); 165 it->readStatusFile( destList );
173 else if ( it->getServerName() == LOCAL_IPKGS ) 166 else if ( it->getServerName() == LOCAL_IPKGS )
174 it->readLocalIpks( getServer( LOCAL_SERVER ) ); 167 it->readLocalIpks( &( *getServer( LOCAL_SERVER ) ) );
175 else 168 else
176 it->readPackageFile( getServer( LOCAL_SERVER ) ); 169 it->readPackageFile( &( *getServer( LOCAL_SERVER ) ) );
177 } 170 }
178} 171}
179 172