diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-15 17:33:28 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-01-29 19:28:33 +0000 |
commit | 9624c084d46660721aa0173e23103cd25165a5a5 (patch) | |
tree | bb555e64bb4dad6293a256e0cc4d7ee6b0684938 /src | |
parent | 8e5e39aa29a833be16598b2392539af07808a85d (diff) |
mcd_storage_commit: rely on never being called with account == NULL
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
Diffstat (limited to 'src')
-rw-r--r-- | src/mcd-storage.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/mcd-storage.c b/src/mcd-storage.c index d3bc5dae..cbca24e2 100644 --- a/src/mcd-storage.c +++ b/src/mcd-storage.c @@ -1828,33 +1828,21 @@ mcd_storage_delete_account (McdStorage *self, void mcd_storage_commit (McdStorage *self, const gchar *account) { - GList *store; McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); McpAccountStorage *plugin; const gchar *pname; g_return_if_fail (MCD_IS_STORAGE (self)); + g_return_if_fail (account != NULL); - if (account != NULL) - { - plugin = g_hash_table_lookup (self->accounts, account); - g_return_if_fail (plugin != NULL); - - pname = mcp_account_storage_name (plugin); - - DEBUG ("flushing plugin %s %s to long term storage", pname, account); - mcp_account_storage_commit (plugin, ma, account); - return; - } + plugin = g_hash_table_lookup (self->accounts, account); + g_return_if_fail (plugin != NULL); - for (store = stores; store != NULL; store = g_list_next (store)) - { - plugin = store->data; - pname = mcp_account_storage_name (plugin); + pname = mcp_account_storage_name (plugin); - DEBUG ("flushing plugin %s to long term storage", pname); - mcp_account_storage_commit (plugin, ma, NULL); - } + /* FIXME: fd.o #29563: this should be async, really */ + DEBUG ("flushing plugin %s %s to long term storage", pname, account); + mcp_account_storage_commit (plugin, ma, account); } /* |