Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions application/widgets/customcontrol/partitionwidget.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-only

Expand All @@ -10,9 +10,11 @@

#include <DScrollArea>

#include <QDebug>

Check warning on line 13 in application/widgets/customcontrol/partitionwidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDebug> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 13 in application/widgets/customcontrol/partitionwidget.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QDebug> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QApplication>

Check warning on line 14 in application/widgets/customcontrol/partitionwidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 14 in application/widgets/customcontrol/partitionwidget.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.

constexpr double kFloatCompareEpsilon = 0.01;

PartitionWidget::PartitionWidget(QWidget *parent)
: DDialog(parent)
{
Expand Down Expand Up @@ -930,7 +932,7 @@
m_block = 1;
m_slider->setValue(static_cast<int>((value / (m_total - (sumValue() / 1024))) * 100));
m_currentEditSize = QString::number(value * 1024, 'f', 4);
if (value == 0.00 || value > (m_total - sumValue() / 1024)) {
if (value == 0.00 || value > (m_total - sumValue() / 1024) + kFloatCompareEpsilon) {
qDebug() << "Value is 0 or exceeds remaining space, disabling addButton";
m_addButton->setEnabled(false);
} else {
Expand Down
Loading