summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/oipkg.cpp
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/oipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index b0cc94d..a66bd51 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -144,25 +144,32 @@ void OIpkg::setConfigItems( OConfItemList *configList )
144 { 144 {
145 OConfItem *item = it.current(); 145 OConfItem *item = it.current();
146 146
147 // Only write out valid conf items 147 // Only write out valid conf items
148 if ( item->type() != OConfItem::NotDefined ) 148 if ( item->type() != OConfItem::NotDefined )
149 { 149 {
150 QString confLine; 150 QString confLine;
151 if ( !item->active() ) 151 if ( !item->active() )
152 confLine = "#"; 152 confLine = "#";
153 153
154 switch ( item->type() ) 154 switch ( item->type() )
155 { 155 {
156 case OConfItem::Source : confLine.append( "src " ); break; 156 case OConfItem::Source :
157 {
158 if ( item->features().contains( "Compressed" ) )
159 confLine.append( "src/gz " );
160 else
161 confLine.append( "src " );
162 }
163 break;
157 case OConfItem::Destination : confLine.append( "dest " ); break; 164 case OConfItem::Destination : confLine.append( "dest " ); break;
158 case OConfItem::Option : confLine.append( "option " ); break; 165 case OConfItem::Option : confLine.append( "option " ); break;
159 case OConfItem::Arch : confLine.append( "arch " ); break; 166 case OConfItem::Arch : confLine.append( "arch " ); break;
160 default : break; 167 default : break;
161 }; 168 };
162 169
163 confStream << confLine << " " << item->name() << " " << item->value() << "\n"; 170 confStream << confLine << " " << item->name() << " " << item->value() << "\n";
164 } 171 }
165 } 172 }
166 173
167 confFile.close(); 174 confFile.close();
168 } 175 }
@@ -499,50 +506,56 @@ void OIpkg::loadConfiguration()
499 { 506 {
500 if ( !line.startsWith( "#" ) || 507 if ( !line.startsWith( "#" ) ||
501 line.startsWith( "#src" ) || 508 line.startsWith( "#src" ) ||
502 line.startsWith( "#dest" ) || 509 line.startsWith( "#dest" ) ||
503 line.startsWith( "#arch" ) || 510 line.startsWith( "#arch" ) ||
504 line.startsWith( "#option" ) ) 511 line.startsWith( "#option" ) )
505 { 512 {
506 int pos = line.find( ' ', 1 ); 513 int pos = line.find( ' ', 1 );
507 514
508 // Type 515 // Type
509 QString typeStr = line.left( pos ); 516 QString typeStr = line.left( pos );
510 OConfItem::Type type; 517 OConfItem::Type type;
518 QString features;
511 if ( typeStr == "src" || typeStr == "#src" ) 519 if ( typeStr == "src" || typeStr == "#src" )
512 type = OConfItem::Source; 520 type = OConfItem::Source;
521 else if ( typeStr == "src/gz" || typeStr == "#src/gz" )
522 {
523 type = OConfItem::Source;
524 features = "Compressed";
525 }
513 else if ( typeStr == "dest" || typeStr == "#dest" ) 526 else if ( typeStr == "dest" || typeStr == "#dest" )
514 type = OConfItem::Destination; 527 type = OConfItem::Destination;
515 else if ( typeStr == "option" || typeStr == "#option" ) 528 else if ( typeStr == "option" || typeStr == "#option" )
516 type = OConfItem::Option; 529 type = OConfItem::Option;
517 else if ( typeStr == "arch" || typeStr == "#arch" ) 530 else if ( typeStr == "arch" || typeStr == "#arch" )
518 type = OConfItem::Arch; 531 type = OConfItem::Arch;
519 else 532 else
520 type = OConfItem::NotDefined; 533 type = OConfItem::NotDefined;
521 ++pos; 534 ++pos;
522 int endpos = line.find( ' ', pos ); 535 int endpos = line.find( ' ', pos );
523 536
524 // Name 537 // Name
525 QString name = line.mid( pos, endpos - pos ); 538 QString name = line.mid( pos, endpos - pos );
526 539
527 // Value 540 // Value
528 QString value = ""; 541 QString value = "";
529 if ( endpos > -1 ) 542 if ( endpos > -1 )
530 value = line.right( line.length() - endpos - 1 ); 543 value = line.right( line.length() - endpos - 1 );
531 544
532 // Active 545 // Active
533 bool active = !line.startsWith( "#" ); 546 bool active = !line.startsWith( "#" );
534 547
535 // Add to list 548 // Add to list
536 m_confInfo->append( new OConfItem( type, name, value, active ) ); 549 m_confInfo->append( new OConfItem( type, name, value, features, active ) );
537 } 550 }
538 } 551 }
539 } 552 }
540 553
541 f.close(); 554 f.close();
542 } 555 }
543 } 556 }
544 557
545 // Load Ipkg execution options from application configuration file 558 // Load Ipkg execution options from application configuration file
546 if ( m_config ) 559 if ( m_config )
547 { 560 {
548 m_config->setGroup( "Ipkg" ); 561 m_config->setGroup( "Ipkg" );