summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-04-14 01:02:18 (UTC)
committer kergoth <kergoth>2002-04-14 01:02:18 (UTC)
commited4148887805150f52e1f20d45efcefc1bb2f390 (patch) (unidiff)
tree1d84859b7729d47cf71ba8e154a8e6310404595b
parent47f50cc423eab9e36a72bff18d1815d77d5dee00 (diff)
downloadopie-ed4148887805150f52e1f20d45efcefc1bb2f390.zip
opie-ed4148887805150f52e1f20d45efcefc1bb2f390.tar.gz
opie-ed4148887805150f52e1f20d45efcefc1bb2f390.tar.bz2
commenting added feeds by default when unselected is unintuitive.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagemanager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/unsupported/oipkg/packagemanager.cpp b/noncore/unsupported/oipkg/packagemanager.cpp
index f3da15d..642eae9 100644
--- a/noncore/unsupported/oipkg/packagemanager.cpp
+++ b/noncore/unsupported/oipkg/packagemanager.cpp
@@ -544,130 +544,130 @@ bool PackageManager::readIpkgConfig(const QString& conffile)
544 if ( l.left(12) == "IPKG_SOURCE=" ) { 544 if ( l.left(12) == "IPKG_SOURCE=" ) {
545 ipkg_old=1; 545 ipkg_old=1;
546 currentserver=settings->servers->count(); 546 currentserver=settings->servers->count();
547 serverurl.insert(settings->servers->count(),new QString(v)); 547 serverurl.insert(settings->servers->count(),new QString(v));
548 settings->servers->insertItem(v); 548 settings->servers->insertItem(v);
549 } else if ( l.left(13) == "#IPKG_SOURCE=" ) { 549 } else if ( l.left(13) == "#IPKG_SOURCE=" ) {
550 serverurl.insert(settings->servers->count(),new QString(v)); 550 serverurl.insert(settings->servers->count(),new QString(v));
551 settings->servers->insertItem(v); 551 settings->servers->insertItem(v);
552 } else if ( l.left(10) == "IPKG_ROOT=" ) { 552 } else if ( l.left(10) == "IPKG_ROOT=" ) {
553 // ### no UI 553 // ### no UI
554 // } else if ( l.left(20) == "IPKG_PROXY_USERNAME=" ) { 554 // } else if ( l.left(20) == "IPKG_PROXY_USERNAME=" ) {
555 // settings->username->setText(v); 555 // settings->username->setText(v);
556 // } else if ( l.left(20) == "IPKG_PROXY_PASSWORD=" ) { 556 // } else if ( l.left(20) == "IPKG_PROXY_PASSWORD=" ) {
557 // settings->password->setText(v); 557 // settings->password->setText(v);
558 // } else if ( l.left(16) == "IPKG_PROXY_HTTP=" ) { 558 // } else if ( l.left(16) == "IPKG_PROXY_HTTP=" ) {
559 // settings->http->setText(v); 559 // settings->http->setText(v);
560 // } else if ( l.left(16) == "IPKG_PROXY_FTP=" ) { 560 // } else if ( l.left(16) == "IPKG_PROXY_FTP=" ) {
561 // settings->ftp->setText(v); 561 // settings->ftp->setText(v);
562 } 562 }
563 } 563 }
564 } 564 }
565 } 565 }
566 if ( ipkg_old ) { 566 if ( ipkg_old ) {
567 settings->servers->setSelectionMode(QListBox::Single); 567 settings->servers->setSelectionMode(QListBox::Single);
568 settings->servers->setSelected(currentserver,TRUE); 568 settings->servers->setSelected(currentserver,TRUE);
569 } 569 }
570 return TRUE; 570 return TRUE;
571 } else { 571 } else {
572 return FALSE; 572 return FALSE;
573 } 573 }
574} 574}
575 575
576/* 576/*
577 * public slot 577 * public slot
578 */ 578 */
579void PackageManager::doSettings() 579void PackageManager::doSettings()
580{ 580{
581 settings->showMaximized(); 581 settings->showMaximized();
582 if ( settings->exec() ) { 582 if ( settings->exec() ) {
583 writeSettings(); 583 writeSettings();
584 startRun(); 584 startRun();
585 runIpkg("update"); 585 runIpkg("update");
586 endRun(); 586 endRun();
587 updatePackageList(); 587 updatePackageList();
588 } else { 588 } else {
589 readSettings(); 589 readSettings();
590 } 590 }
591} 591}
592 592
593void PackageManager::readSettings() 593void PackageManager::readSettings()
594{ 594{
595 // read from config file(s) 595 // read from config file(s)
596 readIpkgConfig("/etc/ipkg.conf"); 596 readIpkgConfig("/etc/ipkg.conf");
597} 597}
598 598
599void PackageManager::writeSettings() 599void PackageManager::writeSettings()
600{ 600{
601 QFile conf("/etc/ipkg.conf"); 601 QFile conf("/etc/ipkg.conf");
602 if ( conf.open(IO_WriteOnly) ) { 602 if ( conf.open(IO_WriteOnly) ) {
603 QTextStream s(&conf); 603 QTextStream s(&conf);
604 s << "# Written by Qtopia Package Manager\n"; 604 s << "# Written by Qtopia Package Manager\n";
605 if ( !ipkg_old ) { 605 if ( !ipkg_old ) {
606 for (int i=0; i<(int)settings->servers->count(); i++) { 606 for (int i=0; i<(int)settings->servers->count(); i++) {
607 QString url = serverurl[i] ? *serverurl[i] : QString("???"); 607 QString url = serverurl[i] ? *serverurl[i] : QString("???");
608 if ( !settings->servers->isSelected(i) ) 608 // if ( !settings->servers->isSelected(i) )
609 s << "#"; 609 // s << "#";
610 s << "src " << settings->servers->text(i) << " " << url << "\n"; 610 s << "src " << settings->servers->text(i) << " " << url << "\n";
611 } 611 }
612 s << "dest root /\n"; // ### need UI 612 s << "dest root /\n"; // ### need UI
613 // if ( !settings->username->text().isEmpty() ) 613 // if ( !settings->username->text().isEmpty() )
614 // s << "option proxy_username " << settings->username->text() << "\n"; 614 // s << "option proxy_username " << settings->username->text() << "\n";
615 // if ( !settings->password->text().isEmpty() ) 615 // if ( !settings->password->text().isEmpty() )
616 // s << "option proxy_password " << settings->password->text() << "\n"; 616 // s << "option proxy_password " << settings->password->text() << "\n";
617 // if ( !settings->http->text().isEmpty() ) 617 // if ( !settings->http->text().isEmpty() )
618 // s << "option http_proxy " << settings->http->text() << "\n"; 618 // s << "option http_proxy " << settings->http->text() << "\n";
619 // if ( !settings->ftp->text().isEmpty() ) 619 // if ( !settings->ftp->text().isEmpty() )
620 // s << "option ftp_proxy " << settings->ftp->text() << "\n"; 620 // s << "option ftp_proxy " << settings->ftp->text() << "\n";
621 } else { 621 } else {
622 // Old style 622 // Old style
623 bool src_selected=FALSE; 623 bool src_selected=FALSE;
624 for (int i=0; i<(int)settings->servers->count(); i++) { 624 for (int i=0; i<(int)settings->servers->count(); i++) {
625 if ( settings->servers->isSelected(i) ) { 625 if ( settings->servers->isSelected(i) ) {
626 src_selected=TRUE; 626 src_selected=TRUE;
627 } else { 627 } else {
628 s << "#"; 628 s << "#";
629 } 629 }
630 s << "IPKG_SOURCE=\"" << settings->servers->text(i) << "\"\n"; 630 s << "IPKG_SOURCE=\"" << settings->servers->text(i) << "\"\n";
631 } 631 }
632 if ( !src_selected ) 632 if ( !src_selected )
633 s << "IPKG_SOURCE=\"" << settings->servers->currentText() << "\"\n"; 633 s << "IPKG_SOURCE=\"" << settings->servers->currentText() << "\"\n";
634 s << "IPKG_ROOT=/\n" 634 s << "IPKG_ROOT=/\n"
635 // << "IPKG_PROXY_USERNAME=\"" << settings->username->text() << "\"\n" 635 // << "IPKG_PROXY_USERNAME=\"" << settings->username->text() << "\"\n"
636 // << "IPKG_PROXY_PASSWORD=\"" << settings->password->text() << "\"\n" 636 // << "IPKG_PROXY_PASSWORD=\"" << settings->password->text() << "\"\n"
637 // << "IPKG_PROXY_HTTP=\"" << settings->http->text() << "\"\n" 637 // << "IPKG_PROXY_HTTP=\"" << settings->http->text() << "\"\n"
638 // << "IPKG_PROXY_FTP=\"" << settings->ftp->text() << "\"\n" 638 // << "IPKG_PROXY_FTP=\"" << settings->ftp->text() << "\"\n"
639 ; 639 ;
640 } 640 }
641 conf.close(); 641 conf.close();
642 } 642 }
643} 643}
644 644
645/* 645/*
646 * public slot 646 * public slot
647 */ 647 */
648void PackageManager::doFind() 648void PackageManager::doFind()
649{ 649{
650 Search s(this, 0, TRUE); 650 Search s(this, 0, TRUE);
651 if ( s.exec() ) { 651 if ( s.exec() ) {
652 QString p = s.pattern->text(); 652 QString p = s.pattern->text();
653 if ( p.isEmpty() ) { 653 if ( p.isEmpty() ) {
654 list->selectAll(FALSE); 654 list->selectAll(FALSE);
655 } else { 655 } else {
656 selectPackages(findPackages(p)); 656 selectPackages(findPackages(p));
657 doNextDetails(); 657 doNextDetails();
658 } 658 }
659 } 659 }
660} 660}
661 661
662void PackageManager::selectPackages( const QStringList& l ) 662void PackageManager::selectPackages( const QStringList& l )
663{ 663{
664 QDict<void> d; 664 QDict<void> d;
665 for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) 665 for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
666 d.replace(*it,(void*)1); 666 d.replace(*it,(void*)1);
667 QListViewItem* i; 667 QListViewItem* i;
668 for ( i = list->firstChild(); i; i = i->nextSibling() ) { 668 for ( i = list->firstChild(); i; i = i->nextSibling() ) {
669 PackageItem* pit = (PackageItem*)i; 669 PackageItem* pit = (PackageItem*)i;
670 i->setSelected( d[pit->name()] ); 670 i->setSelected( d[pit->name()] );
671 } 671 }
672} 672}
673 673