Skip to content

Issue 1970: Implement Project Auto-Save#1999

Open
Assemberist wants to merge 6 commits intopencil2d:masterfrom
Assemberist:master
Open

Issue 1970: Implement Project Auto-Save#1999
Assemberist wants to merge 6 commits intopencil2d:masterfrom
Assemberist:master

Conversation

@Assemberist
Copy link
Copy Markdown

Implementation of autoSave feature.

  1. Never auto-save to the original .pclx/.pcl file - User's file remains untouched
  2. Auto-save only to working directory - Temporary, session-specific location
  3. Explicit user approval required to apply auto-saved changes to original file
  4. Clear indication when recovered project differs from saved file
  5. User control over auto-save interval and enable/disable

Indication wasn't implemented. Below how the new class works

image

Copy link
Copy Markdown
Member

@MrStevns MrStevns left a comment

Choose a reason for hiding this comment

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

Hi Assemberist

Thanks for contributing to the project.

Based on the discussions between you and Chchwy in #1970, the logic seems fine to me, so I am not going to comment much on that.

This review is solely focused on the coding practices.
As of right now, the PR does not conform to our way of coding. This will need to be addressed before it can be approved on that account.

Comment thread app/src/mainwindow2.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.h Outdated
Comment thread core_lib/src/util/autosaverbytime.h Outdated
Comment thread core_lib/src/util/autosaverbytime.h Outdated
@github-project-automation github-project-automation bot moved this from Needs Review to Waiting for Requested Changes in Pull Request Priority Apr 4, 2026
@chchwy chchwy self-requested a review April 6, 2026 11:14
@chchwy chchwy added this to the 0.8.0 milestone Apr 6, 2026
Copy link
Copy Markdown
Member

@MrStevns MrStevns left a comment

Choose a reason for hiding this comment

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

Good job, we're getting there.

The latest changes looks better but you seem to have forgotten some things I mentioned the first time around.

btw. remember to re-request a review when you've made the appropriate changes, so it's clearer to the reviewer (me) that it can be looked at again 🙂

Comment thread core_lib/src/util/autosaverbytime.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.cpp Outdated
Comment thread core_lib/src/util/autosaverbytime.h Outdated
@Assemberist Assemberist requested a review from MrStevns April 6, 2026 18:30
Comment thread core_lib/src/util/autosaverbytime.h Outdated
Comment thread app/src/mainwindow2.h Outdated
@Assemberist Assemberist requested a review from MrStevns April 8, 2026 23:31
Copy link
Copy Markdown
Member

@MrStevns MrStevns left a comment

Choose a reason for hiding this comment

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

Style wise it looks good to me now.
Now we just await what @chchwy says about the functionality 🙂

@github-project-automation github-project-automation bot moved this from Waiting for Requested Changes to Approved in Pull Request Priority Apr 9, 2026
Copilot AI added a commit that referenced this pull request Apr 13, 2026
- Add AutosaverByTime class for timer-based auto-save to working folder
- Add AUTO_SAVE_BY_TIME and AUTO_SAVE_BY_TIME_TIMER settings
- Update preferences UI with time-based auto-save controls
- Update both CMake and qmake build systems (fix: PR missed CMake)
- Fix: pass parent to AutosaverByTime to prevent memory leak
- Fix: use stateChanged signal for Qt <6.7 compatibility
- Fix: keep recoverables.empty() early-return guard

Agent-Logs-Url: https://github.com/pencil2d/pencil/sessions/40216fd4-b315-4426-b20c-9ed8a05ba705

Co-authored-by: chchwy <163800+chchwy@users.noreply.github.com>
@Assemberist
Copy link
Copy Markdown
Author

Hi, it looks like i'm using newer development kit.
My setup:

Qt Creator 18.0.1
Based on Qt 6.10.1 (GCC 15.2.1 20251112, x86_64)

It compiles project with my changes, but show this kind of warnings
pencil/app/src/toolspage.cpp:30: warning: ‘void QCheckBox::stateChanged(int)’ is deprecated: Use checkStateChanged() instead [-Wdeprecated-declarations]
I'll try to configure my setup and recheck.

@chchwy
Copy link
Copy Markdown
Member

chchwy commented Apr 15, 2026

We currently use both Qt 5.15 & 6.5.3. I would recommend you install Qt 6.5.3 for pencil2d development.

Hi, it looks like i'm using newer development kit. My setup:

Qt Creator 18.0.1
Based on Qt 6.10.1 (GCC 15.2.1 20251112, x86_64)

It compiles project with my changes, but show this kind of warnings pencil/app/src/toolspage.cpp:30: warning: ‘void QCheckBox::stateChanged(int)’ is deprecated: Use checkStateChanged() instead [-Wdeprecated-declarations] I'll try to configure my setup and recheck.

@Assemberist
Copy link
Copy Markdown
Author

We currently use both Qt 5.15 & 6.5.3. I would recommend you install Qt 6.5.3 for pencil2d development.

Hi, it looks like i'm using newer development kit. My setup:

Qt Creator 18.0.1
Based on Qt 6.10.1 (GCC 15.2.1 20251112, x86_64)

It compiles project with my changes, but show this kind of warnings pencil/app/src/toolspage.cpp:30: warning: ‘void QCheckBox::stateChanged(int)’ is deprecated: Use checkStateChanged() instead [-Wdeprecated-declarations] I'll try to configure my setup and recheck.

Hi,
I'll try, but it's difficult since i use archlinux. About this pull request: i can see #2000, where checkStateChanged() was fixed. Should i proceed with code modification?
BRs.

Assemberist and others added 6 commits April 18, 2026 18:44
Added 2 Settings to preferences->files
1. autosaving by time
2. autosave timer (min)

Defects:
Autosaving can break user action. Need implement check if user do some input before autosave.
Found assumed save function.
Saving ocurred when user don't draw something
(don't hold a mouse button or a modificator-keys i.e. SHIFT)
Allman style is used
public interfaces should be top.
To Null pointer

Co-authored-by: Oliver Stevns <1045397+MrStevns@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@chchwy
Copy link
Copy Markdown
Member

chchwy commented Apr 19, 2026

We currently use both Qt 5.15 & 6.5.3. I would recommend you install Qt 6.5.3 for pencil2d development.

Hi, it looks like i'm using newer development kit. My setup:

Qt Creator 18.0.1
Based on Qt 6.10.1 (GCC 15.2.1 20251112, x86_64)

It compiles project with my changes, but show this kind of warnings pencil/app/src/toolspage.cpp:30: warning: ‘void QCheckBox::stateChanged(int)’ is deprecated: Use checkStateChanged() instead [-Wdeprecated-declarations] I'll try to configure my setup and recheck.

Hi, I'll try, but it's difficult since i use archlinux. About this pull request: i can see #2000, where checkStateChanged() was fixed. Should i proceed with code modification? BRs.

Yes, please.

@chchwy
Copy link
Copy Markdown
Member

chchwy commented Apr 19, 2026

I will send you a PR to address issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

3 participants