projects
/
gitlive
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
05d6e32
)
Add support for pausing monitor, without reparsing the tree. - used to perform merge...
author
Alan Knowles
<alan@akbkhome.com>
Tue, 20 Sep 2011 14:40:37 +0000
(22:40 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Tue, 20 Sep 2011 14:40:37 +0000
(22:40 +0800)
Monitor.js
patch
|
blob
|
history
diff --git
a/Monitor.js
b/Monitor.js
index
fa67b5a
..
5d4ba1b
100644
(file)
--- a/
Monitor.js
+++ b/
Monitor.js
@@
-38,6
+38,7
@@
Monitor.prototype = {
monitors : false, // Array of GioFileMonitors
top : false, // list of top level directories..
monitors : false, // Array of GioFileMonitors
top : false, // list of top level directories..
+ paused : false,
/**
* add a directory or file to monitor
*/
/**
* add a directory or file to monitor
*/
@@
-63,6
+64,20
@@
Monitor.prototype = {
})
this.monitors = [];
},
})
this.monitors = [];
},
+ /**
+ * pause monitoring - without changing what's monitored
+ */
+ pause : function()
+ {
+ this.paused = true;
+ },
+ /**
+ * resume monitoring - without changing what's monitored
+ */
+ resume : function()
+ {
+ this.paused = false;
+ },
/**
* monitor a file or directory (privatish)
*
/**
* monitor a file or directory (privatish)
*
@@
-74,6
+89,7
@@
Monitor.prototype = {
{
var _this = this;
{
var _this = this;
+ // print("ADD: " + path)
depth = typeof(depth) == 'number' ? depth *1 : 0;
depth = typeof(depth) == 'number' ? depth *1 : 0;
@@
-135,6
+151,9
@@
Monitor.prototype = {
onEvent : function(fm, f, of, event_type, uh)
{
onEvent : function(fm, f, of, event_type, uh)
{
+ if (this.paused) {
+ return;
+ }
var src = {
name : f.get_basename(),
path : f.get_path(),
var src = {
name : f.get_basename(),
path : f.get_path(),