author | andyq <andyq> | 2002-10-16 23:43:27 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-16 23:43:27 (UTC) |
commit | 5d28c61d84da1814d356540b557bbfe026da98aa (patch) (unidiff) | |
tree | 2bf8beae274d59573898cead3fc925d2663348b8 | |
parent | 35a5fb97aa3cc92e626286285d22d8fbf9d61e3e (diff) | |
download | opie-5d28c61d84da1814d356540b557bbfe026da98aa.zip opie-5d28c61d84da1814d356540b557bbfe026da98aa.tar.gz opie-5d28c61d84da1814d356540b557bbfe026da98aa.tar.bz2 |
Fixed bug in jump to package
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 3ce7960..6f528a1 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp | |||
@@ -463,46 +463,62 @@ QString NetworkPackageManager :: dealWithItem( QCheckListItem *item ) | |||
463 | { | 463 | { |
464 | if ( p->getVersion() == p->getInstalledVersion() ) | 464 | if ( p->getVersion() == p->getInstalledVersion() ) |
465 | { | 465 | { |
466 | QString msgtext; | 466 | QString msgtext; |
467 | msgtext.sprintf( "Do you wish to remove or reinstall\n%s?", (const char *)name ); | 467 | msgtext.sprintf( "Do you wish to remove or reinstall\n%s?", (const char *)name ); |
468 | switch( QMessageBox::information( this, "Remove or ReInstall", | 468 | switch( QMessageBox::information( this, "Remove or ReInstall", |
469 | msgtext, "Remove", "ReInstall" ) ) | 469 | msgtext, "Remove", "ReInstall" ) ) |
470 | { | 470 | { |
471 | case 0: // Try again or Enter | 471 | case 0: // Try again or Enter |
472 | return QString( "D" ) + name; | 472 | return QString( "D" ) + name; |
473 | break; | 473 | break; |
474 | case 1: // Quit or Escape | 474 | case 1: // Quit or Escape |
475 | return QString( "U" ) + name; | 475 | return QString( "U" ) + name; |
476 | break; | 476 | break; |
477 | } | 477 | } |
478 | 478 | ||
479 | // User hit cancel (on dlg - assume remove) | 479 | // User hit cancel (on dlg - assume remove) |
480 | return QString( "D" ) + name; | 480 | return QString( "D" ) + name; |
481 | } | 481 | } |
482 | else | 482 | else |
483 | return QString( "U" ) + name; | 483 | return QString( "U" ) + name; |
484 | } | 484 | } |
485 | } | 485 | } |
486 | 486 | ||
487 | void NetworkPackageManager :: displayText( const QString &t ) | 487 | void NetworkPackageManager :: displayText( const QString &t ) |
488 | { | 488 | { |
489 | cout << t << endl; | 489 | cout << t << endl; |
490 | } | 490 | } |
491 | 491 | ||
492 | 492 | ||
493 | void NetworkPackageManager :: letterPushed( QString t ) | 493 | void NetworkPackageManager :: letterPushed( QString t ) |
494 | { | 494 | { |
495 | QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 495 | QCheckListItem *top = (QCheckListItem *)packagesList->firstChild(); |
496 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); | ||
497 | if ( packagesList->firstChild() == 0 ) | ||
498 | return; | ||
499 | |||
500 | QCheckListItem *item; | ||
501 | if ( start == 0 ) | ||
502 | { | ||
503 | item = (QCheckListItem *)packagesList->firstChild(); | ||
504 | start = top; | ||
505 | } | ||
506 | else | ||
507 | item = (QCheckListItem *)start->nextSibling(); | ||
508 | |||
509 | if ( item == 0 ) | ||
510 | item = (QCheckListItem *)packagesList->firstChild(); | ||
496 | do | 511 | do |
497 | { | 512 | { |
498 | if ( item->text().lower().startsWith( t.lower() ) ) | 513 | if ( item->text().lower().startsWith( t.lower() ) ) |
499 | { | 514 | { |
500 | cout << "Found - item->text()" << endl; | ||
501 | packagesList->setSelected( item, true ); | 515 | packagesList->setSelected( item, true ); |
502 | packagesList->ensureItemVisible( item ); | 516 | packagesList->ensureItemVisible( item ); |
503 | break; | 517 | break; |
504 | } | 518 | } |
505 | 519 | ||
506 | item = (QCheckListItem *)item->nextSibling(); | 520 | item = (QCheckListItem *)item->nextSibling(); |
507 | } while ( item ); | 521 | if ( !item ) |
522 | item = (QCheckListItem *)packagesList->firstChild(); | ||
523 | } while ( item != start); | ||
508 | } | 524 | } |