summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/oipkg.cpp
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/oipkg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index a885ef8..f2d7e39 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -105,26 +105,25 @@ OIpkg::~OIpkg()
105 ipkg_deinit( &m_ipkgArgs ); 105 ipkg_deinit( &m_ipkgArgs );
106} 106}
107 107
108OConfItemList *OIpkg::configItems() 108OConfItemList *OIpkg::configItems()
109{ 109{
110 // Retrieve all configuration items 110 // Retrieve all configuration items
111 return filterConfItems(); 111 return filterConfItems();
112} 112}
113 113
114OConfItemList *OIpkg::servers() 114OConfItemList *OIpkg::servers()
115{ 115{
116 // Retrieve only servers 116 // Retrieve only servers
117 return filterConfItems( (OConfItem::Type)((int)OConfItem::Source | 117 return filterConfItems( OConfItem::Source );
118 (int)OConfItem::GzSource) );
119} 118}
120 119
121OConfItemList *OIpkg::destinations() 120OConfItemList *OIpkg::destinations()
122{ 121{
123 // Retrieve only destinations 122 // Retrieve only destinations
124 return filterConfItems( OConfItem::Destination ); 123 return filterConfItems( OConfItem::Destination );
125} 124}
126 125
127OConfItemList *OIpkg::options() 126OConfItemList *OIpkg::options()
128{ 127{
129 // Retrieve only destinations 128 // Retrieve only destinations
130 return filterConfItems( OConfItem::Option ); 129 return filterConfItems( OConfItem::Option );
@@ -535,25 +534,24 @@ void OIpkg::loadConfiguration()
535 { 534 {
536 QTextStream s( &f ); 535 QTextStream s( &f );
537 while ( !s.eof() ) 536 while ( !s.eof() )
538 { 537 {
539 538
540 QString line = s.readLine().simplifyWhiteSpace(); 539 QString line = s.readLine().simplifyWhiteSpace();
541 540
542 // Parse line and save info to the conf options list 541 // Parse line and save info to the conf options list
543 if ( !line.isEmpty() ) 542 if ( !line.isEmpty() )
544 { 543 {
545 if ( !line.startsWith( "#" ) || 544 if ( !line.startsWith( "#" ) ||
546 line.startsWith( "#src" ) || 545 line.startsWith( "#src" ) ||
547 line.startsWith( "#src/gz" ) ||
548 line.startsWith( "#dest" ) || 546 line.startsWith( "#dest" ) ||
549 line.startsWith( "#arch" ) || 547 line.startsWith( "#arch" ) ||
550 line.startsWith( "#option" ) ) 548 line.startsWith( "#option" ) )
551 { 549 {
552 int pos = line.find( ' ', 1 ); 550 int pos = line.find( ' ', 1 );
553 551
554 // Type 552 // Type
555 QString typeStr = line.left( pos ); 553 QString typeStr = line.left( pos );
556 OConfItem::Type type; 554 OConfItem::Type type;
557 QString features; 555 QString features;
558 if ( typeStr == "src" || typeStr == "#src" ) 556 if ( typeStr == "src" || typeStr == "#src" )
559 type = OConfItem::Source; 557 type = OConfItem::Source;
@@ -611,26 +609,25 @@ OConfItemList *OIpkg::filterConfItems( OConfItem::Type typefilter )
611 609
612 // Build new server list (caller is responsible for deleting) 610 // Build new server list (caller is responsible for deleting)
613 OConfItemList *sl = new OConfItemList; 611 OConfItemList *sl = new OConfItemList;
614 612
615 // If typefilter is empty, retrieve all items 613 // If typefilter is empty, retrieve all items
616 bool retrieveAll = ( typefilter == OConfItem::NotDefined ); 614 bool retrieveAll = ( typefilter == OConfItem::NotDefined );
617 615
618 // Parse configuration info for servers 616 // Parse configuration info for servers
619 OConfItemListIterator it( *m_confInfo ); 617 OConfItemListIterator it( *m_confInfo );
620 for ( ; it.current(); ++it ) 618 for ( ; it.current(); ++it )
621 { 619 {
622 OConfItem *item = it.current(); 620 OConfItem *item = it.current();
623 if ( retrieveAll || 621 if ( retrieveAll || item->type() == typefilter )
624 ( item->type() & typefilter ) )
625 { 622 {
626 sl->append( item ); 623 sl->append( item );
627 } 624 }
628 } 625 }
629 626
630 return sl; 627 return sl;
631} 628}
632 629
633const QString &OIpkg::rootPath() 630const QString &OIpkg::rootPath()
634{ 631{
635 if ( m_rootPath.isEmpty() ) 632 if ( m_rootPath.isEmpty() )
636 { 633 {