Skip to content
Merged
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
9 changes: 5 additions & 4 deletions 3rdparty/deepin-pdfium/src/dpdfdoc.cpp
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down
Loading