From 267987763cb235c5187643936ec802827d3723ea Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Thu, 9 Jun 2011 10:21:55 -0600 Subject: [PATCH] removing is_polling completely --- SparkleLib/SparkleRepoBase.cs | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index cf9d5ac6..883e0338 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -46,7 +46,6 @@ namespace SparkleLib { protected SyncStatus status; protected bool is_buffering = false; - protected bool is_polling = true; protected bool server_online = true; public readonly SparkleBackend Backend; @@ -96,7 +95,7 @@ namespace SparkleLib { }; this.remote_timer.Elapsed += delegate { - if (this.is_polling) { + if (!this.listener.IsConnected) { if (CheckForRemoteChanges ()) SyncDownBase (); } @@ -192,13 +191,6 @@ namespace SparkleLib { } - public bool IsPolling { - get { - return this.is_polling; - } - } - - // Disposes all resourses of this object public void Dispose () { @@ -230,8 +222,6 @@ namespace SparkleLib { // Stop polling when the connection to the irc channel is succesful this.listener.Connected += delegate { - this.is_polling = false; - // Check for changes manually one more time if (CheckForRemoteChanges ()) SyncDownBase (); @@ -244,7 +234,6 @@ namespace SparkleLib { // Start polling when the connection to the irc channel is lost this.listener.Disconnected += delegate { SparkleHelpers.DebugInfo (Name, "Falling back to polling"); - this.is_polling = true; }; // Fetch changes when there is a message in the irc channel @@ -262,12 +251,11 @@ namespace SparkleLib { } } }; - + // Start listening - if (!this.listener.IsConnected && !this.listener.IsConnecting) + if (!this.listener.IsConnected && !this.listener.IsConnecting) { this.listener.Connect (); - else - this.is_polling = false; + } }