Diffstat (limited to 'noncore/settings/packagemanager/opackagemanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index cbddfe7..c9fdec1 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp | |||
@@ -248,67 +248,49 @@ QStringList OPackageManager::servers() | |||
248 | } | 248 | } |
249 | 249 | ||
250 | QStringList OPackageManager::destinations() | 250 | QStringList OPackageManager::destinations() |
251 | { | 251 | { |
252 | QStringList dl; | 252 | QStringList dl; |
253 | 253 | ||
254 | OConfItemList *destList = m_ipkg.destinations(); | 254 | OConfItemList *destList = m_ipkg.destinations(); |
255 | if ( destList ) | 255 | if ( destList ) |
256 | { | 256 | { |
257 | for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) | 257 | for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) |
258 | { | 258 | { |
259 | OConfItem *destination = destIt.current(); | 259 | OConfItem *destination = destIt.current(); |
260 | 260 | ||
261 | // Add only active destinations | 261 | // Add only active destinations |
262 | if ( destination->active() ) | 262 | if ( destination->active() ) |
263 | dl << destination->name(); | 263 | dl << destination->name(); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
267 | return dl; | 267 | return dl; |
268 | } | 268 | } |
269 | 269 | ||
270 | OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name ) | 270 | OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name ) |
271 | { | 271 | { |
272 | OConfItem *confItem = 0x0; | 272 | return m_ipkg.findConfItem( type, name ); |
273 | OConfItemList *confList = m_ipkg.configItems(); | ||
274 | if ( confList ) | ||
275 | { | ||
276 | for ( OConfItemListIterator confIt( *confList ); confIt.current(); ++confIt ) | ||
277 | { | ||
278 | OConfItem *conf = confIt.current(); | ||
279 | |||
280 | // Add only active confinations | ||
281 | if ( conf->type() == type && conf->name() == name ) | ||
282 | { | ||
283 | confItem = conf; | ||
284 | break; | ||
285 | } | ||
286 | } | ||
287 | } | ||
288 | |||
289 | return confItem; | ||
290 | |||
291 | } | 273 | } |
292 | 274 | ||
293 | OPackage *OPackageManager::findPackage( const QString &name ) | 275 | OPackage *OPackageManager::findPackage( const QString &name ) |
294 | { | 276 | { |
295 | return m_packages[ name ]; | 277 | return m_packages[ name ]; |
296 | } | 278 | } |
297 | 279 | ||
298 | int OPackageManager::compareVersions( const QString &ver1, const QString &ver2 ) | 280 | int OPackageManager::compareVersions( const QString &ver1, const QString &ver2 ) |
299 | { | 281 | { |
300 | // TODO - should this be in OIpkg??? | 282 | // TODO - should this be in OIpkg??? |
301 | 283 | ||
302 | int epoch1, epoch2; | 284 | int epoch1, epoch2; |
303 | QString version1, revision1; | 285 | QString version1, revision1; |
304 | QString version2, revision2; | 286 | QString version2, revision2; |
305 | 287 | ||
306 | parseVersion( ver1, &epoch1, &version1, &revision1 ); | 288 | parseVersion( ver1, &epoch1, &version1, &revision1 ); |
307 | parseVersion( ver2, &epoch2, &version2, &revision2 ); | 289 | parseVersion( ver2, &epoch2, &version2, &revision2 ); |
308 | 290 | ||
309 | if ( epoch1 > epoch2 ) | 291 | if ( epoch1 > epoch2 ) |
310 | return 1; | 292 | return 1; |
311 | else if ( epoch1 < epoch2 ) | 293 | else if ( epoch1 < epoch2 ) |
312 | return -1; | 294 | return -1; |
313 | 295 | ||
314 | int r = verrevcmp( version1.latin1(), version2.latin1() ); | 296 | int r = verrevcmp( version1.latin1(), version2.latin1() ); |