[yast-commit] r46825 - /trunk/qt-pkg/src/YQPkgVersionsView.cc
Author: dmacvicar Date: Fri Apr 18 12:32:41 2008 New Revision: 46825 URL: http://svn.opensuse.org/viewcvs/yast?rev=46825&view=rev Log: make versions widget work (bnc #354983) Modified: trunk/qt-pkg/src/YQPkgVersionsView.cc Modified: trunk/qt-pkg/src/YQPkgVersionsView.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgVersionsView.cc?rev=46825&r1=46824&r2=46825&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgVersionsView.cc (original) +++ trunk/qt-pkg/src/YQPkgVersionsView.cc Fri Apr 18 12:32:41 2008 @@ -74,8 +74,6 @@ _userCanSwitch = userCanSwitch; _buttons = new QButtonGroup(parent); - - connect( _buttons, SIGNAL(clicked(QAbstractButton *)), SLOT(checkForChangedCandidate()) ); if ( _parentTab ) { @@ -182,6 +180,8 @@ while ( it != selectable->availableEnd() ) { QRadioButton *b = new YQPkgVersion( this, selectable, *it, _userCanSwitch ); + connect( b, SIGNAL(clicked(bool)), SLOT(checkForChangedCandidate()) ); + _buttons->addButton(b); _layout->addWidget(b); @@ -203,68 +203,67 @@ void YQPkgVersionsView::checkForChangedCandidate() -{ - - QListIterator<QAbstractButton*> it(_buttons->buttons()); - while (it.hasNext()) - { - YQPkgVersion * versionItem = dynamic_cast<YQPkgVersion *> (it.next()); - - if ( versionItem && versionItem->isChecked() ) - { - ZyppObj newCandidate = versionItem->zyppObj(); - - if ( newCandidate != _selectable->candidateObj() ) - { - yuiMilestone() << "Candidate changed" << endl; - - // Change status of selectable - - ZyppStatus status = _selectable->status(); - - if ( !_selectable->installedEmpty() && - _selectable->installedObj()->arch() == newCandidate->arch() && - _selectable->installedObj()->edition() == newCandidate->edition() ) - { - // Switch back to the original instance - - // the version that was previously installed +{ + QListIterator<QAbstractButton*> it(_buttons->buttons()); + while (it.hasNext()) + { + YQPkgVersion * versionItem = dynamic_cast<YQPkgVersion *> (it.next()); + + if ( versionItem && versionItem->isChecked() ) + { + ZyppObj newCandidate = versionItem->zyppObj(); + + if ( newCandidate != _selectable->candidateObj() ) + { + yuiMilestone() << "Candidate changed" << endl; + + // Change status of selectable + + ZyppStatus status = _selectable->status(); + + if ( !_selectable->installedEmpty() && + _selectable->installedObj()->arch() == newCandidate->arch() && + _selectable->installedObj()->edition() == newCandidate->edition() ) + { + // Switch back to the original instance - + // the version that was previously installed status = S_KeepInstalled; - } - else - { - switch ( status ) - { - case S_KeepInstalled: - case S_Protected: - case S_AutoDel: - case S_AutoUpdate: - case S_Del: - case S_Update: - - status = S_Update; - break; - - case S_NoInst: - case S_Taboo: - case S_Install: - case S_AutoInstall: - status = S_Install; - break; - } - } - - _selectable->setStatus( status ); - - - // Set candidate - - _selectable->setCandidate( newCandidate ); - emit candidateChanged( newCandidate ); - return; - } - } - - } + } + else + { + switch ( status ) + { + case S_KeepInstalled: + case S_Protected: + case S_AutoDel: + case S_AutoUpdate: + case S_Del: + case S_Update: + + status = S_Update; + break; + + case S_NoInst: + case S_Taboo: + case S_Install: + case S_AutoInstall: + status = S_Install; + break; + } + } + + _selectable->setStatus( status ); + + + // Set candidate + + _selectable->setCandidate( newCandidate ); + emit candidateChanged( newCandidate ); + return; + } + } + + } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org