removing is_polling completely

This commit is contained in:
Travis Glenn Hansen 2011-06-09 10:21:55 -06:00
parent e937aa168f
commit 267987763c

View file

@ -46,7 +46,6 @@ namespace SparkleLib {
protected SyncStatus status; protected SyncStatus status;
protected bool is_buffering = false; protected bool is_buffering = false;
protected bool is_polling = true;
protected bool server_online = true; protected bool server_online = true;
public readonly SparkleBackend Backend; public readonly SparkleBackend Backend;
@ -96,7 +95,7 @@ namespace SparkleLib {
}; };
this.remote_timer.Elapsed += delegate { this.remote_timer.Elapsed += delegate {
if (this.is_polling) { if (!this.listener.IsConnected) {
if (CheckForRemoteChanges ()) if (CheckForRemoteChanges ())
SyncDownBase (); SyncDownBase ();
} }
@ -192,13 +191,6 @@ namespace SparkleLib {
} }
public bool IsPolling {
get {
return this.is_polling;
}
}
// Disposes all resourses of this object // Disposes all resourses of this object
public void Dispose () public void Dispose ()
{ {
@ -230,8 +222,6 @@ namespace SparkleLib {
// Stop polling when the connection to the irc channel is succesful // Stop polling when the connection to the irc channel is succesful
this.listener.Connected += delegate { this.listener.Connected += delegate {
this.is_polling = false;
// Check for changes manually one more time // Check for changes manually one more time
if (CheckForRemoteChanges ()) if (CheckForRemoteChanges ())
SyncDownBase (); SyncDownBase ();
@ -244,7 +234,6 @@ namespace SparkleLib {
// Start polling when the connection to the irc channel is lost // Start polling when the connection to the irc channel is lost
this.listener.Disconnected += delegate { this.listener.Disconnected += delegate {
SparkleHelpers.DebugInfo (Name, "Falling back to polling"); SparkleHelpers.DebugInfo (Name, "Falling back to polling");
this.is_polling = true;
}; };
// Fetch changes when there is a message in the irc channel // Fetch changes when there is a message in the irc channel
@ -262,12 +251,11 @@ namespace SparkleLib {
} }
} }
}; };
// Start listening // Start listening
if (!this.listener.IsConnected && !this.listener.IsConnecting) if (!this.listener.IsConnected && !this.listener.IsConnecting) {
this.listener.Connect (); this.listener.Connect ();
else }
this.is_polling = false;
} }