[the-board] [model] Only save page on disk if model is dirty
- From: Lucas Rocha <lucasr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [the-board] [model] Only save page on disk if model is dirty
- Date: Sun, 19 Dec 2010 22:12:05 +0000 (UTC)
commit 50e01545dd899dd240051671403129488a407f82
Author: Lucas Rocha <lucasr gnome org>
Date: Sun Dec 19 22:09:42 2010 +0000
[model] Only save page on disk if model is dirty
src/js/model/pageModel.js | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/js/model/pageModel.js b/src/js/model/pageModel.js
index 5608b27..1e29c4c 100644
--- a/src/js/model/pageModel.js
+++ b/src/js/model/pageModel.js
@@ -1,6 +1,7 @@
// standard imports
const ByteArray = imports.byteArray;
const Lang = imports.lang;
+const Mainloop = imports.mainloop;
const Signals = imports.signals;
// gi imports
@@ -286,7 +287,11 @@ PageModel.prototype = {
},
save : function(onResult) {
- this._saveContentToPath(onResult);
+ if (this._dirty) {
+ this._saveContentToPath(onResult);
+ } else {
+ Mainloop.idle_add(onResult);
+ }
},
isNew : function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]