author | drw <drw> | 2003-01-04 19:52:22 (UTC) |
---|---|---|
committer | drw <drw> | 2003-01-04 19:52:22 (UTC) |
commit | 8b0f280e69a6c5b4c1caf4070085feaf0951380d (patch) (side-by-side diff) | |
tree | ee99aba03491199a28b862afd439a591d9a3de88 /noncore/settings/aqpkg/datamgr.cpp | |
parent | d7474edcc4efccbf5d5fd4b8926739a597463242 (diff) | |
download | opie-8b0f280e69a6c5b4c1caf4070085feaf0951380d.zip opie-8b0f280e69a6c5b4c1caf4070085feaf0951380d.tar.gz opie-8b0f280e69a6c5b4c1caf4070085feaf0951380d.tar.bz2 |
Delay initial load of ipkg info so app displays quicker, and add progress display for longer operations (such as loading packages for large feeds).
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 20 |
1 files changed, 17 insertions, 3 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 @@ -17,22 +17,26 @@ #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() @@ -162,23 +166,33 @@ void DataManager :: loadServers() reloadServerData( ); } void DataManager :: reloadServerData( ) { - vector<Server>::iterator it = serverList.begin(); + 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 ) ) ); } } |