Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index b892b30..be20c71 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp @@ -30,23 +30,32 @@ PackageList::~PackageList() { } /** Inserts a package into the list */ void PackageList::insertPackage( Package* pack ) { + if (!pack) return; Package* p = packageList.find( pack->name() ); if ( p ) { + if ( p->version() == pack->version() ) + { p->copyValues( pack ); delete pack; pack = p; }else{ + p->setName( pack->name()+"["+p->version()+"]" ); + pack->setName( pack->name()+"["+pack->version()+"]" ); + packageList.insert( pack->name(), pack ); + origPackageList.insert( pack->name(), pack ); + } + }else{ packageList.insert( pack->name(), pack ); origPackageList.insert( pack->name(), pack ); - empty=false; }; + empty=false; updateSections( pack ); } void PackageList::filterPackages( QString f ) { packageList.clear(); |