Hello community, here is the log from the commit of package yast2-qt for openSUSE:Factory checked in at 2012-05-07 22:54:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-qt (Old) and /work/SRC/openSUSE:Factory/.yast2-qt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-qt", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-qt/yast2-qt.changes 2012-04-23 16:14:30.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-qt.new/yast2-qt.changes 2012-05-07 22:54:03.000000000 +0200 @@ -1,0 +2,6 @@ +Fri May 4 10:22:36 CEST 2012 - [email protected] + +- Sort numeric table columns in numeric order +- Version: 2.22.6 + +------------------------------------------------------------------- Old: ---- yast2-qt-2.22.5.tar.bz2 New: ---- yast2-qt-2.22.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-qt.spec ++++++ --- /var/tmp/diff_new_pack.78yQSs/_old 2012-05-07 22:54:04.000000000 +0200 +++ /var/tmp/diff_new_pack.78yQSs/_new 2012-05-07 22:54:04.000000000 +0200 @@ -18,11 +18,11 @@ Name: yast2-qt -Version: 2.22.5 +Version: 2.22.6 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-qt-2.22.5.tar.bz2 +Source0: yast2-qt-2.22.6.tar.bz2 Group: System/YaST License: GPL-2.0 BuildRequires: docbook-xsl-stylesheets ++++++ yast2-qt-2.22.5.tar.bz2 -> yast2-qt-2.22.6.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-qt-2.22.5/VERSION.cmake new/yast2-qt-2.22.6/VERSION.cmake --- old/yast2-qt-2.22.5/VERSION.cmake 2012-04-10 15:42:07.000000000 +0200 +++ new/yast2-qt-2.22.6/VERSION.cmake 2012-05-04 15:34:45.000000000 +0200 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "22") -SET(VERSION_PATCH "5") +SET(VERSION_PATCH "6") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-qt-2.22.5/package/yast2-qt.changes new/yast2-qt-2.22.6/package/yast2-qt.changes --- old/yast2-qt-2.22.5/package/yast2-qt.changes 2012-04-10 15:42:07.000000000 +0200 +++ new/yast2-qt-2.22.6/package/yast2-qt.changes 2012-05-04 15:34:45.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri May 4 10:22:36 CEST 2012 - [email protected] + +- Sort numeric table columns in numeric order +- Version: 2.22.6 + +------------------------------------------------------------------- Tue Apr 10 15:40:58 CEST 2012 - [email protected] - BuildRequire libxcrypt-devel only for < 12.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-qt-2.22.5/src/QY2ListView.cc new/yast2-qt-2.22.6/src/QY2ListView.cc --- old/yast2-qt-2.22.5/src/QY2ListView.cc 2012-04-10 15:42:07.000000000 +0200 +++ new/yast2-qt-2.22.6/src/QY2ListView.cc 2012-05-04 15:34:45.000000000 +0200 @@ -437,6 +437,25 @@ } + // numeric sorting if columns are numbers + int column = treeWidget()->sortColumn(); + QString text1=text(column).trimmed(); + QString text2=otherListViewItem.text(column).trimmed(); + + text1=text1.left(text1.indexOf(QChar(' '))); + text2=text2.left(text2.indexOf(QChar(' '))); + + bool ok1, ok2; // conversion to int successful + bool retval = text1.toInt(&ok1) < text2.toInt(&ok2); + + if (ok1 && ok2 ) + return retval; // int < int + else if (ok1 && !ok2) + return true; // int < string + else if (!ok1 && ok2) + return false; // string > int + + // and finally non-numeric sorting is done by the base class return QTreeWidgetItem::operator<(otherListViewItem); } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
