Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index 0159a79..2c83e28 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp @@ -11,34 +11,38 @@ * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include <fstream> #include <iostream> using namespace std; #ifdef QWS #include <qpe/config.h> +#include <qpe/qpeapplication.h> +#else +#include <qapplication.h> #endif #include <stdio.h> #include "datamgr.h" #include "global.h" QString DataManager::availableCategories = ""; DataManager::DataManager() + : QObject( 0x0, 0x0 ) { activeServer = ""; availableCategories = "#"; } DataManager::~DataManager() { } vector<Server>::iterator DataManager :: getServer( const char *name ) { vector<Server>::iterator it = serverList.begin(); @@ -156,35 +160,45 @@ void DataManager :: loadServers() if ( stricmp( type, "proxy_password" ) == 0 ) proxyPassword = val; } } } fclose( fp ); reloadServerData( ); } void DataManager :: reloadServerData( ) { + emit progressSetSteps( serverList.size() ); + emit progressSetMessage( tr( "Reading configuration..." ) ); + vector<Server>::iterator it = serverList.begin(); + QString serverName; + int i = 0; for ( it = serverList.begin() ; it != serverList.end() ; ++it ) { + serverName = it->getServerName(); + i++; + emit progressUpdate( i ); + qApp->processEvents(); + // Now we've read the config file in we need to read the servers // The local server is a special case. This holds the contents of the // status files the number of which depends on how many destinations // we've set up // The other servers files hold the contents of the server package list - if ( it->getServerName() == LOCAL_SERVER ) + if ( serverName == LOCAL_SERVER ) it->readStatusFile( destList ); - else if ( it->getServerName() == LOCAL_IPKGS ) + else if ( serverName == LOCAL_IPKGS ) it->readLocalIpks( &( *getServer( LOCAL_SERVER ) ) ); else it->readPackageFile( &( *getServer( LOCAL_SERVER ) ) ); } } void DataManager :: writeOutIpkgConf() { QString ipkg_conf = IPKG_CONF; ofstream out( ipkg_conf ); out << "# Written by AQPkg" << endl; |