summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/datamgr.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp27
1 files changed, 10 insertions, 17 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
@@ -41,10 +41,9 @@ DataManager::~DataManager()
-Server *DataManager :: getServer( const char *name )
+vector<Server>::iterator DataManager :: getServer( const char *name )
{
- Server *s = 0;
vector<Server>::iterator it = serverList.begin();
- while ( it != serverList.end() && s == 0 )
+ while ( it != serverList.end() )
{
if ( it->getServerName() == name )
- s = &(*it);
+ return it;
@@ -53,13 +52,12 @@ Server *DataManager :: getServer( const char *name )
- return s;
+ return serverList.end();
}
-Destination *DataManager :: getDestination( const char *name )
+vector<Destination>::iterator DataManager :: getDestination( const char *name )
{
- Destination *d = 0;
vector<Destination>::iterator it = destList.begin();
- while ( it != destList.end() && d == 0 )
+ while ( it != destList.end() )
{
if ( it->getDestinationName() == name )
- d = &(*it);
+ return it;
@@ -68,3 +66,3 @@ Destination *DataManager :: getDestination( const char *name )
- return d;
+ return destList.end();
}
@@ -152,7 +150,2 @@ void DataManager :: loadServers()
- cout << "httpProxy = " << httpProxy << endl;
- cout << "ftpProxy = " << ftpProxy << endl;
- cout << "proxyUsername = " << proxyUsername << endl;
- cout << "proxyPassword = " << proxyPassword << endl;
-
reloadServerData( );
@@ -173,5 +166,5 @@ void DataManager :: reloadServerData( )
else if ( it->getServerName() == LOCAL_IPKGS )
- it->readLocalIpks( getServer( LOCAL_SERVER ) );
+ it->readLocalIpks( &( *getServer( LOCAL_SERVER ) ) );
else
- it->readPackageFile( getServer( LOCAL_SERVER ) );
+ it->readPackageFile( &( *getServer( LOCAL_SERVER ) ) );
}