Merge lp://qastaging/~tintou/scratch/scratch-backup-changes into lp://qastaging/~elementary-apps/scratch/scratch

Proposed by Corentin Noël
Status: Needs review
Proposed branch: lp://qastaging/~tintou/scratch/scratch-backup-changes
Merge into: lp://qastaging/~elementary-apps/scratch/scratch
Diff against target: 628 lines (+206/-165)
4 files modified
plugins/outline/CMakeLists.txt (+9/-5)
src/MainWindow.vala (+1/-1)
src/Services/Document.vala (+195/-158)
src/Services/FileHandler.vala (+1/-1)
To merge this branch: bzr merge lp://qastaging/~tintou/scratch/scratch-backup-changes
Reviewer Review Type Date Requested Status
Zisu Andrei (community) Needs Information
xapantu (community) Needs Fixing
Review via email: mp+271337@code.qastaging.launchpad.net

Description of the change

The restoration point isn't kept in memory but in the backup file.
Don't check for file existence at focus but creates a FileMonitor to have every events on real-time.

With this the file loading process is much faster.

To post a comment you must log in.
Revision history for this message
xapantu (xapantu) wrote :
Download full text (4.8 KiB)

Some in-line comments, maybe more to come.

Here is a crash, after using the "save as" button (maybe not related, I don't have a backtrace yet).

xapantu@ntu /t/s/build> src/scratch-text-editor
[INFO 02:22:03.881206] Application.vala:155: Scratch version: 2.2.1
[INFO 02:22:03.881260] Application.vala:157: Kernel version: 4.1.4-1-ARCH
[DEBUG 02:22:03.882757] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.saved-state'
[DEBUG 02:22:03.883261] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.settings'
[DEBUG 02:22:03.884352] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.services'
[DEBUG 02:22:03.959510] [Gtk] Connecting to session manager
[WARNING 02:22:03.965308] [Gtk] Attempting to add a widget with type GtkScrolledWindow to a GtkDialog, but as a GtkBin subclass a GtkDialog can only contain one widget at a time; it already contains a widget of type GtkBox
[WARNING 02:22:03.965550] [libpeas] Failed to enable unknown plugin loader 'gjs'
[DEBUG 02:22:03.991315] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.plugins.terminal'
[WARNING 02:22:04.011552] [libpeas] Failed to enable unknown plugin loader 'gjs'
[WARNING 02:22:04.045298] [GLib-GObject] The property GtkSettings:gtk-menu-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
[FATAL 02:22:04.051353] [Gtk] gtk_header_bar_pack: assertion 'gtk_widget_get_parent (widget) == NULL' failed
[FATAL 02:22:04.157390] [Gtk] gtk_action_set_visible: assertion 'GTK_IS_ACTION (action)' failed
[DEBUG 02:22:04.157634] MainWindow.vala:673: open temporary file: Fichier texte à partir de 2015-09-24 01:28:31
[DEBUG 02:22:04.162284] sql-schema.vala:204: schema_version is 10
[INFO 02:22:04.206977] Document.vala:171: Opening "Nouveau document"
[DEBUG 02:22:04.312185] SplitView.vala:124: View added successfully
[WARNING 02:22:04.501706] [GLib-GObject] The property GtkCellRendererPixbuf:follow-state is deprecated and shouldn't be used anymore. It will be removed in a future version.
[DEBUG 02:22:04.502441] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.plugins.folder-manager'
[DEBUG 02:22:04.596172] sql-schema.vala:204: schema_version is 10
[INFO 02:22:04.606347] Document.vala:171: Opening "Nouveau document"
[WARNING 02:22:04.616528] DocumentView.vala:142: This Document was already opened! Not opening a duplicate!
[DEBUG 02:22:04.618693] sql-schema.vala:204: schema_version is 10
[INFO 02:22:04.625701] Document.vala:171: Opening "40_39.diff"
[FATAL 02:22:04.712490] [Gtk] gtk_text_view_get_editable: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
[FATAL 02:22:04.718433] [Gtk] gtk_text_view_get_editable: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
[FATAL 02:22:04.722147] [Gtk] gtk_text_view_get_editable: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
[FATAL 02:22:04.727046] [Gtk] gtk_text_view_get_editable: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
[FATAL 02:22:04.730144] [Gtk] gtk_text_view_get_editable: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
[FATAL 02:22:04.732916] [Gtk] gtk_text_view_get_editable: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
[FAT...

Read more...

review: Needs Fixing
1559. By Corentin Noël

Don't save the file while restoring it.

Revision history for this message
Corentin Noël (tintou) wrote :

Lucas: I fixed most inline comment you did, but most of the code is just copy/paste from older functions so it's not the scope of this branch to change all the behavior and strings :)

1560. By Corentin Noël

Fix save as.
Fixed Outline plugin cmake.

Revision history for this message
xapantu (xapantu) wrote :

Ok, nice, I will check that as soon as possible!

On 21/10/2015 22:31, Corentin Noël wrote:
> Lucas: I fixed most inline comment you did, but most of the code is just copy/paste from older functions so it's not the scope of this branch to change all the behavior and strings :)
>

Revision history for this message
Zisu Andrei (matzipan) wrote :

How do I test this?

review: Needs Information
Revision history for this message
Zisu Andrei (matzipan) wrote :

From tintou:

I think you have to open a document, and delete it, and see if scratch shows the infobar without even focusing it. Also see if the file~ is created and removed as it should be.

Unmerged revisions

1560. By Corentin Noël

Fix save as.
Fixed Outline plugin cmake.

1559. By Corentin Noël

Don't save the file while restoring it.

1558. By Corentin Noël

Fixed reverting sensitivity not being per-document.

1557. By Corentin Noël

More efficient document loading and changes handling.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches