# HG changeset patch # User Will Thompson # Date 1193589157 0 # Node ID 71c1f2da4ff24c69226e75a0210285823ba455e9 # Parent cbf197042bad592ee730f1521f555fc27a72123d PurpleConnectionErrorPair is a better name for struct { PurpleConnectionError; const char *desc } than PurpleAccountCurrentError. diff -r cbf197042bad -r 71c1f2da4ff2 doc/account-signals.dox --- 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. diff -r cbf197042bad -r 71c1f2da4ff2 libpurple/account.c --- 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); diff -r cbf197042bad -r 71c1f2da4ff2 libpurple/account.h --- 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); /*@}*/ diff -r cbf197042bad -r 71c1f2da4ff2 libpurple/connection.h --- 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 #include "account.h" diff -r cbf197042bad -r 71c1f2da4ff2 pidgin/gtkblist.c --- 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)