Skip to content

Commit

Permalink
Use new FSize
Browse files Browse the repository at this point in the history
Update so version

- 2.49.5
  • Loading branch information
lslezak committed Jul 26, 2018
1 parent 6d2894d commit d3b8d6e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Makefile.in
# CMake
CMakeCache.txt
CMakeFiles
CMakeLists.txt
/CMakeLists.txt
Makefile
cmake_install.cmake
install_manifest.txt
Expand Down
2 changes: 1 addition & 1 deletion VERSION.cmake
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions package/libyui-qt-pkg-doc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions package/libyui-qt-pkg.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jul 26 12:11:44 UTC 2018 - lslezak@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 - lslezak@suse.cz

Expand Down
4 changes: 2 additions & 2 deletions package/libyui-qt-pkg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions src/YQPkgDiskUsageList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "YQPkgDiskUsageWarningDialog.h"
#include "YQi18n.h"

// arbitrary precision integer
#include <boost/multiprecision/cpp_int.hpp>

using std::set;
using std::endl;
Expand Down Expand Up @@ -253,7 +255,7 @@ YQPkgDiskUsageList::keyPressEvent( QKeyEvent * event )

if ( percent != item->usedPercent() )
{
partitionDu.pkg_size = partitionDu.total_size * percent / 100;
partitionDu.pkg_size = partitionDu.total_size / 100 * percent;

runningOutWarning.clear();
overflowWarning.clear();
Expand Down Expand Up @@ -287,14 +289,16 @@ YQPkgDiskUsageListItem::YQPkgDiskUsageListItem( YQPkgDiskUsageList * parent,
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 );
}


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 );
}


Expand All @@ -318,7 +322,11 @@ void
YQPkgDiskUsageListItem::checkRemainingDiskSpace()
{
int percent = usedPercent();
int free = freeSize() / FSize::MB;
// free size in MiB
boost::multiprecision::cpp_int free = freeSize().in_unit(FSize::Unit::M);

yuiDebug() << "Partition " << _partitionDu.dir << " free percent: " <<
percent << "%, " << " free: " << freeSize() << " (" << free << "MiB)" << endl;

if ( percent > MIN_PERCENT_WARN )
{
Expand Down
2 changes: 1 addition & 1 deletion src/YQPkgPatchFilterView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ YQPkgPatchFilterView::updateTotalDownloadSize()
++it )
{
if ( (*it)->candidateObj() )
totalSize += (*it)->candidateObj()->installSize();
totalSize += zypp::ByteCount::SizeType((*it)->candidateObj()->installSize());
}

#if ENABLE_TOTAL_DOWNLOAD_SIZE
Expand Down

0 comments on commit d3b8d6e

Please sign in to comment.