Skip to content

Commit

Permalink
Always exit through PresentationController.quit()
Browse files Browse the repository at this point in the history
This ensures that the metadata will always be saved.
  • Loading branch information
rschroll committed Aug 10, 2012
1 parent d9e47ea commit da9ffa1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/classes/metadata/pdf.vala
Expand Up @@ -189,6 +189,13 @@ namespace pdfpc.Metadata {
}
}

/*
* Called on quit
*/
public void quit() {
this.save_to_disk();
}

/**
* Save the metadata to disk, if needed (i.e. if the user did something
* with the notes or the skips)
Expand Down
10 changes: 5 additions & 5 deletions src/classes/presentation_controller.vala
Expand Up @@ -193,6 +193,11 @@ namespace pdfpc {
this.fillActionNames();
}

public void quit() {
this.metadata.quit();
Gtk.main_quit();
}

public void set_overview(Window.Overview o) {
this.overview = o;
}
Expand Down Expand Up @@ -841,11 +846,6 @@ namespace pdfpc {
}
}

protected void quit() {
this.metadata.save_to_disk();
Gtk.main_quit();
}

/**
* Parse the given time string to a Time object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/classes/window/presentation.vala
Expand Up @@ -48,7 +48,7 @@ namespace pdfpc.Window {
base( screen_num );

this.destroy.connect( (source) => {
Gtk.main_quit();
presentation_controller.quit();
} );

this.presentation_controller = presentation_controller;
Expand Down
2 changes: 1 addition & 1 deletion src/classes/window/presenter.vala
Expand Up @@ -141,7 +141,7 @@ namespace pdfpc.Window {
base( screen_num );

this.destroy.connect( (source) => {
Gtk.main_quit();
presentation_controller.quit();
} );

this.presentation_controller = presentation_controller;
Expand Down

0 comments on commit da9ffa1

Please sign in to comment.