lainsce / timetable

[DEPRECATED] Plot out your own timetable for the week and organize it
GNU General Public License v3.0
6 stars 3 forks source link

Fix an existing file is not saved when we click the "New" button #12

Closed ryonakano closed 5 years ago

ryonakano commented 5 years ago

Steps to reproduce the behavior

Solution

Before saving the timetable, we have this condition:

https://github.com/lainsce/timetable/blob/b72fce896e3da6a0d7fc454fd53c3433d0cbea39/src/Services/FileManager.vala#L76

But that condition is not always met when it was called by clicking the "New" button, because columns of the timetable is always set as not modified soon after the dialog is shown:

https://github.com/lainsce/timetable/blob/b72fce896e3da6a0d7fc454fd53c3433d0cbea39/src/Services/FileManager.vala#L41-L49

To solve this problem, I create a new method, immigrate is_modified sentences into that method, and call that method after the saving process is done (thus user saves their timetable) and when user doesn't save their timetable.

lainsce commented 5 years ago

:+1: