Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index cd0c78f..67f90a3 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp @@ -1,9 +1,9 @@ /* This file is part of the OPIE Project - + =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> .=l. Dan Williams <drw@handhelds.org> .>+-= _;:, .> :=|. This file is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public @@ -37,20 +37,23 @@ #include <qfile.h> #include <qtextstream.h> #include "datamgr.h" #include "global.h" +QString LOCAL_SERVER; +QString LOCAL_IPKGS; + QString DataManager::availableCategories = ""; DataManager::DataManager() : QObject( 0x0, 0x0 ) { activeServer = ""; availableCategories = "#"; - + serverList.setAutoDelete( TRUE ); destList.setAutoDelete( TRUE ); } DataManager::~DataManager() { @@ -134,13 +137,13 @@ void DataManager :: loadServers() #ifdef QWS QString key = alias; key += "_linkToRoot"; linkToRoot = cfg.readBoolEntry( key, true ); #endif d->linkToRoot( linkToRoot ); - + destList.append( d ); } else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) ) { char type[20]; char val[100]; @@ -177,45 +180,45 @@ void DataManager :: reloadServerData( ) { emit progressSetSteps( serverList.count() ); emit progressSetMessage( tr( "Reading configuration..." ) ); QString serverName; int i = 0; - + Server *server; QListIterator<Server> it( serverList ); for ( ; it.current(); ++it ) { server = it.current(); serverName = server->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 ( serverName == LOCAL_SERVER ) server->readStatusFile( destList ); else if ( serverName == LOCAL_IPKGS ) server->readLocalIpks( getServer( LOCAL_SERVER ) ); else - server->readPackageFile( getServer( LOCAL_SERVER ) ); + server->readPackageFile( getServer( LOCAL_SERVER ) ); } } void DataManager :: writeOutIpkgConf() { QFile f( IPKG_CONF ); if ( !f.open( IO_WriteOnly ) ) { return; } - + QTextStream t( &f ); /* QString ipkg_conf = IPKG_CONF; ofstream out( ipkg_conf ); */ t << "# Written by AQPkg\n"; @@ -291,13 +294,13 @@ void DataManager :: writeOutIpkgConf() t << "#option proxy_password <password>\n\n"; else t << "option proxy_password " << proxyPassword << endl<< endl; t << "# Offline mode (for use in constructing flash images offline)\n"; t << "#option offline_root target\n"; - + f.close(); } void DataManager :: setAvailableCategories( QString section ) { |