gaim/gaim

1603d2de5774
Parents aeeb47a7d41a
Children 3f480a32bb44
The previous change meant we would have to bump the version number
to 1.3.0. This way we can stay at 1.2.1. The difference is that
now the blist will be synced immediately instead of after a short
delay. It'll be better in head.
--- a/src/blist.c Sat Mar 19 20:19:32 2005 -0500
+++ b/src/blist.c Sat Mar 19 20:27:09 2005 -0500
@@ -165,6 +165,14 @@
return FALSE;
}
+static void
+schedule_blist_save()
+{
+ if (blist_save_timer != 0)
+ gaim_timeout_remove(blist_save_timer);
+ blist_save_timer = gaim_timeout_add(1000, blist_save_callback, NULL);
+}
+
/*****************************************************************************
* Public API functions *
@@ -398,7 +406,7 @@
g_free(buddy->name);
buddy->name = g_strdup(name);
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update)
ops->update(gaimbuddylist, (GaimBlistNode *)buddy);
@@ -416,7 +424,7 @@
else
chat->alias = NULL;
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update)
ops->update(gaimbuddylist, (GaimBlistNode *)chat);
@@ -435,7 +443,7 @@
else
buddy->alias = NULL;
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update)
ops->update(gaimbuddylist, (GaimBlistNode *)buddy);
@@ -458,7 +466,7 @@
else
buddy->server_alias = NULL;
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update)
ops->update(gaimbuddylist, (GaimBlistNode *)buddy);
@@ -541,7 +549,7 @@
}
/* Save our changes */
- gaim_schedule_blist_save();
+ schedule_blist_save();
/* Update the UI */
if (ops && ops->update)
@@ -647,7 +655,7 @@
else
gaim_blist_node_remove_setting((GaimBlistNode *)buddy, "buddy_icon");
- gaim_schedule_blist_save();
+ schedule_blist_save();
gaim_blist_update_buddy_icon(buddy);
}
@@ -700,7 +708,7 @@
ops->remove(gaimbuddylist, cnode);
- gaim_schedule_blist_save();
+ schedule_blist_save();
}
if (node != NULL) {
@@ -729,7 +737,7 @@
}
}
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update)
ops->update(gaimbuddylist, (GaimBlistNode *)cnode);
@@ -801,7 +809,7 @@
ops->remove(gaimbuddylist, bnode);
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (bnode->parent->parent != (GaimBlistNode*)g) {
hb = g_new(struct _gaim_hbuddy, 1);
@@ -858,7 +866,7 @@
gaim_contact_compute_priority_buddy(gaim_buddy_get_contact(buddy));
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update)
ops->update(gaimbuddylist, (GaimBlistNode*)buddy);
@@ -895,7 +903,7 @@
else
contact->alias = NULL;
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update)
ops->update(gaimbuddylist, (GaimBlistNode*)contact);
@@ -1038,7 +1046,7 @@
ops->remove(gaimbuddylist, cnode);
- gaim_schedule_blist_save();
+ schedule_blist_save();
}
if (node && (GAIM_BLIST_NODE_IS_CONTACT(node) ||
@@ -1064,7 +1072,7 @@
g->currentsize++;
g->totalsize++;
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && cnode->child)
ops->update(gaimbuddylist, cnode);
@@ -1155,7 +1163,7 @@
gaimbuddylist->root = gnode;
}
- gaim_schedule_blist_save();
+ schedule_blist_save();
if (ops && ops->update) {
ops->update(gaimbuddylist, gnode);
@@ -1198,7 +1206,7 @@
if (node->next)
node->next->prev = node->prev;
- gaim_schedule_blist_save();
+ schedule_blist_save();
/* Update the UI */
if (ops && ops->remove)
@@ -1247,7 +1255,7 @@
}
contact->totalsize--;
- gaim_schedule_blist_save();
+ schedule_blist_save();
/* Re-sort the contact */
if (contact->priority == buddy) {
@@ -1310,7 +1318,7 @@
}
group->totalsize--;
- gaim_schedule_blist_save();
+ schedule_blist_save();
/* Update the UI */
if (ops && ops->remove)
@@ -1364,7 +1372,7 @@
if (node->next)
node->next->prev = node->prev;
- gaim_schedule_blist_save();
+ schedule_blist_save();
/* Update the UI */
if (ops && ops->remove)
@@ -2431,14 +2439,6 @@
g_free(filename_real);
}
-void
-gaim_schedule_blist_save()
-{
- if (blist_save_timer != 0)
- gaim_timeout_remove(blist_save_timer);
- blist_save_timer = gaim_timeout_add(1000, blist_save_callback, NULL);
-}
-
static void gaim_blist_node_setting_free(struct gaim_blist_node_setting *setting)
{
switch(setting->type) {
@@ -2469,7 +2469,7 @@
g_hash_table_remove(node->settings, key);
- gaim_schedule_blist_save();
+ schedule_blist_save();
}
@@ -2487,7 +2487,7 @@
g_hash_table_replace(node->settings, g_strdup(key), setting);
- gaim_schedule_blist_save();
+ schedule_blist_save();
}
gboolean gaim_blist_node_get_bool(GaimBlistNode* node, const char *key)
@@ -2522,7 +2522,7 @@
g_hash_table_replace(node->settings, g_strdup(key), setting);
- gaim_schedule_blist_save();
+ schedule_blist_save();
}
int gaim_blist_node_get_int(GaimBlistNode* node, const char *key)
@@ -2558,7 +2558,7 @@
g_hash_table_replace(node->settings, g_strdup(key), setting);
- gaim_schedule_blist_save();
+ schedule_blist_save();
}
const char *gaim_blist_node_get_string(GaimBlistNode* node, const char *key)
--- a/src/blist.h Sat Mar 19 20:19:32 2005 -0500
+++ b/src/blist.h Sat Mar 19 20:27:09 2005 -0500
@@ -717,11 +717,6 @@
void gaim_blist_sync();
/**
- * Schedule a save of the buddy list.
- */
-void gaim_schedule_blist_save();
-
-/**
* Loads the buddy list from ~/.gaim/blist.xml.
*/
void gaim_blist_load();
--- a/src/gtkprivacy.c Sat Mar 19 20:19:32 2005 -0500
+++ b/src/gtkprivacy.c Sat Mar 19 20:27:09 2005 -0500
@@ -266,7 +266,7 @@
dialog->in_allow_list = FALSE;
}
- gaim_schedule_blist_save();
+ gaim_blist_sync();
}
static void
--- a/src/privacy.c Sat Mar 19 20:19:32 2005 -0500
+++ b/src/privacy.c Sat Mar 19 20:27:09 2005 -0500
@@ -58,7 +58,7 @@
if (privacy_ops != NULL && privacy_ops->permit_added != NULL)
privacy_ops->permit_added(account, who);
- gaim_schedule_blist_save();
+ gaim_blist_sync();
return TRUE;
}
@@ -94,7 +94,7 @@
if (privacy_ops != NULL && privacy_ops->permit_removed != NULL)
privacy_ops->permit_removed(account, who);
- gaim_schedule_blist_save();
+ gaim_blist_sync();
return TRUE;
}
@@ -129,7 +129,7 @@
if (privacy_ops != NULL && privacy_ops->deny_added != NULL)
privacy_ops->deny_added(account, who);
- gaim_schedule_blist_save();
+ gaim_blist_sync();
return TRUE;
}
@@ -165,7 +165,7 @@
if (privacy_ops != NULL && privacy_ops->deny_removed != NULL)
privacy_ops->deny_removed(account, who);
- gaim_schedule_blist_save();
+ gaim_blist_sync();
return TRUE;
}