Hello community, here is the log from the commit of package libyui-ncurses-pkg for openSUSE:Factory checked in at 2020-10-18 16:21:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui-ncurses-pkg (Old) and /work/SRC/openSUSE:Factory/.libyui-ncurses-pkg.new.3486 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-ncurses-pkg" Sun Oct 18 16:21:44 2020 rev:43 rq:841238 version:2.50.10 Changes: -------- --- /work/SRC/openSUSE:Factory/libyui-ncurses-pkg/libyui-ncurses-pkg.changes 2020-08-14 13:08:42.577196035 +0200 +++ /work/SRC/openSUSE:Factory/.libyui-ncurses-pkg.new.3486/libyui-ncurses-pkg.changes 2020-10-18 16:22:17.896514243 +0200 @@ -1,0 +2,7 @@ +Fri Oct 9 11:51:30 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Adapt code to changes for nested tables. +- Use new parent lib SO version libyui.so.14 (bsc#1176402). +- 2.50.10 + +------------------------------------------------------------------- Old: ---- libyui-ncurses-pkg-2.50.9.tar.bz2 New: ---- libyui-ncurses-pkg-2.50.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-ncurses-pkg-doc.spec ++++++ --- /var/tmp/diff_new_pack.pRPVWd/_old 2020-10-18 16:22:20.424515369 +0200 +++ /var/tmp/diff_new_pack.pRPVWd/_new 2020-10-18 16:22:20.428515371 +0200 @@ -1,7 +1,7 @@ # # spec file for package libyui-ncurses-pkg-doc # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,15 +12,15 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define parent libyui-ncurses-pkg -%define so_version 13 +%define so_version 14 Name: %{parent}-doc -Version: 2.50.9 +Version: 2.50.10 Release: 0 Source: %{parent}-%{version}.tar.bz2 @@ -34,7 +34,7 @@ BuildRequires: libyui-devel >= 3.9.0 BuildRequires: texlive-latex -Url: http://github.com/libyui/ +URL: http://github.com/libyui/ Summary: Libyui-ncurses-pkg documentation License: LGPL-2.1-only OR LGPL-3.0-only Group: Documentation/HTML ++++++ libyui-ncurses-pkg.spec ++++++ --- /var/tmp/diff_new_pack.pRPVWd/_old 2020-10-18 16:22:20.448515379 +0200 +++ /var/tmp/diff_new_pack.pRPVWd/_new 2020-10-18 16:22:20.452515381 +0200 @@ -1,7 +1,7 @@ # # spec file for package libyui-ncurses-pkg # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,16 +12,16 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: libyui-ncurses-pkg -Version: 2.50.9 +Version: 2.50.10 Release: 0 Source: %{name}-%{version}.tar.bz2 -%define so_version 13 +%define so_version 14 %define bin_name %{name}%{so_version} %if 0%{?suse_version} > 1325 @@ -39,7 +39,7 @@ %define libzypp_devel_version libzypp-devel >= 17.21.0 BuildRequires: %{libzypp_devel_version} -Url: http://github.com/libyui/ +URL: http://github.com/libyui/ Summary: Libyui - yast2 package selector widget for the ncurses UI License: LGPL-2.1-only OR LGPL-3.0-only Group: System/Libraries @@ -67,7 +67,7 @@ # Selectable::hasRetracted() Requires: libzypp >= 17.21.0 -Url: http://github.com/libyui/ +URL: http://github.com/libyui/ Summary: Libyui - yast2 package selector widget for the ncurses UI Group: System/Libraries @@ -90,7 +90,7 @@ Requires: glibc-devel Requires: libstdc++-devel -Url: http://github.com/libyui/ +URL: http://github.com/libyui/ Summary: Libyui-ncurses-pkg header files Group: Development/Languages/C and C++ ++++++ libyui-ncurses-pkg-2.50.9.tar.bz2 -> libyui-ncurses-pkg-2.50.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/VERSION.cmake new/libyui-ncurses-pkg-2.50.10/VERSION.cmake --- old/libyui-ncurses-pkg-2.50.9/VERSION.cmake 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/VERSION.cmake 2020-10-09 16:51:34.000000000 +0200 @@ -1,6 +1,6 @@ SET( VERSION_MAJOR "2" ) SET( VERSION_MINOR "50" ) -SET( VERSION_PATCH "9" ) +SET( VERSION_PATCH "10" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) ##### This is need for the libyui core ONLY. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/package/libyui-ncurses-pkg-doc.spec new/libyui-ncurses-pkg-2.50.10/package/libyui-ncurses-pkg-doc.spec --- old/libyui-ncurses-pkg-2.50.9/package/libyui-ncurses-pkg-doc.spec 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/package/libyui-ncurses-pkg-doc.spec 2020-10-09 16:51:34.000000000 +0200 @@ -16,10 +16,10 @@ # %define parent libyui-ncurses-pkg -%define so_version 13 +%define so_version 14 Name: %{parent}-doc -Version: 2.50.9 +Version: 2.50.10 Release: 0 Source: %{parent}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/package/libyui-ncurses-pkg.changes new/libyui-ncurses-pkg-2.50.10/package/libyui-ncurses-pkg.changes --- old/libyui-ncurses-pkg-2.50.9/package/libyui-ncurses-pkg.changes 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/package/libyui-ncurses-pkg.changes 2020-10-09 16:51:34.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Oct 9 11:51:30 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Adapt code to changes for nested tables. +- Use new parent lib SO version libyui.so.14 (bsc#1176402). +- 2.50.10 + +------------------------------------------------------------------- Tue Aug 11 14:25:32 UTC 2020 - Stefan Hundhammer <shundham...@suse.com> - Use new parent lib SO version libyui.so.13 (bsc#1175115) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/package/libyui-ncurses-pkg.spec new/libyui-ncurses-pkg-2.50.10/package/libyui-ncurses-pkg.spec --- old/libyui-ncurses-pkg-2.50.9/package/libyui-ncurses-pkg.spec 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/package/libyui-ncurses-pkg.spec 2020-10-09 16:51:34.000000000 +0200 @@ -17,11 +17,11 @@ Name: libyui-ncurses-pkg -Version: 2.50.9 +Version: 2.50.10 Release: 0 Source: %{name}-%{version}.tar.bz2 -%define so_version 13 +%define so_version 14 %define bin_name %{name}%{so_version} %if 0%{?suse_version} > 1325 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPackageSelector.cc new/libyui-ncurses-pkg-2.50.10/src/NCPackageSelector.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPackageSelector.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPackageSelector.cc 2020-10-09 16:51:34.000000000 +0200 @@ -1133,7 +1133,7 @@ } else { - pkgList->setCurrentItem(0); + pkgList->scrollToFirstItem(); pkgList->showInformation(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterClassification.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterClassification.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterClassification.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterClassification.cc 2020-10-09 16:51:34.000000000 +0200 @@ -152,7 +152,7 @@ } // show the package list - packageList->setCurrentItem( 0 ); + packageList->scrollToFirstItem(); packageList->drawList(); packageList->showInformation(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterInstSummary.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterInstSummary.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterInstSummary.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterInstSummary.cc 2020-10-09 16:51:34.000000000 +0200 @@ -150,7 +150,7 @@ } // show the package list - packageList->setCurrentItem( 0 ); + packageList->scrollToFirstItem(); packageList->drawList(); packageList->showInformation(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterLocale.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterLocale.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterLocale.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterLocale.cc 2020-10-09 16:51:34.000000000 +0200 @@ -73,9 +73,9 @@ std::vector <std::string> header; header.reserve(4); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::LangCode() ); - header.push_back( "L" + NCPkgStrings::LangName() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::LangCode() ); + header.push_back( NCPkgStrings::LangName() ); setHeader( header); } @@ -136,7 +136,7 @@ addLine( myLocale, oneLine, status(*it) ); } - myPad()->setOrder(1); + sortItems( 1 ); } @@ -185,7 +185,7 @@ s << boost::format( _( "Translations, dictionaries and other language-related files for <b>%s</b> locale" )) % myLocale.locale().code(); packager->FilterDescription()->setText( s.str() ); - packageList->setCurrentItem( 0 ); + packageList->scrollToFirstItem(); packageList->drawList(); packageList->showInformation(); } @@ -213,7 +213,8 @@ } packager->showPackageDependencies( true ); - cellChanged( index, 0, status( myLocale.locale() ) ); + NCTableCol * cell = line->GetCol( 0 ); + cell->SetLabel( NCstring( status( myLocale.locale() ) ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterPattern.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterPattern.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterPattern.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterPattern.cc 2020-10-09 16:51:34.000000000 +0200 @@ -184,7 +184,7 @@ packager->PatternLabel()->setLabel ( s.str() ); - packageList->setCurrentItem( 0 ); + packageList->scrollToFirstItem(); packageList->drawList(); packageList->showInformation(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterRepo.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterRepo.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterRepo.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterRepo.cc 2020-10-09 16:51:34.000000000 +0200 @@ -103,8 +103,8 @@ std::vector <std::string> header; header.reserve(2); - header.push_back( "L" ); - header.push_back( "L" + NCPkgStrings::PkgName() ); + header.push_back( "" ); + header.push_back( NCPkgStrings::PkgName() ); setHeader( header); } @@ -269,7 +269,7 @@ packager->FilterDescription()->setText( showDescription( repo ) ); - pkgList->setCurrentItem( 0 ); + pkgList->scrollToFirstItem(); pkgList->drawList(); pkgList->showInformation(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterSearch.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterSearch.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterSearch.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterSearch.cc 2020-10-09 16:51:34.000000000 +0200 @@ -280,7 +280,7 @@ if ( found_pkgs > 0 ) { - packageList->setCurrentItem( 0 ); + packageList->scrollToFirstItem(); packageList->showInformation(); packageList->setKeyboardFocus(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterService.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterService.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgFilterService.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgFilterService.cc 2020-10-09 16:51:34.000000000 +0200 @@ -101,8 +101,8 @@ std::vector <std::string> header; header.reserve(2); - header.push_back( "L" ); - header.push_back( "L" + NCPkgStrings::PkgName() ); + header.push_back( "" ); + header.push_back( NCPkgStrings::PkgName() ); setHeader( header); } @@ -262,7 +262,7 @@ packager->FilterDescription()->setText( getDescription( service ) ); - pkgList->setCurrentItem( 0 ); + pkgList->scrollToFirstItem(); pkgList->drawList(); pkgList->showInformation(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgMenuView.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgMenuView.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgMenuView.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgMenuView.cc 2020-10-09 16:51:34.000000000 +0200 @@ -107,6 +107,13 @@ return false; NCPkgTable *pkgList = pkg->PackageList(); + + if ( pkgList->getNumLines() == 0 ) + { + yuiWarning() << "package list empty" << endl; + return true; + } + int idx = pkgList->getCurrentItem(); ZyppObj pkgPtr = pkgList->getDataPointer( idx ); @@ -114,7 +121,7 @@ if ( !pkgPtr || !slbPtr) { - yuiWarning() << "package list empty - no package pointer" << endl; + yuiWarning() << "no package pointer" << endl; return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgTable.cc new/libyui-ncurses-pkg-2.50.10/src/NCPkgTable.cc --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgTable.cc 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgTable.cc 2020-10-09 16:51:34.000000000 +0200 @@ -152,7 +152,6 @@ // use all-at-once insertion mode - DrawPad() is called only after the loop addItem( tabItem, true ); - } @@ -162,12 +161,6 @@ } -void NCPkgTable::cellChanged( int index, int colnum, const string & newtext ) -{ - return NCTable::cellChanged( index, colnum, newtext ); -} - - // // Set the new status in the first column of the package table and in libzypp // @@ -384,7 +377,7 @@ if ( getStatus(index) != newstatus ) { cc->setStatus( newstatus ); - cellChanged( index, 0, cc->statusToString (newstatus) ); + setCell( index, 0, cc->statusToString (newstatus) ); } } } @@ -419,93 +412,93 @@ slbHasInstalledObj) != zyppPkgEnd(); header.reserve(7); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PkgName() ); - header.push_back( "L" + NCPkgStrings::PkgSummary() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PkgName() ); + header.push_back( NCPkgStrings::PkgSummary() ); if ( haveInstalledPkgs > 0 ) { - header.push_back( "L" + NCPkgStrings::PkgVersionNew() ); - header.push_back( "L" + NCPkgStrings::PkgVersionInst() ); + header.push_back( NCPkgStrings::PkgVersionNew() ); + header.push_back( NCPkgStrings::PkgVersionInst() ); haveInstalledVersion = true; } else { - header.push_back( "L" + NCPkgStrings::PkgVersion() ); + header.push_back( NCPkgStrings::PkgVersion() ); } - header.push_back( "L" + NCPkgStrings::PkgSize() ); + header.push_back( NCPkgStrings::PkgSize() ); #if SOURCE_INSTALL_SUPPORTED - header.push_back( "L" + NCPkgStrings::PkgSource() ); + header.push_back( NCPkgStrings::PkgSource() ); #endif break; } case T_PatchPkgs: { header.reserve(7); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PkgName() ); - header.push_back( "L" + NCPkgStrings::PkgVersionNew() ); - header.push_back( "L" + NCPkgStrings::PkgVersionInst() ); - header.push_back( "L" + NCPkgStrings::PkgSummary() ); - header.push_back( "L" + NCPkgStrings::PkgSize() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PkgName() ); + header.push_back( NCPkgStrings::PkgVersionNew() ); + header.push_back( NCPkgStrings::PkgVersionInst() ); + header.push_back( NCPkgStrings::PkgSummary() ); + header.push_back( NCPkgStrings::PkgSize() ); break; } case T_Patches: { header.reserve(6); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PkgName() ); - header.push_back( "L" + NCPkgStrings::PatchKind() ); - header.push_back( "L" + NCPkgStrings::PkgSummary() ); - header.push_back( "L" + NCPkgStrings::PkgVersion() ); - // header.push_back( "L" + NCPkgStrings::PkgSize() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PkgName() ); + header.push_back( NCPkgStrings::PatchKind() ); + header.push_back( NCPkgStrings::PkgSummary() ); + header.push_back( NCPkgStrings::PkgVersion() ); + // header.push_back( NCPkgStrings::PkgSize() ); break; } case T_Selections: { header.reserve(3); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PatternsLabel() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PatternsLabel() ); break; } case T_Languages: { header.reserve(4); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::LangCode() ); - header.push_back( "L" + NCPkgStrings::LangName() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::LangCode() ); + header.push_back( NCPkgStrings::LangName() ); break; } case T_Availables: { header.reserve(6); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PkgName() ); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PkgVersion() ); - header.push_back( "L" + NCPkgStrings::PkgInstSource() ); - header.push_back( "L" + NCPkgStrings::PkgSize() ); - header.push_back( "L" + NCPkgStrings::PkgArch() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PkgName() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PkgVersion() ); + header.push_back( NCPkgStrings::PkgInstSource() ); + header.push_back( NCPkgStrings::PkgSize() ); + header.push_back( NCPkgStrings::PkgArch() ); break; } case T_MultiVersion: { header.reserve(5); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PkgName() ); - header.push_back( "L" + NCPkgStrings::PkgVersion() ); - header.push_back( "L" + NCPkgStrings::PkgInstSource() ); - header.push_back( "L" + NCPkgStrings::PkgSize() ); - header.push_back( "L" + NCPkgStrings::PkgArch() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PkgName() ); + header.push_back( NCPkgStrings::PkgVersion() ); + header.push_back( NCPkgStrings::PkgInstSource() ); + header.push_back( NCPkgStrings::PkgSize() ); + header.push_back( NCPkgStrings::PkgArch() ); break; } default: { header.reserve(4); - header.push_back( "L" + NCPkgStrings::PkgStatus() ); - header.push_back( "L" + NCPkgStrings::PkgName() ); - header.push_back( "L" + NCPkgStrings::PkgSummary() ); + header.push_back( NCPkgStrings::PkgStatus() ); + header.push_back( NCPkgStrings::PkgName() ); + header.push_back( NCPkgStrings::PkgSummary() ); break; } } @@ -730,6 +723,12 @@ bool NCPkgTable::showInformation() { + if ( getCurrentItem() == -1 ) + { + yuiWarning() << "no selected package" << endl; + return false; + } + ZyppObj objPtr = getDataPointer( getCurrentItem() ); ZyppSel slbPtr = getSelPointer( getCurrentItem() ); @@ -1080,9 +1079,7 @@ // show the package list drawList(); - - if ( getNumLines() > 0 ) - setCurrentItem( 0 ); + scrollToFirstItem(); return true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.50.9/src/NCPkgTable.h new/libyui-ncurses-pkg-2.50.10/src/NCPkgTable.h --- old/libyui-ncurses-pkg-2.50.9/src/NCPkgTable.h 2020-08-12 10:31:18.000000000 +0200 +++ new/libyui-ncurses-pkg-2.50.10/src/NCPkgTable.h 2020-10-09 16:51:34.000000000 +0200 @@ -1,6 +1,7 @@ /**************************************************************************** | | Copyright (c) [2002-2011] Novell, Inc. +| Copyright (C) 2020 SUSE LLC | All Rights Reserved. | | This program is free software; you can redistribute it and/or @@ -46,6 +47,7 @@ #include "NCPadWidget.h" #include "NCTablePad.h" #include "NCTable.h" +#include "NCTableItem.h" #include "NCPkgStrings.h" #include <map> @@ -63,7 +65,6 @@ * This class is used for the first column of the package table * which contains the status information of the package (installed, * not installed, to be deleted and so on). - * **/ class NCPkgTableTag : public YTableCell { @@ -97,49 +98,77 @@ public: NCPkgTableSort( const std::vector<std::string> & head ) - : _header ( head ) + : _header( head ) {} - virtual void sort ( std::vector<NCTableLine *>::iterator itemsBegin, - std::vector<NCTableLine *>::iterator itemsEnd ) override + virtual void sort( YItemIterator itemsBegin, + YItemIterator itemsEnd ) override { - if ( _header[ getColumn() ] == NCPkgStrings::PkgSize() ) + if ( _header[ sortCol() ] == NCPkgStrings::PkgSize() ) { std::sort( itemsBegin, itemsEnd, CompareSize() ); } - else if ( _header[ getColumn() ] == NCPkgStrings::PkgName() ) + else if ( _header[ sortCol() ] == NCPkgStrings::PkgName() ) { - std::sort( itemsBegin, itemsEnd, CompareName( getColumn() ) ); + std::sort( itemsBegin, itemsEnd, CompareName( sortCol() ) ); } else { - std::sort( itemsBegin, itemsEnd, Compare( getColumn() ) ); + std::sort( itemsBegin, itemsEnd, Compare( sortCol() ) ); } - if ( isReverse() ) + if ( reverse() ) std::reverse( itemsBegin, itemsEnd ); } private: + std::vector<std::string> _header; + /** + * Return the content of column no. 'col' for an item. + **/ + static std::wstring cellContent( YItem * item, int col ) + { + std::wstring empty; + + if ( ! item ) + return empty; + + YTableItem * tableItem = dynamic_cast<YTableItem *>( item ); + + if ( ! tableItem ) + return empty; + + YTableCell * tableCell = tableItem->cell( col ); + + if ( ! tableCell ) + return empty; + + return NCstring( tableCell->label() ).str(); + } + + class CompareSize { public: CompareSize() {} - bool operator() ( const NCTableLine * first, - const NCTableLine * second ) const + bool operator() ( YItem * item1, YItem * item2 ) const { - const YTableItem *firstItem = dynamic_cast<const YTableItem*> (first->origItem() ); - const YTableItem *secondItem = dynamic_cast<const YTableItem*> (second->origItem() ); - const NCPkgTableTag *firstTag = static_cast<const NCPkgTableTag *>( firstItem->cell(0) ); - const NCPkgTableTag *secondTag = static_cast<const NCPkgTableTag *>( secondItem->cell(0) ); + YTableItem * tableItem1 = dynamic_cast<YTableItem *>( item1 ); + YTableItem * tableItem2 = dynamic_cast<YTableItem *>( item2 ); + + if ( ! tableItem1 ) return true; + if ( ! tableItem2 ) return true; + + const NCPkgTableTag * tag1 = static_cast<const NCPkgTableTag *>( tableItem1->cell(0) ); + const NCPkgTableTag * tag2 = static_cast<const NCPkgTableTag *>( tableItem2->cell(0) ); - return firstTag->getDataPointer()->installSize() < - secondTag->getDataPointer()->installSize(); + return tag1->getDataPointer()->installSize() < + tag2->getDataPointer()->installSize(); } }; @@ -147,15 +176,14 @@ class CompareName { public: - CompareName( int uiCol) - : _uiCol(uiCol) + CompareName( int uiCol ) + : _uiCol( uiCol ) {} - bool operator() ( const NCTableLine * first, - const NCTableLine * second ) const + bool operator() ( YItem * item1, YItem * item2 ) const { - std::wstring w1 = first->GetCol( _uiCol )->Label().getText().begin()->str(); - std::wstring w2 = second->GetCol( _uiCol )->Label().getText().begin()->str(); + std::wstring w1 = cellContent( item1, _uiCol ); + std::wstring w2 = cellContent( item2, _uiCol ); // It is safe to use collate unaware wscasecmp() here because package names // are 7 bit ASCII only. Better yet, we don't even want this to be sorted @@ -175,15 +203,14 @@ class Compare { public: - Compare ( int uiCol) - : _uiCol (uiCol) + Compare( int uiCol ) + : _uiCol( uiCol ) {} - bool operator() ( const NCTableLine * first, - const NCTableLine * second ) const + bool operator() ( YItem * item1, YItem * item2 ) const { - std::wstring w1 = first->GetCol( _uiCol )->Label().getText().begin()->str(); - std::wstring w2 = second->GetCol( _uiCol )->Label().getText().begin()->str(); + std::wstring w1 = cellContent( item1, _uiCol ); + std::wstring w2 = cellContent( item2, _uiCol ); int result = wcscoll ( w1.data(), w2.data() ); @@ -195,6 +222,7 @@ }; }; + /** * The package table class. Provides methods to fill the table, * set the status info and so on. @@ -293,7 +321,7 @@ /** * Draws the package list (has to be called after the loop with addLine() calls) */ - void drawList() { myPad()->setOrder(1); return DrawPad(); } + void drawList() { sortItems( 1 ); return DrawPad(); } /** * Clears the package list @@ -301,15 +329,6 @@ virtual void itemsCleared(); /** - * Changes the contents of a certain cell in table - * @param index The table line - * @param column The column - * @param newtext The new text - * @eturn void - */ - virtual void cellChanged( int index, int colnum, const std::string & newtext ); - - /** * Returns the contents of a certain cell in table * @param index The table line * @param column The column