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 @@ | |||
17 | #include <fstream> | 17 | #include <fstream> |
18 | #include <iostream> | 18 | #include <iostream> |
19 | using namespace std; | 19 | using namespace std; |
20 | 20 | ||
21 | #ifdef QWS | 21 | #ifdef QWS |
22 | #include <qpe/config.h> | 22 | #include <qpe/config.h> |
23 | #include <qpe/qpeapplication.h> | ||
24 | #else | ||
25 | #include <qapplication.h> | ||
23 | #endif | 26 | #endif |
24 | 27 | ||
25 | #include <stdio.h> | 28 | #include <stdio.h> |
26 | 29 | ||
27 | #include "datamgr.h" | 30 | #include "datamgr.h" |
28 | #include "global.h" | 31 | #include "global.h" |
29 | 32 | ||
30 | 33 | ||
31 | QString DataManager::availableCategories = ""; | 34 | QString DataManager::availableCategories = ""; |
32 | DataManager::DataManager() | 35 | DataManager::DataManager() |
36 | : QObject( 0x0, 0x0 ) | ||
33 | { | 37 | { |
34 | activeServer = ""; | 38 | activeServer = ""; |
35 | availableCategories = "#"; | 39 | availableCategories = "#"; |
36 | } | 40 | } |
37 | 41 | ||
38 | DataManager::~DataManager() | 42 | DataManager::~DataManager() |
@@ -162,23 +166,33 @@ void DataManager :: loadServers() | |||
162 | 166 | ||
163 | reloadServerData( ); | 167 | reloadServerData( ); |
164 | } | 168 | } |
165 | 169 | ||
166 | void DataManager :: reloadServerData( ) | 170 | void DataManager :: reloadServerData( ) |
167 | { | 171 | { |
168 | vector<Server>::iterator it = serverList.begin(); | 172 | emit progressSetSteps( serverList.size() ); |
173 | emit progressSetMessage( tr( "Reading configuration..." ) ); | ||
174 | |||
175 | vector<Server>::iterator it = serverList.begin(); | ||
176 | QString serverName; | ||
177 | int i = 0; | ||
169 | for ( it = serverList.begin() ; it != serverList.end() ; ++it ) | 178 | for ( it = serverList.begin() ; it != serverList.end() ; ++it ) |
170 | { | 179 | { |
180 | serverName = it->getServerName(); | ||
181 | i++; | ||
182 | emit progressUpdate( i ); | ||
183 | qApp->processEvents(); | ||
184 | |||
171 | // Now we've read the config file in we need to read the servers | 185 | // Now we've read the config file in we need to read the servers |
172 | // The local server is a special case. This holds the contents of the | 186 | // The local server is a special case. This holds the contents of the |
173 | // status files the number of which depends on how many destinations | 187 | // status files the number of which depends on how many destinations |
174 | // we've set up | 188 | // we've set up |
175 | // The other servers files hold the contents of the server package list | 189 | // The other servers files hold the contents of the server package list |
176 | if ( it->getServerName() == LOCAL_SERVER ) | 190 | if ( serverName == LOCAL_SERVER ) |
177 | it->readStatusFile( destList ); | 191 | it->readStatusFile( destList ); |
178 | else if ( it->getServerName() == LOCAL_IPKGS ) | 192 | else if ( serverName == LOCAL_IPKGS ) |
179 | it->readLocalIpks( &( *getServer( LOCAL_SERVER ) ) ); | 193 | it->readLocalIpks( &( *getServer( LOCAL_SERVER ) ) ); |
180 | else | 194 | else |
181 | it->readPackageFile( &( *getServer( LOCAL_SERVER ) ) ); | 195 | it->readPackageFile( &( *getServer( LOCAL_SERVER ) ) ); |
182 | } | 196 | } |
183 | } | 197 | } |
184 | 198 | ||