Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 87 |
1 files changed, 19 insertions, 68 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 035ec81..b892b30 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -6,3 +6,2 @@ | |||
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <qpe/config.h> | ||
8 | 7 | ||
@@ -14,15 +13,2 @@ PackageList::PackageList() | |||
14 | empty=true; | 13 | empty=true; |
15 | { | ||
16 | Config cfg( "oipkg", Config::User ); | ||
17 | cfg.setGroup( "Common" ); | ||
18 | statusDir = cfg.readEntry( "statusDir", "" ); | ||
19 | listsDir = cfg.readEntry( "listsDir", "" ); | ||
20 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) | ||
21 | { | ||
22 | statusDir="/usr/lib/ipkg/"; | ||
23 | listsDir="/usr/lib/ipkg/lists/"; | ||
24 | cfg.writeEntry( "statusDir", statusDir ); | ||
25 | cfg.writeEntry( "listsDir", listsDir ); | ||
26 | } | ||
27 | } | ||
28 | sections << "All"; | 14 | sections << "All"; |
@@ -147,30 +133,5 @@ void PackageList::updateSections( Package* pack ) | |||
147 | 133 | ||
148 | |||
149 | /** No descriptions */ | ||
150 | void PackageList::parseStatus() | ||
151 | { | ||
152 | QStringList dests = settings->getDestinationUrls(); | ||
153 | QStringList destnames = settings->getDestinationNames(); | ||
154 | QStringList::Iterator name = destnames.begin(); | ||
155 | for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) | ||
156 | { | ||
157 | pvDebug( 2,"Status: "+*dir+statusDir+"/status"); | ||
158 | readFileEntries( *dir+statusDir+"/status", *name ); | ||
159 | ++name; | ||
160 | }; | ||
161 | } | ||
162 | |||
163 | void PackageList::parseList() | ||
164 | { | ||
165 | QStringList srvs = settings->getActiveServers(); | ||
166 | |||
167 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) | ||
168 | { | ||
169 | pvDebug( 2, "List: "+listsDir+"/"+*it); | ||
170 | readFileEntries( listsDir+"/"+*it, "" ); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | void PackageList::readFileEntries( QString filename, QString dest ) | 134 | void PackageList::readFileEntries( QString filename, QString dest ) |
175 | { | 135 | { |
136 | pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest); | ||
176 | QStringList packEntry; | 137 | QStringList packEntry; |
@@ -180,20 +141,20 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
180 | while ( !statusStream ->eof() ) | 141 | while ( !statusStream ->eof() ) |
181 | { | 142 | { |
182 | QString line = statusStream->readLine(); | 143 | QString line = statusStream->readLine(); |
183 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) | 144 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) |
184 | { | 145 | { |
185 | //end of package | 146 | //end of package |
186 | if ( ! packEntry.isEmpty() ) | 147 | if ( ! packEntry.isEmpty() ) |
187 | { | 148 | { |
188 | Package *p = new Package( packEntry, settings ); | 149 | Package *p = new Package( packEntry, settings ); |
189 | p->setDest( dest ); | 150 | p->setDest( dest ); |
190 | if ( p ) | 151 | if ( p ) |
191 | { | 152 | { |
192 | insertPackage( p ); | 153 | insertPackage( p ); |
193 | packEntry.clear(); | 154 | packEntry.clear(); |
194 | } | 155 | } |
195 | } | 156 | } |
196 | }else{ | 157 | }else{ |
197 | packEntry << line; | 158 | packEntry << line; |
198 | }; | 159 | }; |
199 | } | 160 | } |
@@ -202,12 +163,2 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
202 | 163 | ||
203 | |||
204 | void PackageList::update() | ||
205 | { | ||
206 | pvDebug( 2, "parseStatus"); | ||
207 | parseStatus(); | ||
208 | pvDebug( 2, "parseList"); | ||
209 | parseList(); | ||
210 | pvDebug( 2, "finished parsing"); | ||
211 | } | ||
212 | |||
213 | void PackageList::setSettings( PackageManagerSettings *s ) | 164 | void PackageList::setSettings( PackageManagerSettings *s ) |