Mercurial > pidgin.yaz
changeset 21374:71c1f2da4ff2
PurpleConnectionErrorPair is a better name for struct { PurpleConnectionError;
const char *desc } than PurpleAccountCurrentError.
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Sun, 28 Oct 2007 16:32:37 +0000 |
parents | cbf197042bad |
children | 50fa2c5a7029 |
files | doc/account-signals.dox libpurple/account.c libpurple/account.h libpurple/connection.h pidgin/gtkblist.c |
diffstat | 5 files changed, 20 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/account-signals.dox Sun Oct 28 13:01:45 2007 +0000 +++ b/doc/account-signals.dox Sun Oct 28 16:32:37 2007 +0000 @@ -144,7 +144,7 @@ @signaldef account-error-changed @signalproto -void (*account_error_changed)(PurpleAccount *account, const PurpleAccountCurrentError *old_error, const PurpleAccountCurrentError *current_error); +void (*account_error_changed)(PurpleAccount *account, const PurpleConnectionErrorPair *old_error, const PurpleConnectionErrorPair *current_error); @endsignalproto @signaldesc Emitted when @a account's error changes.
--- a/libpurple/account.c Sun Oct 28 13:01:45 2007 +0000 +++ b/libpurple/account.c Sun Oct 28 16:32:37 2007 +0000 @@ -43,7 +43,7 @@ typedef struct { - PurpleAccountCurrentError *current_error; + PurpleConnectionErrorPair *current_error; } PurpleAccountPrivate; #define PURPLE_ACCOUNT_GET_PRIVATE(account) \ @@ -2236,7 +2236,7 @@ clear_current_error(PurpleAccount *account) { PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); - PurpleAccountCurrentError *old; + PurpleConnectionErrorPair *old; if (priv->current_error) { @@ -2266,10 +2266,10 @@ { PurpleAccount *account = purple_connection_get_account(gc); PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account); - PurpleAccountCurrentError *old = priv->current_error; - - priv->current_error = g_new0(PurpleAccountCurrentError, 1); - priv->current_error->reason = err; + PurpleConnectionErrorPair *old = priv->current_error; + + priv->current_error = g_new0(PurpleConnectionErrorPair, 1); + priv->current_error->type = err; priv->current_error->description = desc; purple_signal_emit(purple_accounts_get_handle(), @@ -2278,7 +2278,7 @@ g_free(old); } -const PurpleAccountCurrentError * +const PurpleConnectionErrorPair * purple_account_get_current_error(PurpleAccount *account) { PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
--- a/libpurple/account.h Sun Oct 28 13:01:45 2007 +0000 +++ b/libpurple/account.h Sun Oct 28 16:32:37 2007 +0000 @@ -144,15 +144,6 @@ gpointer priv; /**< Pointer to opaque private data. */ }; -/** The error most recently encountered on an account. */ -typedef struct -{ - /** The type of error. */ - PurpleConnectionError reason; - /** A localised, human-readable description of the error. */ - const char *description; -} PurpleAccountCurrentError; - #ifdef __cplusplus extern "C" { #endif @@ -912,7 +903,7 @@ * @constreturn The type of error and a human-readable description of the * current error, or @c NULL if there is no current error. */ -const PurpleAccountCurrentError *purple_account_get_current_error(PurpleAccount *account); +const PurpleConnectionErrorPair *purple_account_get_current_error(PurpleAccount *account); /*@}*/
--- a/libpurple/connection.h Sun Oct 28 13:01:45 2007 +0000 +++ b/libpurple/connection.h Sun Oct 28 16:32:37 2007 +0000 @@ -126,6 +126,15 @@ PURPLE_CONNECTION_ERROR_OTHER_ERROR = 15 } PurpleConnectionError; +/** Holds the type of an error along with its description. */ +typedef struct +{ + /** The type of error. */ + PurpleConnectionError type; + /** A localised, human-readable description of the error. */ + const char *description; +} PurpleConnectionErrorPair; + #include <time.h> #include "account.h"
--- a/pidgin/gtkblist.c Sun Oct 28 13:01:45 2007 +0000 +++ b/pidgin/gtkblist.c Sun Oct 28 16:32:37 2007 +0000 @@ -4395,8 +4395,8 @@ static void update_account_error_state(PurpleAccount *account, - PurpleAccountCurrentError *old, - PurpleAccountCurrentError *new, + PurpleConnectionErrorPair *old, + PurpleConnectionErrorPair *new, PidginBuddyList *gtkblist) { if (new)