Hello community,

here is the log from the commit of package libyui-qt-pkg for openSUSE:Factory 
checked in at 2018-08-02 14:55:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-qt-pkg (Old)
 and      /work/SRC/openSUSE:Factory/.libyui-qt-pkg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libyui-qt-pkg"

Thu Aug  2 14:55:17 2018 rev:37 rq:626440 version:2.45.20

Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-qt-pkg/libyui-qt-pkg.changes      
2018-07-28 12:36:58.692031167 +0200
+++ /work/SRC/openSUSE:Factory/.libyui-qt-pkg.new/libyui-qt-pkg.changes 
2018-08-02 14:55:21.171996677 +0200
@@ -1,0 +2,7 @@
+Thu Jul 26 12:11:44 UTC 2018 - lsle...@suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.45.20
+
+-------------------------------------------------------------------

Old:
----
  libyui-qt-pkg-2.45.19.tar.bz2

New:
----
  libyui-qt-pkg-2.45.20.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libyui-qt-pkg-doc.spec ++++++
--- /var/tmp/diff_new_pack.0vBC14/_old  2018-08-02 14:55:22.139998295 +0200
+++ /var/tmp/diff_new_pack.0vBC14/_new  2018-08-02 14:55:22.139998295 +0200
@@ -17,10 +17,10 @@
 
 
 %define parent libyui-qt-pkg
-%define so_version 8
+%define so_version 9
 
 Name:           %{parent}-doc
-Version:        2.45.19
+Version:        2.45.20
 Release:        0
 Source:         %{parent}-%{version}.tar.bz2
 

++++++ libyui-qt-pkg.spec ++++++
--- /var/tmp/diff_new_pack.0vBC14/_old  2018-08-02 14:55:22.159998328 +0200
+++ /var/tmp/diff_new_pack.0vBC14/_new  2018-08-02 14:55:22.159998328 +0200
@@ -17,11 +17,11 @@
 
 
 Name:           libyui-qt-pkg
-Version:        2.45.19
+Version:        2.45.20
 Release:        0
 Source:         %{name}-%{version}.tar.bz2
 
-%define so_version 8
+%define so_version 9
 %define bin_name %{name}%{so_version}
 
 %if 0%{?suse_version} > 1325

++++++ libyui-qt-pkg-2.45.19.tar.bz2 -> libyui-qt-pkg-2.45.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/VERSION.cmake 
new/libyui-qt-pkg-2.45.20/VERSION.cmake
--- old/libyui-qt-pkg-2.45.19/VERSION.cmake     2018-07-18 16:48:24.000000000 
+0200
+++ new/libyui-qt-pkg-2.45.20/VERSION.cmake     2018-07-30 11:37:37.000000000 
+0200
@@ -1,6 +1,6 @@
 SET( VERSION_MAJOR "2" )
 SET( VERSION_MINOR "45" )
-SET( VERSION_PATCH "19" )
+SET( VERSION_PATCH "20" )
 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-qt-pkg-2.45.19/package/libyui-qt-pkg-doc.spec 
new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg-doc.spec
--- old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg-doc.spec    2018-07-18 
16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg-doc.spec    2018-07-30 
11:37:37.000000000 +0200
@@ -17,10 +17,10 @@
 
 
 %define parent libyui-qt-pkg
-%define so_version 8
+%define so_version 9
 
 Name:           %{parent}-doc
-Version:        2.45.19
+Version:        2.45.20
 Release:        0
 Source:         %{parent}-%{version}.tar.bz2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.changes 
new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.changes
--- old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.changes     2018-07-18 
16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.changes     2018-07-30 
11:37:37.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Jul 26 12:11:44 UTC 2018 - lsle...@suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.45.20
+
+-------------------------------------------------------------------
 Tue Jul  3 17:10:19 UTC 2018 - lsle...@suse.cz
 
 - Fixes for file systems >8EiB (bsc#991090):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.spec 
new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.spec
--- old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.spec        2018-07-18 
16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.spec        2018-07-30 
11:37:37.000000000 +0200
@@ -17,11 +17,11 @@
 
 
 Name:           libyui-qt-pkg
-Version:        2.45.19
+Version:        2.45.20
 Release:        0
 Source:         %{name}-%{version}.tar.bz2
 
-%define so_version 8
+%define so_version 9
 %define bin_name %{name}%{so_version}
 
 %if 0%{?suse_version} > 1325
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.cc 
new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.cc
--- old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.cc 2018-07-18 
16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.cc 2018-07-30 
11:37:37.000000000 +0200
@@ -53,6 +53,8 @@
 #include "YQPkgDiskUsageWarningDialog.h"
 #include "YQi18n.h"
 
+// arbitrary precision integer
+#include <boost/multiprecision/cpp_int.hpp>
 
 using std::set;
 using std::endl;
@@ -253,7 +255,7 @@
 
                    if ( percent != item->usedPercent() )
                    {
-                       partitionDu.pkg_size = double(partitionDu.total_size) * 
percent / 100;
+                       partitionDu.pkg_size = partitionDu.total_size / 100 * 
percent;
 
                        runningOutWarning.clear();
                        overflowWarning.clear();
@@ -283,78 +285,20 @@
     yuiDebug() << "disk usage list entry for " << partitionDu.dir << endl;
 }
 
-// FIXME: workaround to override the QY2DiskUsageListItem issue with large 
disks
-void
-YQPkgDiskUsageListItem::updateStatus()
-{
-    init( false );
-}
-
-// FIXME: workaround to override the QY2DiskUsageListItem issue with large 
disks
-void
-YQPkgDiskUsageListItem::updateData()
-{
-    init( true );
-}
 
-namespace {
-    // FIXME: workaround for a broken formatting in the FSize class for sizes 
>8EiB
-       QString formatSize(double size, int width = 0)
-       {
-               // FSize::bestUnit does not work for huge numbers so only use 
it for small ones
-               FSize::Unit unit = (size >= FSize::TB) ? FSize::T : 
FSize(size).bestUnit();
-               // FIXME: the precision is different than in the ncurses UI (it 
uses 1), unify it!
-               int prec = unit == FSize::B ? 0 : 2;
-
-               return QString("%1 %2").arg(size / FSize::factor(unit), 0, 'f', 
prec).arg(FSize::unit(unit));
-       }
-}
-
-// FIXME: workaround to override the QY2DiskUsageListItem issue with large 
disks,
-// copied from QY2DiskUsageList.cc from libyui-qt to have minimal changes,
-// modified to use "double" data type to avoid overflow
-void
-YQPkgDiskUsageListItem::init( bool allFields )
-{
-    setSizeHint( percentageBarCol(), QSize( 20, 10 ) );
-
-    setTextAlignment( usedSizeCol(), Qt::AlignRight );
-    setTextAlignment( freeSizeCol(), Qt::AlignRight );
-    setTextAlignment( totalSizeCol(), Qt::AlignRight );
-
-    if ( usedSizeCol()         >= 0 ) setText( usedSizeCol(), 
double(_partitionDu.pkg_size) * FSize::KB );
-    if ( freeSizeCol()         >= 0 ) setText( freeSizeCol(), 
double(_partitionDu.total_size - _partitionDu.pkg_size) * FSize::KB );
-
-    if ( allFields )
-    {
-        if ( totalSizeCol()    >= 0 ) setText( totalSizeCol(), 
double(_partitionDu.total_size) * FSize::KB );
-        if ( nameCol()         >= 0 ) setText( nameCol(),              name()  
);
-        if ( deviceNameCol()   >= 0 ) setText( deviceNameCol(),        
deviceName()    );
-    }
-
-    if ( usedSizeCol() < 0 )
-         setToolTip( freeSizeCol(), _( "Used %1" ).arg( 
formatSize(double(_partitionDu.pkg_size) * FSize::KB)));
-}
-
-void
-YQPkgDiskUsageListItem::setText( int column, double size )
-{
-    QString sizeText = formatSize(size);
-    setText( column, sizeText );
-}
-
-// FIXME: not used, does not support large disks
 FSize
 YQPkgDiskUsageListItem::usedSize() const
 {
-    return FSize( _partitionDu.pkg_size, FSize::K );
+    // the libzypp size is in KiB
+    return FSize( _partitionDu.pkg_size, FSize::Unit::K );
 }
 
-// FIXME: not used, does not support large disks
+
 FSize
 YQPkgDiskUsageListItem::totalSize() const
 {
-    return FSize( _partitionDu.total_size, FSize::K );
+    // the libzypp size is in KiB
+    return FSize( _partitionDu.total_size, FSize::Unit::K );
 }
 
 
@@ -378,9 +322,11 @@
 YQPkgDiskUsageListItem::checkRemainingDiskSpace()
 {
     int        percent = usedPercent();
+    // free size in MiB
+    boost::multiprecision::cpp_int free = freeSize().in_unit(FSize::Unit::M);
 
-    // free size (MiB) - the libzypp sizes are in KiB so just divide by 1024 
to get MiB
-    long long free = (_partitionDu.total_size - _partitionDu.pkg_size) / 1024;
+    yuiDebug() << "Partition " << _partitionDu.dir << " free percent: " <<
+        percent << "%, " << " free: " << freeSize() << " (" << free << "MiB)" 
<< endl;
 
     if ( percent > MIN_PERCENT_WARN )
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.h 
new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.h
--- old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.h  2018-07-18 
16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.h  2018-07-30 
11:37:37.000000000 +0200
@@ -277,41 +277,6 @@
      **/
     void checkRemainingDiskSpace();
 
-    // FIXME: the following methods were copied from QY2DiskUsageList class
-    // from libyui-qt to have minimal changes,
-    // this is a workaround to fix the QY2DiskUsageListItem issue with large 
disks
-
-    /**
-     * Update this item's status ( here: the numeric fields ).
-     * Triggered by QY2ListView::updateAllItemStates().
-     *
-     * Reimplemented from QY2ListViewItem.
-     **/
-    virtual void updateStatus();
-
-    /**
-     * Update this item's data completely.
-     * Triggered by QY2ListView::updateAllItemData().
-     *
-     * Reimplemented from QY2ListViewItem.
-     **/
-    virtual void updateData();
-
-    void init( bool allFields );
-
-    /**
-     * Re-declare ordinary setText() method so the compiler doesn't get
-     * confused which one to use.
-     **/
-    void setText( int column, const QString & text )
-    { QTreeWidgetItem::setText( column, text ); }
-
-    /**
-     * set the text label with the size
-     * @param column column to set
-     * @param size   the size value
-     */
-    void setText( int column, double size );
 
 protected:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/src/YQPkgPatchFilterView.cc 
new/libyui-qt-pkg-2.45.20/src/YQPkgPatchFilterView.cc
--- old/libyui-qt-pkg-2.45.19/src/YQPkgPatchFilterView.cc       2018-07-18 
16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/src/YQPkgPatchFilterView.cc       2018-07-30 
11:37:37.000000000 +0200
@@ -196,7 +196,7 @@
          ++it )
     {
        if ( (*it)->candidateObj() )
-           totalSize += (*it)->candidateObj()->installSize();
+           totalSize += 
zypp::ByteCount::SizeType((*it)->candidateObj()->installSize());
     }
 
 #if ENABLE_TOTAL_DOWNLOAD_SIZE


Reply via email to