Hello community, here is the log from the commit of package libyui for openSUSE:Factory checked in at 2016-10-18 13:27:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui (Old) and /work/SRC/openSUSE:Factory/.libyui.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui" Changes: -------- --- /work/SRC/openSUSE:Factory/libyui/libyui.changes 2016-09-27 13:42:59.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libyui.new/libyui.changes 2016-10-18 13:27:14.000000000 +0200 @@ -1,0 +2,9 @@ +Fri Oct 14 11:16:30 CEST 2016 - anase...@linux.it + +- Fix pre-selecting a tree item when adding it, in ncurses + (gh#libyui/libyui#86). The very first item would be selected, + ignoring YTreeItem::setSelected. +- Added ui test before loading extended widget plugin, to avoid + a crash + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ libyui.spec: same change ++++++ libyui-3.2.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.2.7/package/libyui.changes new/libyui-3.2.7/package/libyui.changes --- old/libyui-3.2.7/package/libyui.changes 2016-09-21 15:11:10.000000000 +0200 +++ new/libyui-3.2.7/package/libyui.changes 2016-10-14 11:36:09.000000000 +0200 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Fri Oct 14 11:16:30 CEST 2016 - anase...@linux.it + +- Fix pre-selecting a tree item when adding it, in ncurses + (gh#libyui/libyui#86). The very first item would be selected, + ignoring YTreeItem::setSelected. +- Added ui test before loading extended widget plugin, to avoid + a crash + +------------------------------------------------------------------- Wed Sep 14 07:47:48 UTC 2016 - lsle...@suse.cz - Added editing abilities to the spy dialog (Ctrl+Shift+Alt+Y diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.2.7/src/YExternalWidgets.cc new/libyui-3.2.7/src/YExternalWidgets.cc --- old/libyui-3.2.7/src/YExternalWidgets.cc 2016-09-21 15:11:10.000000000 +0200 +++ new/libyui-3.2.7/src/YExternalWidgets.cc 2016-10-14 11:36:09.000000000 +0200 @@ -56,6 +56,9 @@ { std::map<std::string, YExternalWidgets *>::iterator it; + if (!YUI::ui()) + YUI_THROW( YUIException( "UI must be initialized first" ) ); + it = _externalWidgets.find(name); if (it == _externalWidgets.end()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.2.7/src/YOptionalWidgetFactory.cc new/libyui-3.2.7/src/YOptionalWidgetFactory.cc --- old/libyui-3.2.7/src/YOptionalWidgetFactory.cc 2016-09-21 15:11:10.000000000 +0200 +++ new/libyui-3.2.7/src/YOptionalWidgetFactory.cc 2016-10-14 11:36:09.000000000 +0200 @@ -28,6 +28,9 @@ #include "YLabel.h" #include "YUI.h" +#define YUILogComponent "owf" +#include "YUILog.h" + #define THROW_UNSUPPORTED( WIDGET_TYPE ) \ YUI_THROW( YUIUnsupportedWidgetException( WIDGET_TYPE ) ); \ @@ -43,6 +46,8 @@ YOptionalWidgetFactory::~YOptionalWidgetFactory() { // NOP + yuiMilestone() << "YOptionalWidgetFactory removed" << std::endl; + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.2.7/src/YSelectionWidget.cc new/libyui-3.2.7/src/YSelectionWidget.cc --- old/libyui-3.2.7/src/YSelectionWidget.cc 2016-09-21 15:11:10.000000000 +0200 +++ new/libyui-3.2.7/src/YSelectionWidget.cc 2016-10-14 11:36:09.000000000 +0200 @@ -188,26 +188,26 @@ if ( priv->enforceSingleSelection ) { - if ( item->selected() ) - { - YItem * oldSelectedItem = selectedItem(); + YItem* newItemSelected = NULL; + if ( item->selected() ) + { + newItemSelected = item; + } + else + { + newItemSelected = findSelectedItem( item->childrenBegin(), + item->childrenEnd() ); + } - // This looks expensive, but it is not: Even though selectedItem() - // searches the complete item list until it finds a selected item, - // this happens only if a new item is to be inserted that has the - // "selected" flag on. In the normal case, this will only be one - // item. - // - // Only if the calling application does this systematically wrong - // and sets the "selected" flag for ALL items it inserts this will - // be more expensive. But then, this is a bug in that application - // that needs to be fixed. - - if ( oldSelectedItem && oldSelectedItem != item ) - { - oldSelectedItem->setSelected( false ); - item->setSelected( true ); - } + if ( newItemSelected ) + { + // This looks expensive, but it is not: Even though deselectAllItems() + // searches the complete item list and de select all. + // + // This prevents the calling application does this systematically wrong + // and sets the "selected" flag for more items or children + deselectAllItems(); + newItemSelected->setSelected( true ); } @@ -331,8 +331,9 @@ const YItem * item = *it; if ( item->selected() ) + { return *it; - + } if ( item->hasChildren() ) { YItem * selectedItem = findSelectedItem( item->childrenBegin(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.2.7/src/YWidgetFactory.cc new/libyui-3.2.7/src/YWidgetFactory.cc --- old/libyui-3.2.7/src/YWidgetFactory.cc 2016-09-21 15:11:10.000000000 +0200 +++ new/libyui-3.2.7/src/YWidgetFactory.cc 2016-10-14 11:36:09.000000000 +0200 @@ -28,6 +28,8 @@ #include "YUI.h" #include "YApplication.h" +#define YUILogComponent "wf" +#include "YUILog.h" YWidgetFactory::YWidgetFactory() { @@ -37,6 +39,7 @@ YWidgetFactory::~YWidgetFactory() { // NOP + yuiMilestone() << "YWidgetFactory removed" << std::endl; }