Commit 3eb474fe authored by Philip Withnall's avatar Philip Withnall
Browse files

backends: Add [freeze|thaw]_notify() calls to [un]prepare() in backends

Reduce signal duplication. Inspired by the dummy backend.
parent e0e76750
......@@ -466,6 +466,7 @@ public class Folks.Backends.BlueZ.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
try
{
......@@ -569,6 +570,7 @@ public class Folks.Backends.BlueZ.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
......
......@@ -206,6 +206,7 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
this._create_avatars_cache_dir ();
......@@ -226,6 +227,7 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
......@@ -245,6 +247,7 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
var iter = this._persona_stores.values.iterator ();
......@@ -263,6 +266,7 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
}
......
......@@ -183,6 +183,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
File file;
unowned string path = Environment.get_variable (
......@@ -216,6 +217,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
......@@ -270,6 +272,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
foreach (var persona_store in this._persona_stores.values)
{
......@@ -287,6 +290,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
}
......
......@@ -183,6 +183,8 @@ public class Folks.Backends.Sw.Backend : Folks.Backend
{
try
{
this.freeze_notify ();
foreach (var service_name in services)
this.add_service (service_name);
......@@ -196,6 +198,7 @@ public class Folks.Backends.Sw.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
});
......@@ -216,6 +219,7 @@ public class Folks.Backends.Sw.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
foreach (var store in this._persona_stores.values)
{
......@@ -236,6 +240,7 @@ public class Folks.Backends.Sw.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
}
......
......@@ -174,6 +174,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
/* New modem devices can be caught in notifications */
Manager manager;
......@@ -199,16 +200,15 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
this._modem_added (modem.path, modem.properties);
}
this.freeze_notify ();
this._is_prepared = true;
this.notify_property ("is-prepared");
this._is_quiescent = true;
this.notify_property ("is-quiescent");
this.thaw_notify ();
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
......@@ -228,13 +228,13 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
foreach (var persona_store in this._persona_stores.values)
{
this.persona_store_removed (persona_store);
}
this.freeze_notify ();
this._persona_stores.clear ();
this.notify_property ("persona-stores");
......@@ -243,10 +243,10 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
this._is_prepared = false;
this.notify_property ("is-prepared");
this.thaw_notify ();
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
}
......
......@@ -166,6 +166,8 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
this._account_manager = AccountManager.dup ();
yield this._account_manager.prepare_async (null);
this._account_manager.account_enabled.connect (
......@@ -188,6 +190,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
......@@ -207,6 +210,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
this._account_manager.account_enabled.disconnect (
this._account_enabled_cb);
......@@ -222,6 +226,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
}
......
......@@ -147,6 +147,7 @@ public class Folks.Backends.Tr.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
this._add_default_persona_store ();
......@@ -158,6 +159,7 @@ public class Folks.Backends.Tr.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
......@@ -177,6 +179,7 @@ public class Folks.Backends.Tr.Backend : Folks.Backend
try
{
this._prepare_pending = true;
this.freeze_notify ();
foreach (var persona_store in this._persona_stores.values)
{
......@@ -194,6 +197,7 @@ public class Folks.Backends.Tr.Backend : Folks.Backend
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment