Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

controller: Disable folder watching when moving cloned folder into pl…

…ace. #816
  • Loading branch information...
commit 62f59a44f40d4b2a769937ed63013840263e88a1 1 parent 0b4c485
@hbons authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 SparkleShare/SparkleControllerBase.cs
View
12 SparkleShare/SparkleControllerBase.cs
@@ -160,6 +160,7 @@ public abstract class SparkleControllerBase {
private SparkleConfig config;
private SparkleFetcherBase fetcher;
+ private FileSystemWatcher watcher;
private Object repo_lock = new Object ();
private Object check_repos_lock = new Object ();
@@ -216,7 +217,7 @@ public virtual void Initialize ()
}
// Watch the SparkleShare folder
- FileSystemWatcher watcher = new FileSystemWatcher () {
+ this.watcher = new FileSystemWatcher () {
Filter = "*",
IncludeSubdirectories = false,
Path = FoldersPath
@@ -547,7 +548,10 @@ public void StopFetcher ()
public void FinishFetcher (string password)
{
this.fetcher.EnableFetchedRepoCrypto (password);
+
+ this.watcher.EnableRaisingEvents = false;
FinishFetcher ();
+ this.watcher.EnableRaisingEvents = true;
}
@@ -565,11 +569,7 @@ public void FinishFetcher ()
while (target_folder_exists) {
suffix++;
target_folder_exists = Directory.Exists (
- Path.Combine (
- this.config.FoldersPath,
- canonical_name + " (" + suffix + ")"
- )
- );
+ Path.Combine (this.config.FoldersPath, canonical_name + " (" + suffix + ")"));
}
string target_folder_name = canonical_name;
Please sign in to comment.
Something went wrong with that request. Please try again.