Skip to content

LayerSound: Compare canonical paths (#2009)#2010

Merged
chchwy merged 1 commit into
pencil2d:masterfrom
MrStevns:bug/sound-layer-save-keyframe-same-path
May 4, 2026
Merged

LayerSound: Compare canonical paths (#2009)#2010
chchwy merged 1 commit into
pencil2d:masterfrom
MrStevns:bug/sound-layer-save-keyframe-same-path

Conversation

@MrStevns

@MrStevns MrStevns commented Apr 25, 2026

Copy link
Copy Markdown
Member

Because if the root of the paths differentiate, even though the paths are technically pointing to the correct file, then this will fail and delete the only sound file there is and then fail to copy which will lead to project corruption.

Related to #2009

@MrStevns MrStevns changed the title LayerSound: Compare actual paths LayerSound: Compare canonical paths Apr 25, 2026
@chchwy chchwy requested review from chchwy and Copilot April 28, 2026 12:32
@chchwy chchwy self-assigned this Apr 28, 2026
@chchwy chchwy added this to the 0.8.0 milestone Apr 28, 2026
@chchwy chchwy changed the title LayerSound: Compare canonical paths LayerSound: Compare canonical paths (#2009) Apr 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates LayerSound::saveKeyFrameFile() to compare canonical file paths (instead of raw strings) when deciding whether to remove/re-copy a sound file during project saves, addressing macOS path-root differences (e.g., /var vs /private/var) that can lead to save/zip corruption.

Changes:

  • Compare QFileInfo::canonicalFilePath() for source vs destination paths to avoid treating equivalent paths as different.
  • Introduce a QFileInfo for the destination path to support canonical comparison.
  • Add an explanatory inline comment about the PCLX temp→project folder behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core_lib/src/structure/layersound.cpp
Comment thread core_lib/src/structure/layersound.cpp
@chchwy chchwy modified the milestones: 0.8.0, 0.7.3 Apr 29, 2026
@chchwy chchwy force-pushed the bug/sound-layer-save-keyframe-same-path branch from da50072 to b4aa96b Compare April 29, 2026 06:04
Because if the root of the paths differentiate, even though the paths are technically the same, then this will fail and delete the only sound file there is and then fail to copy which will lead to project corruption.
@chchwy chchwy force-pushed the bug/sound-layer-save-keyframe-same-path branch from b4aa96b to bf1d1bc Compare May 1, 2026 04:10
@sonarqubecloud

sonarqubecloud Bot commented May 1, 2026

Copy link
Copy Markdown

@github-project-automation github-project-automation Bot moved this from Needs Review to Approved in Pull Request Priority May 4, 2026
@chchwy chchwy merged commit dc41b89 into pencil2d:master May 4, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Merged in Pull Request Priority May 4, 2026
chchwy pushed a commit to chchwy/pencil2d that referenced this pull request May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants