Diffstat (limited to 'noncore/settings/packagemanager/oipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index 3d2c621..417ee95 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp | |||
@@ -238,18 +238,26 @@ OPackageList *OIpkg::availablePackages( const QString &server ) | |||
238 | { | 238 | { |
239 | // Load Ipkg configuration info if not already cached | 239 | // Load Ipkg configuration info if not already cached |
240 | if ( !m_confInfo ) | 240 | if ( !m_confInfo ) |
241 | loadConfiguration(); | 241 | loadConfiguration(); |
242 | 242 | ||
243 | // Build new server list (caller is responsible for deleting) | 243 | // Build new server list (caller is responsible for deleting) |
244 | OPackageList *pl = new OPackageList; | 244 | OPackageList *pl = new OPackageList; |
245 | 245 | ||
246 | // Get directory where server lists are located | ||
247 | QString listsDir; | ||
248 | OConfItem *confItem = findConfItem( OConfItem::Other, "lists_dir" ); | ||
249 | if ( confItem ) | ||
250 | listsDir = confItem->value(); | ||
251 | else | ||
252 | listsDir = IPKG_PKG_PATH; | ||
253 | |||
246 | // Open package list file | 254 | // Open package list file |
247 | QFile f( IPKG_PKG_PATH + "/" + server ); | 255 | QFile f( listsDir + "/" + server ); |
248 | if ( !f.open( IO_ReadOnly ) ) | 256 | if ( !f.open( IO_ReadOnly ) ) |
249 | return NULL; | 257 | return NULL; |
250 | QTextStream t( &f ); | 258 | QTextStream t( &f ); |
251 | 259 | ||
252 | // Process all information in package list file | 260 | // Process all information in package list file |
253 | OPackage *package = NULL; | 261 | OPackage *package = NULL; |
254 | QString line = t.readLine(); | 262 | QString line = t.readLine(); |
255 | while ( !t.eof() ) | 263 | while ( !t.eof() ) |
@@ -602,16 +610,20 @@ void OIpkg::loadConfiguration() | |||
602 | type = OConfItem::Option; | 610 | type = OConfItem::Option; |
603 | else if ( typeStr == "arch" ) | 611 | else if ( typeStr == "arch" ) |
604 | type = OConfItem::Arch; | 612 | type = OConfItem::Arch; |
605 | else if ( typeStr == "lists_dir" ) | 613 | else if ( typeStr == "lists_dir" ) |
606 | { | 614 | { |
607 | type = OConfItem::Other; | 615 | type = OConfItem::Other; |
608 | features = name; | 616 | features = name; |
609 | name = typeStr; | 617 | name = typeStr; |
618 | |||
619 | // Default value when not defined | ||
620 | if ( value == QString::null || value == "" ) | ||
621 | value = IPKG_PKG_PATH; | ||
610 | } | 622 | } |
611 | else | 623 | else |
612 | recognizedOption = false; | 624 | recognizedOption = false; |
613 | 625 | ||
614 | // Add to list | 626 | // Add to list |
615 | if ( recognizedOption ) | 627 | if ( recognizedOption ) |
616 | m_confInfo->append( new OConfItem( type, name, value, features, active ) ); | 628 | m_confInfo->append( new OConfItem( type, name, value, features, active ) ); |
617 | } | 629 | } |