[latexila/wip/gtef] Document: remove new_file instance variable
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila/wip/gtef] Document: remove new_file instance variable
- Date: Sat, 22 Oct 2016 07:19:42 +0000 (UTC)
commit 752caea417504ff811d96560b5e9ec0b2468274a
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Oct 22 09:08:27 2016 +0200
Document: remove new_file instance variable
get_modified() is enough.
src/document.vala | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
---
diff --git a/src/document.vala b/src/document.vala
index 45b37fe..9519e9e 100644
--- a/src/document.vala
+++ b/src/document.vala
@@ -36,7 +36,6 @@ public class Document : Gtef.Buffer
private bool backup_made = false;
private string _etag;
private string? encoding = null;
- private bool new_file = true;
private DocumentStructure _structure = null;
private FileInfo _metadata_info = new FileInfo ();
@@ -51,19 +50,6 @@ public class Document : Gtef.Buffer
update_syntax_highlighting ();
update_project_id ();
});
-
- changed.connect (() =>
- {
- new_file = false;
- });
- }
-
- public new bool get_modified ()
- {
- if (new_file)
- return false;
-
- return base.get_modified ();
}
public new void insert (ref TextIter iter, string text, int len)
@@ -137,7 +123,6 @@ public class Document : Gtef.Buffer
begin_not_undoable_action ();
set_text (contents2 ?? contents, -1);
- new_file = true;
set_modified (false);
end_not_undoable_action ();
@@ -152,7 +137,7 @@ public class Document : Gtef.Buffer
return_if_fail (location != null);
// if not modified, don't save
- if (! force && ! new_file && ! get_modified ())
+ if (! force && ! get_modified ())
return;
// we use get_text () to exclude undisplayed text
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]