Commit 668e3f0d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Follow BinaryUnitDialect option

BUG: 454182
parent 28fa493f
Pipeline #179867 passed with stage
in 10 minutes and 37 seconds
......@@ -435,6 +435,7 @@ target_link_libraries(KF5AkonadiCore
PUBLIC
KF5::CoreAddons # for KJob
KF5::ItemModels
KF5::KIOCore
Qt${QT_MAJOR_VERSION}::Gui # for QColor
PRIVATE
Qt${QT_MAJOR_VERSION}::Network
......
......@@ -14,7 +14,7 @@
#include "entitydisplayattribute.h"
#include "entitytreemodel.h"
#include <KFormat>
#include <KIO/Global>
#include <KIconLoader>
#include <KLocalizedString>
......@@ -100,15 +100,14 @@ public:
}
}
KFormat formatter;
qint64 currentFolderSize(collection.statistics().size());
tipInfo += QStringLiteral(" <strong>%1</strong>: %2<br>\n").arg(i18n("Storage Size"), formatter.formatByteSize(currentFolderSize));
tipInfo += QStringLiteral(" <strong>%1</strong>: %2<br>\n").arg(i18n("Storage Size"), KIO::convertSize(currentFolderSize));
qint64 totalSize = 0;
getCountRecursive(index, totalSize);
totalSize -= currentFolderSize;
if (totalSize > 0) {
tipInfo += QStringLiteral("<strong>%1</strong>: %2<br>").arg(i18n("Subfolder Storage Size"), formatter.formatByteSize(totalSize));
tipInfo += QStringLiteral("<strong>%1</strong>: %2<br>").arg(i18n("Subfolder Storage Size"), KIO::convertSize(totalSize));
}
QString iconName = CollectionUtils::defaultIconName(collection);
......@@ -246,8 +245,7 @@ QVariant StatisticsProxyModel::extraColumnData(const QModelIndex &parent, int ro
if (collection.isValid() && collection.statistics().count() >= 0) {
const CollectionStatistics stats = collection.statistics();
if (extraColumn == 2) {
KFormat formatter;
return formatter.formatByteSize(stats.size());
return KIO::convertSize(stats.size());
} else if (extraColumn == 1) {
return stats.count();
} else if (extraColumn == 0) {
......
......@@ -13,7 +13,7 @@
#include <KLocalizedString>
#include <KFormat>
#include <KIO/Global>
using namespace Akonadi;
......@@ -52,7 +52,7 @@ void CollectionGeneralPropertiesPage::load(const Collection &collection)
if (collection.statistics().count() >= 0) {
ui.countLabel->setText(i18ncp("@label", "One object", "%1 objects", collection.statistics().count()));
ui.sizeLabel->setText(KFormat().formatByteSize(collection.statistics().size()));
ui.sizeLabel->setText(KIO::convertSize(collection.statistics().size()));
} else {
ui.statsBox->hide();
}
......
......@@ -18,7 +18,8 @@
#include <QDBusPendingCallWatcher>
#include <QDBusPendingReply>
#include <KFormat>
#include <KIO/Global>
#include <KLocalizedString>
#include <QCheckBox>
#include <QPushButton>
......@@ -53,7 +54,7 @@ public:
{
ui.itemsCountLbl->setText(QString::number(qMax(0LL, nbMail)));
ui.unreadItemsCountLbl->setText(QString::number(qMax(0LL, nbUnreadMail)));
ui.folderSizeLbl->setText(KFormat().formatByteSize(qMax(0LL, size)));
ui.folderSizeLbl->setText(KIO::convertSize(qMax(0LL, size)));
}
Akonadi::Collection currentCollection;
......
......@@ -9,7 +9,7 @@
#include "akonadiwidgets_debug.h"
#include <KColorScheme>
#include <KFormat>
#include <KIO/Global>
#include <QAbstractItemView>
#include <QPainter>
......@@ -315,7 +315,7 @@ void CollectionStatisticsDelegate::paint(QPainter *painter, const QStyleOptionVi
// total size
if (index.column() == 3 && !expanded) {
painter->drawText(textRect, option4.displayAlignment | Qt::AlignVCenter, KFormat().formatByteSize(totalSize));
painter->drawText(textRect, option4.displayAlignment | Qt::AlignVCenter, KIO::convertSize(totalSize));
return;
}
......
  • [22:32] <frinring> einar77: 668e3f0d added kiocore to the link interface, but forgot to adapt the cmake config file

    [22:33] <frinring> just pointing out, no time to do something about it

    This breaks downstream applications (example from eventviews):

    [   77s]   The link interface of target "KF5::AkonadiCore" contains:
    [   77s] 
    [   77s]     KF5::KIOCore
    [   77s] 
    [   77s]   but the target was not found.  Possible reasons include:
    [   77s] 
    [   77s]     * There is a typo in the target name.
    [   77s]     * A find_package call is missing for an IMPORTED target.
    [   77s]     * An ALIAS target is missing.
    [   77s] 
    [   77s] Call Stack (most recent call first):
    [   77s]   /usr/lib/cmake/KF5Akonadi/KF5AkonadiConfig.cmake:67 (include)
    [   77s]   CMakeLists.txt:45 (find_package)
    [   77s] 
    Edited by Luca Beltrame
  • Given the new usages are all in cpp files IISC, actually the fix would be to move the KIOCore lib to the private link interface. Doing now.

  • mentioned in commit e40fb900

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment