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
23 changes: 12 additions & 11 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Source: deepin-boot-maker
Section: misc
Priority: standard
Maintainer: Deepin Packages Builder <packages@deepin.com>
Maintainer: Deepin Packages Builder <packages@deepin.com>
Uploaders: Ma Aiguo <imaiguo@gmail.com>,
Build-Depends: debhelper-compat (=11),
python3,
qt6-base-dev,
qt6-base-dev-tools,
qt6-base-private-dev,
qt6-l10n-tools,
qt6-tools-dev-tools,
qt6-tools-dev,
qt6-svg-dev,
qt6-base-dev | qtbase5-dev,
qt6-base-dev-tools | qtbase5-dev-tools,
qt6-base-private-dev | qtbase5-private-dev,
qt6-l10n-tools | qttools5-dev-tools,
qt6-tools-dev-tools | qttools5-dev-tools,
qt6-tools-dev | qttools5-dev,
qt6-svg-dev | libqt5svg5-dev,
pkg-config,
libxcb-util0-dev,
libmtdev-dev,
Expand All @@ -20,9 +20,9 @@ Build-Depends: debhelper-compat (=11),
libfontconfig-dev,
libegl1-mesa-dev,
libstartup-notification0-dev,
libdtk6widget-dev,
libdtk6widget-dev | libdtkwidget-dev,
libgtest-dev,
libpolkit-qt6-1-dev
libpolkit-qt6-1-dev | libpolkit-qt5-1-dev
Standards-Version: 4.5.1
Homepage: https://github.com/linuxdeepin/deepin-boot-maker
Vcs-Git: https://salsa.debian.org/pkg-deepin-team/deepin-boot-maker.git
Expand All @@ -32,7 +32,8 @@ Package: deepin-boot-maker
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, p7zip-full, mtools, udisks2,
syslinux [linux-amd64 linux-i386],
syslinux-common [linux-amd64 linux-i386],genisoimage,dde-qt6integration
syslinux-common [linux-amd64 linux-i386], genisoimage,
dde-qt6integration | dde-qt5integration
Description: Simple tool for user to create a boot usb stick quickly and easily
It's designed to support deepin system iso, it can works for Debian and ubuntu
iso too.
12 changes: 8 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/usr/bin/make -f

# 设置 Qt6 环境
export QT_SELECT=qt6
# 使用系统 PATH 中的 qmake6
export QMAKE=qmake6
# 自动检测 Qt 版本,优先使用 Qt6
ifneq (,$(shell which qmake6 2>/dev/null))
export QT_SELECT=qt6
export QMAKE=qmake6
else
export QT_SELECT=qt5
export QMAKE=qmake
endif

include /usr/share/dpkg/default.mk

Expand Down
5 changes: 5 additions & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
#include <QDebug>
#include <DLog>
#include <DApplication>
#include <DWidgetUtil>

Check warning on line 15 in src/app/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 16 in src/app/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <DApplicationSettings>
#endif


DCORE_USE_NAMESPACE
DWIDGET_USE_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions src/app/view/dropframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void DropFrame::paintEvent(QPaintEvent *e)
QPixmap pixmap;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Qt5: 使用 DGuiApplicationHelper
using namespace Dtk::Gui;
DGuiApplicationHelper::ColorType themeType = DGuiApplicationHelper::instance()->themeType();
if (themeType == DGuiApplicationHelper::LightType) {
pixmap = QPixmap(":/theme/light/image/dash.svg").scaled(this->size());
Expand Down
33 changes: 31 additions & 2 deletions src/libdbm/installer/qtbaseinstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,37 @@ bool QtBaseInstaller::formatUsb()
}

if (m_bFormat) {
if (!XSys::DiskUtil::FormatPartion(m_strPartionName)) {
qCritical() << "Failed to format partition";
QString targetDev = m_strPartionName;

// 检查是否是 disk 节点(没有分区号)
// disk 节点如:/dev/sdb
// partition 节点如:/dev/sdb1
bool isDisk = true;
for (int i = targetDev.length() - 1; i >= 0; i--) {
if (targetDev[i].isDigit()) {
isDisk = false;
break;
}
if (targetDev[i] == '/') {
break;
}
}

// 如果是 disk 节点,需要先创建分区
if (isDisk) {
qDebug() << "Detected disk device" << targetDev << "without partition, creating partition...";
if (!XSys::DiskUtil::CreatePartition(targetDev)) {
qCritical() << "Failed to create partition for" << targetDev;
return false;
}
// 使用新创建的分区
targetDev = targetDev + "1";
m_strPartionName = targetDev;
qDebug() << "Partition created successfully, using" << targetDev;
}

// 格式化分区
if (!XSys::DiskUtil::FormatPartion(targetDev)) {
return false;
}
qInfo() << "Partition formatted successfully";
Expand Down
6 changes: 3 additions & 3 deletions src/libdbm/util/deviceinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class DeviceInfo
{
public:
DeviceInfo() {}
DeviceInfo(const QString &path, quint32 used, quint32 total, const QString &label)
DeviceInfo(const QString &path, quint64 used, quint64 total, const QString &label)
: path(path), used(used), total(total), label(label)
{
}

QString path = "";
quint32 used = 0;
quint32 total = 0;
quint64 used = 0;
quint64 total = 0;
QString label = QObject::tr("Removable Disk");
QString uuid = "";
QString fstype = "";
Expand Down
Loading