summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/datamgr.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp
index f342aff..1420242 100644
--- a/noncore/settings/aqpkg/datamgr.cpp
+++ b/noncore/settings/aqpkg/datamgr.cpp
@@ -7,51 +7,53 @@
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17#include <fstream> 17#include <fstream>
18#include <iostream> 18#include <iostream>
19using namespace std; 19using namespace std;
20 20
21#ifdef QWS 21#ifdef QWS
22#include <qpe/config.h> 22#include <qpe/config.h>
23#endif 23#endif
24 24
25#include <stdio.h> 25#include <stdio.h>
26 26
27#include "datamgr.h" 27#include "datamgr.h"
28#include "global.h" 28#include "global.h"
29 29
30 30
31QString DataManager::availableCategories = "";
31DataManager::DataManager() 32DataManager::DataManager()
32{ 33{
33 activeServer = ""; 34 activeServer = "";
35 availableCategories = "#";
34} 36}
35 37
36DataManager::~DataManager() 38DataManager::~DataManager()
37{ 39{
38} 40}
39 41
40Server *DataManager :: getServer( const char *name ) 42Server *DataManager :: getServer( const char *name )
41{ 43{
42 Server *s = 0; 44 Server *s = 0;
43 vector<Server>::iterator it = serverList.begin(); 45 vector<Server>::iterator it = serverList.begin();
44 while ( it != serverList.end() && s == 0 ) 46 while ( it != serverList.end() && s == 0 )
45 { 47 {
46 if ( it->getServerName() == name ) 48 if ( it->getServerName() == name )
47 s = &(*it); 49 s = &(*it);
48 50
49 ++it; 51 ++it;
50 } 52 }
51 53
52 return s; 54 return s;
53} 55}
54 56
55Destination *DataManager :: getDestination( const char *name ) 57Destination *DataManager :: getDestination( const char *name )
56{ 58{
57 Destination *d = 0; 59 Destination *d = 0;
@@ -186,24 +188,32 @@ void DataManager :: writeOutIpkgConf()
186 if ( alias != LOCAL_SERVER && alias != LOCAL_IPKGS ) 188 if ( alias != LOCAL_SERVER && alias != LOCAL_IPKGS )
187 { 189 {
188 QString url = it->getServerUrl();; 190 QString url = it->getServerUrl();;
189 191
190 if ( !it->isServerActive() ) 192 if ( !it->isServerActive() )
191 out << "#"; 193 out << "#";
192 out << "src " << alias << " " << url << endl; 194 out << "src " << alias << " " << url << endl;
193 } 195 }
194 196
195 it++; 197 it++;
196 } 198 }
197 199
198 out << endl; 200 out << endl;
199 201
200 // Write out destinations 202 // Write out destinations
201 vector<Destination>::iterator it2 = destList.begin(); 203 vector<Destination>::iterator it2 = destList.begin();
202 while ( it2 != destList.end() ) 204 while ( it2 != destList.end() )
203 { 205 {
204 out << "dest " << it2->getDestinationName() << " " << it2->getDestinationPath() << endl; 206 out << "dest " << it2->getDestinationName() << " " << it2->getDestinationPath() << endl;
205 it2++; 207 it2++;
206 } 208 }
207 209
208 out.close(); 210 out.close();
209} 211}
212
213
214void DataManager :: setAvailableCategories( QString section )
215{
216 section = section.lower();
217 if ( availableCategories.find( "#" + section + "#" ) == -1 )
218 availableCategories += section + "#";
219}