Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 3d06aef..dee834e 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp | |||
@@ -505,54 +505,64 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) | |||
505 | int pos = name.find( "*" ); | 505 | int pos = name.find( "*" ); |
506 | name.truncate( pos ); | 506 | name.truncate( pos ); |
507 | 507 | ||
508 | // if (there is a (installed), remove it | 508 | // if (there is a (installed), remove it |
509 | pos = name.find( "(installed)" ); | 509 | pos = name.find( "(installed)" ); |
510 | if ( pos > 0 ) | 510 | if ( pos > 0 ) |
511 | name.truncate( pos - 1 ); | 511 | name.truncate( pos - 1 ); |
512 | 512 | ||
513 | // Get package | 513 | // Get package |
514 | Server *s = dataMgr->getServer( serversList->currentText() ); | 514 | Server *s = dataMgr->getServer( serversList->currentText() ); |
515 | Package *p = s->getPackage( name ); | 515 | Package *p = s->getPackage( name ); |
516 | 516 | ||
517 | // If the package has a filename then it is a local file | 517 | // If the package has a filename then it is a local file |
518 | if ( p->isPackageStoredLocally() ) | 518 | if ( p->isPackageStoredLocally() ) |
519 | name = p->getFilename(); | 519 | name = p->getFilename(); |
520 | |||
520 | QString option; | 521 | QString option; |
521 | QString dest = "root"; | 522 | QString dest = "root"; |
522 | if ( !p->isInstalled() ) | 523 | if ( !p->isInstalled() ) |
523 | { | 524 | { |
524 | InstallData item; | 525 | InstallData item; |
525 | item.option = "I"; | 526 | item.option = "I"; |
526 | item.packageName = name; | 527 | item.packageName = name; |
527 | return item; | 528 | return item; |
528 | } | 529 | } |
529 | else | 530 | else |
530 | { | 531 | { |
531 | InstallData item; | 532 | InstallData item; |
532 | item.option = "D"; | 533 | item.option = "D"; |
533 | item.packageName = p->getInstalledPackageName(); | 534 | if ( !p->isPackageStoredLocally() ) |
535 | item.packageName = p->getInstalledPackageName(); | ||
536 | else | ||
537 | item.packageName = name; | ||
538 | |||
534 | if ( p->getInstalledTo() ) | 539 | if ( p->getInstalledTo() ) |
535 | { | 540 | { |
536 | item.destination = p->getInstalledTo(); | 541 | item.destination = p->getInstalledTo(); |
537 | cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; | 542 | cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; |
538 | cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl; | 543 | cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl; |
539 | } | 544 | } |
540 | else | 545 | else |
541 | { | 546 | { |
542 | item.destination = p->getLocalPackage()->getInstalledTo(); | 547 | item.destination = p->getLocalPackage()->getInstalledTo(); |
543 | } | 548 | } |
544 | 549 | ||
545 | // Now see if version is newer or not | 550 | // Now see if version is newer or not |
546 | int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); | 551 | int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); |
552 | |||
553 | // If the version requested is older and user selected a local ipk file, then reinstall the file | ||
554 | if ( p->isPackageStoredLocally() && val == -1 ) | ||
555 | val = 0; | ||
556 | |||
547 | if ( val == -2 ) | 557 | if ( val == -2 ) |
548 | { | 558 | { |
549 | // Error - should handle | 559 | // Error - should handle |
550 | } | 560 | } |
551 | else if ( val == -1 ) | 561 | else if ( val == -1 ) |
552 | { | 562 | { |
553 | // Version available is older - remove only | 563 | // Version available is older - remove only |
554 | item.option = "D"; | 564 | item.option = "D"; |
555 | } | 565 | } |
556 | else | 566 | else |
557 | { | 567 | { |
558 | QString caption; | 568 | QString caption; |