Skip to content

Commit 2778dd4

Browse files
mhduiydeepin-bot[bot]
authored andcommitted
fix: use default license loading method
Changed the loadLicense() method to always use loadDefault() instead of conditionally loading from content or path variables. This simplifies the license loading logic and ensures consistent behavior regardless of whether content or path was previously set. The previous implementation had conditional logic that would load license from either content string or file path. This has been replaced with a direct call to loadDefault() which presumably loads a built- in or default license file. This change makes the license loading more predictable and removes potential error conditions related to missing content or invalid paths. fix: 使用默认许可证加载方法 将 loadLicense() 方法改为始终使用 loadDefault(),而不是根据条件从内容或 路径变量加载。这简化了许可证加载逻辑,并确保无论之前是否设置了内容或路 径,都能保持行为一致。 之前的实现有条件逻辑,会从内容字符串或文件路径加载许可证。现在已替换为直 接调用 loadDefault(),该方法可能加载内置或默认的许可证文件。此更改使许可 证加载更加可预测,并消除了与缺失内容或无效路径相关的潜在错误条件。 PMS: TASK-387863
1 parent 501b477 commit 2778dd4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/widgets/dlicensedialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: LGPL-3.0-or-later
44

@@ -173,7 +173,7 @@ bool DLicenseDialogPrivate::loadLicense()
173173
{
174174
if (!content.isEmpty()) {
175175
isValid = licenseInfo.loadContent(content);
176-
} else if (!path.isEmpty()) {
176+
} else {
177177
isValid = licenseInfo.loadFile(path);
178178
}
179179
if (isValid) {

0 commit comments

Comments
 (0)