diff --git a/3rdparty/deepin-pdfium/src/dpdfdoc.cpp b/3rdparty/deepin-pdfium/src/dpdfdoc.cpp index 2e593bba..c83e67b1 100755 --- a/3rdparty/deepin-pdfium/src/dpdfdoc.cpp +++ b/3rdparty/deepin-pdfium/src/dpdfdoc.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -245,7 +245,7 @@ bool DPdfDoc::save() QTemporaryDir tempDir; - QString tempFilePath = tempDir.path() + "/" + QUuid::createUuid().toString(); + QString tempFilePath = tempDir.path() + "/" + QUuid::createUuid().toString(QUuid::WithoutBraces); saveWriter.setFileName(tempFilePath); @@ -269,9 +269,10 @@ bool DPdfDoc::save() QString targetPath = d_func()->m_filePath; - // Extract directory and filename to create hidden backup file + // Use a UUID-only hidden file as backup to avoid long filename + // issues with NAME_MAX (255 bytes) on the backup path. QFileInfo fileInfo(targetPath); - QString backupPath = fileInfo.absolutePath() + "/." + fileInfo.fileName() + ".backup." + QUuid::createUuid().toString(); + QString backupPath = fileInfo.absolutePath() + "/." + QUuid::createUuid().toString(QUuid::WithoutBraces); QFile targetFile(targetPath);