From: <ev...@us...> - 2006-07-27 20:03:10
|
Revision: 16586 Author: evands Date: 2006-07-27 13:02:57 -0700 (Thu, 27 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16586&view=rev Log Message: ----------- It is feasible that a UI is finished with notifying the user via the Notification API within the UI callback and has no need of a ui_handle to deal with closing the notification at a later date nor to tell the gaim core at a later point that it is finished with the data. If the ui_op for a notification returns a ui_handle of NULL, the GaimNotifyCloseCallback (if non-NULL) is now called immediately and the info structure is freed. If the op returns a non-NULL value, which is the case for all of gtkgaim's functions, the behavior is unchanged. Modified Paths: -------------- trunk/src/notify.c Modified: trunk/src/notify.c =================================================================== --- trunk/src/notify.c 2006-07-27 18:58:14 UTC (rev 16585) +++ trunk/src/notify.c 2006-07-27 20:02:57 UTC (rev 16586) @@ -58,9 +58,19 @@ info->cb = cb; info->cb_user_data = user_data; - handles = g_list_append(handles, info); + if (info->ui_handle != NULL) { + handles = g_list_append(handles, info); + + return info->ui_handle; + + } else { + if (info->cb != NULL) + info->cb(info->cb_user_data); - return info->ui_handle; + g_free(info); + + return NULL; + } } return NULL; @@ -85,8 +95,20 @@ info->cb = cb; info->cb_user_data = user_data; - handles = g_list_append(handles, info); + if (info->ui_handle != NULL) { + handles = g_list_append(handles, info); + return info->ui_handle; + + } else { + if (info->cb != NULL) + info->cb(info->cb_user_data); + + g_free(info); + + return NULL; + } + return info->ui_handle; } @@ -125,9 +147,19 @@ info->cb = cb; info->cb_user_data = user_data; - handles = g_list_append(handles, info); + if (info->ui_handle != NULL) { + handles = g_list_append(handles, info); - return info->ui_handle; + return info->ui_handle; + + } else { + if (info->cb != NULL) + info->cb(info->cb_user_data); + + g_free(info); + + return NULL; + } } return NULL; @@ -154,9 +186,19 @@ info->cb = cb; info->cb_user_data = user_data; - handles = g_list_append(handles, info); - - return info->ui_handle; + if (info->ui_handle != NULL) { + handles = g_list_append(handles, info); + + return info->ui_handle; + + } else { + if (info->cb != NULL) + info->cb(info->cb_user_data); + + g_free(info); + + return NULL; + } } return NULL; @@ -183,8 +225,20 @@ info->cb = cb; info->cb_user_data = user_data; - handles = g_list_append(handles, info); + if (info->ui_handle != NULL) { + handles = g_list_append(handles, info); + return info->ui_handle; + + } else { + if (info->cb != NULL) + info->cb(info->cb_user_data); + + g_free(info); + + return NULL; + } + return info->ui_handle; } @@ -375,10 +429,21 @@ info->cb = cb; info->cb_user_data = user_data; - handles = g_list_append(handles, info); + g_free(infotext); - g_free(infotext); - return info->ui_handle; + if (info->ui_handle != NULL) { + handles = g_list_append(handles, info); + + return info->ui_handle; + + } else { + if (info->cb != NULL) + info->cb(info->cb_user_data); + + g_free(info); + + return NULL; + } } return NULL; @@ -401,9 +466,16 @@ info->handle = handle; info->ui_handle = ops->notify_uri(uri); - handles = g_list_append(handles, info); + if (info->ui_handle != NULL) { + handles = g_list_append(handles, info); + + return info->ui_handle; - return info->ui_handle; + } else { + g_free(info); + + return NULL; + } } return NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-07-27 20:11:00
|
Revision: 16587 Author: evands Date: 2006-07-27 13:10:57 -0700 (Thu, 27 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16587&view=rev Log Message: ----------- Removed an unneeded return and made the notify functions call the close callback immediately if there is no appropriate ui_op. Modified Paths: -------------- trunk/src/notify.c Modified: trunk/src/notify.c =================================================================== --- trunk/src/notify.c 2006-07-27 20:02:57 UTC (rev 16586) +++ trunk/src/notify.c 2006-07-27 20:10:57 UTC (rev 16587) @@ -70,7 +70,11 @@ g_free(info); return NULL; - } + } + + } else { + if (cb != NULL) + cb(user_data); } return NULL; @@ -108,8 +112,9 @@ return NULL; } - - return info->ui_handle; + } else { + if (cb != NULL) + cb(user_data); } return NULL; @@ -160,6 +165,10 @@ return NULL; } + + } else { + if (cb != NULL) + cb(user_data); } return NULL; @@ -199,6 +208,10 @@ return NULL; } + + } else { + if (cb != NULL) + cb(user_data); } return NULL; @@ -239,7 +252,9 @@ return NULL; } - return info->ui_handle; + } else { + if (cb != NULL) + cb(user_data); } return NULL; @@ -444,6 +459,10 @@ return NULL; } + + } else { + if (cb != NULL) + cb(user_data); } return NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |