Skip to content
Merged
Show file tree
Hide file tree
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: 5 additions & 1 deletion application/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@


#include "common.h"
#include <QDebug>

Check warning on line 7 in application/common.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.

QIcon Common::getIcon(const QString &iconName)
{
return QIcon::fromTheme("dm_" + iconName);
}

int Common::getLabelAdjustHeight(const int &width, const QString &text, const QFont &font)

Check warning on line 14 in application/common.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'getLabelAdjustHeight' is never used.
{
qDebug() << "Calculating label height for text:" << text.left(20) << "...";
DLabel label;
label.setFont(font);
label.setWordWrap(true);
label.setFixedWidth(width);
label.setText(text);
label.adjustSize();

return label.height();
int height = label.height();
qDebug() << "Calculated label height:" << height;
return height;
}
4 changes: 4 additions & 0 deletions application/cusapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@


#include "cusapplication.h"
#include <QDebug>

Check warning on line 7 in application/cusapplication.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.

CusApplication::CusApplication(int &argc, char **argv)
: DApplication(argc, argv)
{
qDebug() << "CusApplication initialized with argc:" << argc;
}

void CusApplication::handleQuitAction()
{
qDebug() << "Handling quit action";
emit handleQuitActionChanged();
DApplication::handleQuitAction();
qDebug() << "Quit action handled";
}
6 changes: 6 additions & 0 deletions application/widgets/animationdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

#include <DWindowCloseButton>

#include <QVBoxLayout>

Check warning on line 10 in application/widgets/animationdialog.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 11 in application/widgets/animationdialog.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 12 in application/widgets/animationdialog.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.

AnimationDialog::AnimationDialog(QWidget *parent) : DDialog(parent)
{
qDebug() << "AnimationDialog initializing...";
initUi();
qDebug() << "AnimationDialog initialized";
}

void AnimationDialog::initUi()
Expand Down Expand Up @@ -43,6 +46,8 @@

void AnimationDialog::setShowSpinner(bool isShow, const QString &title)
{
qDebug() << "Setting spinner visibility:" << isShow << "with title:" << title;

if (isShow) {
m_label->setText(title);
m_spinner->show();
Expand All @@ -54,6 +59,7 @@
void AnimationDialog::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key::Key_Escape) {
qDebug() << "Escape key pressed, ignoring event";
event->ignore();
} else {
DDialog::keyPressEvent(event);
Expand Down
5 changes: 5 additions & 0 deletions application/widgets/centerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
CenterWidget::CenterWidget(DWidget *parent)
: Dtk::Widget::DWidget(parent)
{
qDebug() << "CenterWidget initializing...";
initUi();
}

CenterWidget::~CenterWidget()
{
qDebug() << "CenterWidget destroyed";
}

void CenterWidget::HandleQuit()
{
qDebug() << "Handling CenterWidget quit";
}

TitleWidget *CenterWidget::getTitleWidget()
Expand All @@ -35,6 +38,8 @@ TitleWidget *CenterWidget::getTitleWidget()

void CenterWidget::initUi()
{
qDebug() << "Initializing CenterWidget UI";

m_titleWidget = new TitleWidget(this);
QVBoxLayout *mainlayout = new QVBoxLayout;
mainlayout->setContentsMargins(0, 0, 0, 0);
Expand Down
13 changes: 12 additions & 1 deletion application/widgets/createlvwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

CreateLVWidget::CreateLVWidget(QWidget *parent) : DDialog(parent)
{
qDebug() << "CreateLVWidget initializing...";
initUi();
recPartitionInfo();
initConnection();
qDebug() << "CreateLVWidget initialized for VG:" << DMDbusHandler::instance()->getCurVGInfo().m_vgName;
}

void CreateLVWidget::initUi()
Expand Down Expand Up @@ -402,7 +404,7 @@ void CreateLVWidget::partInfoShowing()

void CreateLVWidget::recPartitionInfo()
{
//获取数据
qDebug() << "Loading partition info for current VG";
m_lstLVName.clear();
if (DMDbusHandler::VOLUMEGROUP == DMDbusHandler::instance()->getCurLevel()) {
VGInfo vgInfo = DMDbusHandler::instance()->getCurVGInfo();
Expand Down Expand Up @@ -920,6 +922,8 @@ void CreateLVWidget::onAddPartition()

void CreateLVWidget::onRemovePartition()
{
qDebug() << "Removing last LV from creation list";

if (m_patrinfo.size() > 0)
m_patrinfo.pop_back();

Expand All @@ -942,6 +946,8 @@ void CreateLVWidget::onRemovePartition()

void CreateLVWidget::onApplyButton()
{
qDebug() << "Applying LV creation for VG:" << DMDbusHandler::instance()->getCurVGInfo().m_vgName;

QList<LVAction> lstLVInfo;
VGInfo vgInfo = DMDbusHandler::instance()->getCurVGInfo();
QString userName = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
Expand Down Expand Up @@ -980,13 +986,16 @@ void CreateLVWidget::onApplyButton()
}

if (lstLVInfo.size() > 0) {
qDebug() << "Creating" << lstLVInfo.size() << "logical volumes on VG:" << vgInfo.m_vgName;
DMDbusHandler::instance()->createLV(vgInfo.m_vgName, lstLVInfo);
close();
}
}

void CreateLVWidget::onRevertButton()
{
qDebug() << "Reverting all LV creation changes";

//复原,即清空
m_patrinfo.clear();
m_sizeInfo.clear();
Expand Down Expand Up @@ -1019,6 +1028,8 @@ void CreateLVWidget::onRevertButton()

void CreateLVWidget::onCancelButton()
{
qDebug() << "Canceling LV creation dialog";

close();
}

Expand Down
4 changes: 4 additions & 0 deletions application/widgets/createpartitiontabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
CreatePartitionTableDialog::CreatePartitionTableDialog(QWidget *parent)
: DDBase(parent)
{
qDebug() << "CreatePartitionTableDialog initializing...";
initUi();
initConnection();
qDebug() << "CreatePartitionTableDialog initialized";
}

void CreatePartitionTableDialog::initUi()
Expand All @@ -35,6 +37,7 @@ void CreatePartitionTableDialog::initUi()
getButton(index)->setAccessibleName("cancel");

DeviceInfo info = DMDbusHandler::instance()->getCurDeviceInfo();
qDebug() << "Current device info - path:" << info.m_path << "type:" << info.m_disktype;
if (info.m_disktype == "unrecognized") {
m_curType = "create";
// 当前磁盘无分区表,是否新建分区表?
Expand All @@ -60,6 +63,7 @@ void CreatePartitionTableDialog::onButtonClicked(int index, const QString &text)
{
Q_UNUSED(text);
if (index == m_okCode) {
qDebug() << "User confirmed partition table operation, type:" << m_curType;
DeviceInfo info = DMDbusHandler::instance()->getCurDeviceInfo();
DMDbusHandler::instance()->createPartitionTable(info.m_path, QString("%1").arg(info.m_length), QString("%1").arg(info.m_sectorSize), m_ComboBox->currentText(), m_curType);
close();
Expand Down
18 changes: 17 additions & 1 deletion application/widgets/createvgwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ CreateVGWidget::CreateVGWidget(int operationType, QWidget *parent)
: DDBase(parent)
, m_curOperationType(operationType)
{
qDebug() << "CreateVGWidget initialized with operationType:" << operationType;
initUi();
initConnection();
updateData();
qDebug() << "CreateVGWidget initialization completed";
}

void CreateVGWidget::initUi()
Expand Down Expand Up @@ -752,19 +754,26 @@ set<PVData> CreateVGWidget::getCurSelectPVData()

void CreateVGWidget::onNextButtonClicked()
{
qDebug() << "Next button clicked, switching to step 2";
m_stackedWidget->setCurrentIndex(1);
updateSelectedData();
qDebug() << "Step 2 UI updated with selected data";
}

void CreateVGWidget::onPreviousButtonClicked()
{
qDebug() << "Previous button clicked, switching back to step 1";
m_stackedWidget->setCurrentIndex(0);
updateData();
qDebug() << "Step 1 UI refreshed";
}

void CreateVGWidget::onDoneButtonClicked()
{
qDebug() << "Done button clicked, starting VG operation";

if (m_selectSpaceStackedWidget->currentIndex() == 0) {
qDebug() << "Validating VG size input...";
double curSize = QString::number(m_selectSpaceLineEdit->text().toDouble(), 'f', 2).toDouble();
double minSize = QString::number(m_minSize, 'f', 2).toDouble();
double maxSize = QString::number(m_maxSize, 'f', 2).toDouble();
Expand Down Expand Up @@ -846,6 +855,7 @@ void CreateVGWidget::onDoneButtonClicked()

DMDbusHandler::instance()->resizeVG(vgName, pvDataList, m_curSize);
} else {
qInfo() << "Creating new VG:" << vgName << "with" << pvDataList.size() << "PVs";
DMDbusHandler::instance()->createVG(vgName, pvDataList, m_curSize);
}

Expand Down Expand Up @@ -2056,7 +2066,7 @@ void CreateVGWidget::onTextChanged(const QString &text)

void CreateVGWidget::onVGCreateMessage(const QString &vgMessage)
{
qDebug() << vgMessage;
qDebug() << "Received VG create message:" << vgMessage;
if (m_waterLoadingWidget != nullptr) {
m_waterLoadingWidget->stopTimer();
}
Expand All @@ -2068,6 +2078,7 @@ void CreateVGWidget::onVGCreateMessage(const QString &vgMessage)
}

if (infoList.at(0) == "0") {
qWarning() << "VG operation failed with error code:" << infoList.at(1);
QString text = "";
switch (infoList.at(1).toInt()) {
case LVMError::LVM_ERR_VG_ALREADY_EXISTS: {
Expand All @@ -2094,11 +2105,14 @@ void CreateVGWidget::onVGCreateMessage(const QString &vgMessage)
}
}

qDebug() << "Closing CreateVGWidget";
close();
}

void CreateVGWidget::onUpdateUsb()
{
qDebug() << "USB device status changed, checking for updates...";

QStringList deviceNameList = DMDbusHandler::instance()->getDeviceNameList();
if (m_curDeviceNameList == deviceNameList) {
return;
Expand Down Expand Up @@ -2135,13 +2149,15 @@ void CreateVGWidget::onUpdateUsb()
tr("Refreshing the page to reload disks"));
DMessageManager::instance()->setContentMargens(this, QMargins(0, 0, 0, 20));

qDebug() << "Refreshing disk selection UI due to USB change";
updateData();
} else if (m_stackedWidget->currentIndex() == 1) {
if (!deleteIndexList.isEmpty()) {
DMessageManager::instance()->sendMessage(this, QIcon::fromTheme("://icons/deepin/builtin/ok.svg"),
tr("Refreshing the page to reload disks"));
DMessageManager::instance()->setContentMargens(this, QMargins(0, 0, 0, 20));

qDebug() << "Refreshing selected data UI due to USB change";
updateSelectedData();
}
}
Expand Down
6 changes: 5 additions & 1 deletion application/widgets/customcontrol/buttonlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
// SPDX-License-Identifier: GPL-3.0-only

#include "buttonlabel.h"
#include <QDebug>

Check warning on line 6 in application/widgets/customcontrol/buttonlabel.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.


ButtonLabel::ButtonLabel(QWidget *parent) : QLabel(parent)
{

qDebug() << "ButtonLabel created";
}

void ButtonLabel::mousePressEvent(QMouseEvent *event)

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

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'mousePressEvent' is never used.
{
qDebug() << "ButtonLabel clicked";
Q_UNUSED(event);

emit clicked();
qDebug() << "ButtonLabel click signal emitted";
}
4 changes: 4 additions & 0 deletions application/widgets/customcontrol/ddbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
DDBase::DDBase(QWidget *parent)
: DDialog(parent)
{
qDebug() << "Creating base dialog";
setModal(true);
setIcon(QIcon::fromTheme(appName));

Expand All @@ -18,14 +19,17 @@ DDBase::DDBase(QWidget *parent)
m_mainFrame->setFrameStyle(DFrame::NoFrame);

addContent(m_mainFrame);
qDebug() << "Base dialog initialized with main frame";
// updateGeometry();
}

void DDBase::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key::Key_Escape) {
qDebug() << "Ignoring Escape key press";
event->ignore();
} else {
qDebug() << "Forwarding key press to base class";
DDialog::keyPressEvent(event);
}
}
11 changes: 11 additions & 0 deletions application/widgets/customcontrol/dmdiskinfobox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,52 @@
{
m_childs.clear();
m_id = 0;
qDebug() << "DmDiskinfoBox initialized";
}

DmDiskinfoBox::DmDiskinfoBox(QObject *parent)

Check warning on line 35 in application/widgets/customcontrol/dmdiskinfobox.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Member variable 'DmDiskinfoBox::m_luksFlag' is not initialized in the constructor. Member variables of native types, pointers, or references are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior.

Check warning on line 35 in application/widgets/customcontrol/dmdiskinfobox.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Member variable 'DmDiskinfoBox::m_vgFlag' is not initialized in the constructor. Member variables of native types, pointers, or references are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior.
: QObject(parent)
{
qDebug() << "Creating empty DmDiskinfoBox";
m_id = 0;
m_level = 0;
m_flag = 0;
qDebug() << "Empty DmDiskinfoBox initialized";
}

DmDiskinfoBox::~DmDiskinfoBox()
{
qDebug() << "Destroying DmDiskinfoBox, child count:" << m_childs.count();
for (int i = 0; i < m_childs.length(); i++) {
if (m_childs.at(i) != nullptr) {
qDebug() << "Deleting child item:" << i;
delete m_childs.at(i);
}
}
m_childs.clear();
qDebug() << "DmDiskinfoBox destroyed";
}

int DmDiskinfoBox::addChild(DmDiskinfoBox *child)
{
qDebug() << "Adding child, current level:" << m_level
<< "child id:" << child->m_id;
child->m_level = m_level + 1;
foreach (DmDiskinfoBox *item, m_childs) {
if (item->m_id == child->m_id) {
qDebug() << "Replacing existing child with same id";
m_childs.removeOne(item);
delete item;
}
}
m_childs.append(child);
qDebug() << "Child added, new child count:" << m_childs.count();
return 0;
}

int DmDiskinfoBox::childCount()
{
qDebug() << "Getting child count:" << m_childs.count();
return m_childs.count();
}

Loading