Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c402b21
chore: Rollback dbus security hardening code
wangrong1069 Nov 8, 2024
5c15eca
fix: Adapt disk interface with new rules
wangrong1069 Nov 25, 2024
711c391
fix: Adjust vendor and model in Disk Info
wangrong1069 Nov 25, 2024
cf65ca3
fix: fix udisks fail to mount disk for invalid fstab
wangrong1069 Dec 4, 2024
62494be
chore: Remove exfat-fuse dependency
wangrong1069 Dec 25, 2024
db3d1ce
fix: Fix fail to format disk to FAT32
wangrong1069 Jan 10, 2025
8f1185f
fix: block model shows 'UnKnow'
itsXuSt Jul 4, 2025
93a5108
fix: Improve ext* filesystem usage display logic
itsXuSt Jul 9, 2025
cf06ef3
fix: [Stroage-interface] The interface show error.
GongHeng2017 Jul 15, 2025
68d75af
feat: Enhance time tracking in DiskBadSectorsDialog
itsXuSt Jul 21, 2025
1b299ea
fix: Disable bad sector detection for SSD devices
itsXuSt Aug 7, 2025
39c0532
feat: hide specific version of UFS
itsXuSt Oct 10, 2025
d5ec332
feat: normalize disk size
itsXuSt Oct 21, 2025
46cc882
fix: Remove hardcoded colors in disk health detection dialog for them…
itsXuSt Nov 24, 2025
0a2c5e4
fix: Harden DBus security configuration
itsXuSt Jan 14, 2026
7abdcf5
fix: add path traversal check in mkTempDir function
dengzhongyuan365-dev Feb 2, 2026
b84073d
Revert "fix: Fix fail to format disk to FAT32"
pppanghu77 Mar 13, 2026
122cbf2
fix(mainwindow): conditionally raise and activate window only when di…
pppanghu77 Apr 13, 2026
91b48dd
refactor(partition): simplify redundant condition in chart drawing
GongHeng2017 Jun 1, 2026
40809df
fix(auth): add polkit support
wangrong1069 Jun 3, 2026
0f61af8
fix(service): improve service lifecycle management with D-Bus based d…
wangrong1069 Jun 16, 2026
76d67f8
fix(security): replace shell exec with direct subprocess invocation
wangrong1069 Jul 2, 2026
1347505
fix(partition): add tolerance to add button enable condition
GongHeng2017 Jul 3, 2026
e4a72be
fix(storage): read UFS spec versions from DConfig instead of hardcoding
tianming-1996 Aug 6, 2026
5ffa575
fix(build): make DConfig optional for 102X-107X compatibility
tianming-1996 Aug 12, 2026
9ef7c46
fix(build): make DConfig optional for 102X-107X compatibility
tianming-1996 Aug 12, 2026
254ca07
fix(build): make DConfig compatible with legacy DTK
tianming-1996 Aug 12, 2026
afa4e42
chore: Sync by https://github.com/linuxdeepin/.github/commit/a300f852…
Aug 19, 2026
3bd0d5e
fix(ui): show available space instead of total capacity in size info …
GongHeng2017 Sep 9, 2026
527cd5c
chore: update copyright year to 2022 - 2026 in sizeinfowidget.cpp
GongHeng2017 Sep 9, 2026
da774d0
fix(ui): normalize invalid available size to dash in size info widget
GongHeng2017 Sep 9, 2026
f1e2982
fix: fix translation generation and qm install path in CMakeLists
GongHeng2017 Sep 14, 2026
5acf8ce
fix: secure temp dir creation and add license file
tianming-1996 Sep 28, 2026
9b91ea0
fix: eliminate redundant commands in disk info query
tianming-1996 Oct 22, 2026
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
53 changes: 53 additions & 0 deletions .github/workflows/call-update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Call update changelog

on:
workflow_dispatch:
inputs:
version:
description: "Target version; leave empty to auto bump"
required: false
type: string
name:
description: "Maintainer name used in debian/changelog"
required: true
type: string
email:
description: "Maintainer email used in debian/changelog"
required: true
type: string
base_branch:
description: "Base branch to read and target"
required: false
default: master
type: string
distribution:
description: "Changelog distribution"
required: false
default: unstable
type: string
create_pr:
description: "Create a pull request after generating changelog"
required: false
default: true
type: boolean

jobs:
update_changelog:
uses: linuxdeepin/.github/.github/workflows/update-changelog.yml@master
with:
version: ${{ inputs.version }}
name: ${{ inputs.name }}
email: ${{ inputs.email }}
base_branch: ${{ inputs.base_branch }}
distribution: ${{ inputs.distribution }}
create_pr: ${{ inputs.create_pr }}
secrets: inherit

show_result:
runs-on: ubuntu-latest
needs: update_changelog
steps:
- name: Show update changelog result
run: |
echo "Version: ${{ needs.update_changelog.outputs.version }}"
echo "Pull Request URL: ${{ needs.update_changelog.outputs.pr_url }}"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*.user
.build
build
.qmake.stash
*.qm
.cache/*
.claude/*
.cursor/*
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Copyright: Curtis Gedak
License: GPL-2.0-or-later

#config
Files: service/assets/data/* application/assets/deepin-diskmanager.desktop application/assets/environments.h.in service/policy/com.deepin.diskmanager.policy service/udev/99-diskmanager.rules
Files: service/assets/data/* service/assets/dconfig/* application/assets/deepin-diskmanager.desktop application/assets/environments.h.in service/policy/com.deepin.diskmanager.policy service/udev/99-diskmanager.rules
Copyright: UnionTech Software Technology Co., Ltd.
License: CC0-1.0

Expand Down
232 changes: 232 additions & 0 deletions LICENSES/GPL-3.0-or-later.txt

Large diffs are not rendered by default.

36 changes: 15 additions & 21 deletions application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,15 @@ configure_file(${APP_RES_DIR}/environments.h.in environments.h @ONLY)
#set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1 "${CMAKE_CURRENT_SOURCE_DIR}/translations")
#set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/translations PROPERTY CLEAN_NO_CUSTOM 1)
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1 )
#lupdate start
set(TS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/translations")
set(TS_FILES
"${TS_DIR}/${PROJECT_NAME}_en_US.ts"
)
find_program(LUPDATE_EXECUTABLE lupdate)
foreach(_ts_file ${TS_FILES})
execute_process(
COMMAND ${LUPDATE_EXECUTABLE} -recursive ${CMAKE_SOURCE_DIR} -ts ${_ts_file})
endforeach()
#lupdate end

file (GLOB DTNG_TS_FILES translations/*.ts)
qt5_create_translation(DTNG_QM_FILES
${DTNG_TS_FILES}
${DTNG_QM_FILES}
)

# 国际化
if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")

#generate qm
execute_process(COMMAND bash "translate_generation.sh"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

file(GLOB ALL_SOURCES "*.cpp" "./partedproxy/*.cpp" "./widgets/*.cpp" "./widgets/customcontrol/*.cpp" "./widgets/accessible/*.cpp")
file(GLOB ALL_HEADERS "*.h" "./partedproxy/*.h" "./widgets/*.h" "./widgets/customcontrol/*.h" "./widgets/accessible/*.h")
Expand All @@ -73,7 +65,7 @@ include_directories(../basestruct)
set(ALL_SRCS ${ALL_SOURCES} ${ALL_HEADERS})

# 生成执行文件
add_executable(${PROJECT_NAME} ${ALL_SRCS} ${APP_QRC} ${DTNG_QM_FILES})
add_executable(${PROJECT_NAME} ${ALL_SRCS} ${APP_QRC})

target_include_directories(${PROJECT_NAME} PUBLIC
${DtkWidget_INCLUDE_DIRS}
Expand All @@ -87,9 +79,11 @@ set(CMAKE_INSTALL_PREFIX /usr)

# Install files
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
#file(GLOB APP_QM_FILES "translations/*.qm")
#install(FILES ${APP_QM_FILES} DESTINATION share/${PROJECT_NAME}/translations)
install(FILES ${DTNG_QM_FILES} DESTINATION share/${PROJECT_NAME}/translations)

# install qm files
file(GLOB APP_QM_FILES "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.qm")
install(FILES ${APP_QM_FILES} DESTINATION share/${PROJECT_NAME}/translations)

install(FILES ${APP_ICONPATH} DESTINATION share/icons/hicolor/scalable/apps)
install(FILES ${APP_DESKTOP} DESTINATION share/applications)
install(DIRECTORY ${APP_RES_DIR}/deepin-diskmanager DESTINATION /usr/share/deepin-manual/manual-assets/application)
Expand Down
12 changes: 12 additions & 0 deletions application/lupdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0-or-later

lupdate ./ -ts -no-obsolete translations/deepin-diskmanager.ts
lupdate ./ -ts -no-obsolete translations/deepin-diskmanager_zh_CN.ts
lupdate ./ -ts -no-obsolete translations/deepin-diskmanager_zh_HK.ts
lupdate ./ -ts -no-obsolete translations/deepin-diskmanager_zh_TW.ts
lupdate ./ -ts -no-obsolete translations/deepin-diskmanager_bo.ts
lupdate ./ -ts -no-obsolete translations/deepin-diskmanager_ug.ts
59 changes: 19 additions & 40 deletions application/main.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 Down Expand Up @@ -54,27 +54,6 @@ QAccessibleInterface *accessibleFactory(const QString &classname, QObject *objec
return interface;
}

/**
* @brief 执行外部命令
* @param strCmd:外部命令字符串
* @param outPut:命令控制台输出
* @param error:错误信息
* @return exitcode:退出码
*/
int executCmd(const QString &strCmd, QString &outPut, QString &error)
{
QProcess proc;
proc.start(strCmd);
proc.waitForFinished(-1);
outPut = proc.readAllStandardOutput();
error = proc.readAllStandardError();
error = proc.errorString();
int exitcode = proc.exitCode();
proc.close();
return exitcode;

}

int main(int argc, char *argv[])
{
// signal(SIGINT, SIG_IGN);
Expand Down Expand Up @@ -119,31 +98,31 @@ int main(int argc, char *argv[])
// exit(0);
// }
if (a.setSingleInstance(appName)) {
QProcess proc;
QString cmd, oldPid, newPid, error;
//先判断后台服务进程是否存在,如果存在可能是强制退出导致,应先退出后台程序再重新启动磁盘管理器
cmd = QString("pidof deepin-diskmanager-service");
// 使用 QDBusInterface 调用 org.freedesktop.DBus.GetNameOwner 获取服务 owner
QDBusInterface dbusInterface("org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
QDBusConnection::systemBus());
const QString serviceName = "com.deepin.diskmanager";

if (!executCmd(cmd, oldPid, error)) {
proc.startDetached("/usr/bin/dbus-send --system --type=method_call --dest=com.deepin.diskmanager /com/deepin/diskmanager com.deepin.diskmanager.Quit");
}
// 启动服务前,获取后台服务的旧 dbus owner
QDBusReply<QString> oldReply = dbusInterface.call("GetNameOwner", serviceName);
const QString oldDbusOwner = oldReply.isValid() ? oldReply.value() : QString();

QStringList argList;
argList << QString::number(QCoreApplication::applicationPid()) << QDBusConnection::systemBus().baseService();
proc.startDetached("/usr/bin/deepin-diskmanager-authenticateProxy", argList);
QProcess::startDetached("deepin-diskmanager-authenticateProxy", { QDBusConnection::systemBus().baseService() });

//正常启动程序后,循环查询后台服务是否已经启动,如果后台服务启动说明鉴权成功,启动前端界面
// 启动服务后,循环查询后台服务是否已经启动
// 当获取新 dbus owner 成功且不等于旧 dbus owner, 则认为新服务启动完成
while (1) {
cmd = QString("pidof deepin-diskmanager-service");

if (!executCmd(cmd, newPid, error) && oldPid != newPid) {
break;
QDBusReply<QString> newReply = dbusInterface.call("GetNameOwner", serviceName);
if (newReply.isValid()) {
const QString newDbusOwner = newReply.value();
if (!newDbusOwner.isEmpty() && newDbusOwner != oldDbusOwner) {
break;
}
}
QThread::msleep(300);
}

proc.close();

} else {
exit(0);
}
Expand Down
23 changes: 23 additions & 0 deletions application/translate_generation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0-or-later

ts_list=(`ls translations/*.ts`)

# 优先使用Qt6 lrelease工具
if [ -f "/usr/lib/qt6/bin/lrelease" ]; then
lrelease="/usr/lib/qt6/bin/lrelease"
elif [ -f "/usr/lib/qt5/bin/lrelease" ]; then
lrelease="/usr/lib/qt5/bin/lrelease"
else
lrelease="lrelease"
fi

# 遍历所有ts文件并生成qm文件
for ts in "${ts_list[@]}"
do
printf "\nprocess ${ts}\n"
${lrelease} "${ts}"
done
Loading
Loading