gobjectification: e3a07eb2: Fix some craps, comment some stuff. The ...
sadrul at pidgin.im
sadrul at pidgin.im
Thu Mar 13 05:55:59 EDT 2008
-----------------------------------------------------------------
Revision: e3a07eb210b690de33180ca0a7dcf27fdb17287e
Ancestor: e1656d9913e6a6c5e05b38be3767826483ee1dc7
Author: sadrul at pidgin.im
Date: 2008-03-13T09:50:50
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/e3a07eb210b690de33180ca0a7dcf27fdb17287e
Modified files:
libpurple/account.c libpurple/blist.c libpurple/connection.c
libpurple/connection.h libpurple/core.c libpurple/network.c
ChangeLog:
Fix some craps, comment some stuff. The nullclient now compiles and runs, and then crashes.
-------------- next part --------------
============================================================
--- libpurple/account.c c27f1e23afbc6eb308f22fec5ec9e08182567cc9
+++ libpurple/account.c 9a362c1710d81359c983a668534724fe3c379cdf
@@ -1490,7 +1490,7 @@ purple_account_get_username(const Purple
{
g_return_val_if_fail(account != NULL, NULL);
- return purple_account_get_username(account);
+ return account->username;
}
const char *
@@ -1498,7 +1498,7 @@ purple_account_get_password(const Purple
{
g_return_val_if_fail(account != NULL, NULL);
- return purple_account_get_password(account);
+ return account->password;
}
const char *
@@ -1529,7 +1529,7 @@ purple_account_get_protocol_id(const Pur
purple_account_get_protocol_id(const PurpleAccount *account)
{
g_return_val_if_fail(account != NULL, NULL);
- return purple_account_get_protocol_id(account);
+ return account->protocol_id;
}
const char *
@@ -1549,7 +1549,7 @@ purple_account_get_connection(const Purp
{
g_return_val_if_fail(account != NULL, NULL);
- return purple_account_get_connection(account);
+ return account->gc;
}
gboolean
============================================================
--- libpurple/blist.c 66cb58c05c8c75b7b7f350049abda56a4310a755
+++ libpurple/blist.c 4d23ddd87ab5f90a3bc37cdfd7794c081be3bf13
@@ -2045,8 +2045,8 @@ const char *purple_buddy_get_server_alia
{
g_return_val_if_fail(buddy != NULL, NULL);
- if ((purple_buddy_get_server_alias(buddy)) && (*purple_buddy_get_server_alias(buddy)))
- return purple_buddy_get_server_alias(buddy);
+ if ((buddy->server_alias) && (*buddy->server_alias))
+ return buddy->server_alias;
return NULL;
}
============================================================
--- libpurple/connection.c d1b2dfe99b78d57149c667a4a4e2a7b4baf591a8
+++ libpurple/connection.c f90c109fb62ec4630ea4facdfafda00d14871085
@@ -386,6 +386,7 @@ purple_connection_set_state(PurpleConnec
gc->priv->state = state;
+#if 0
ops = purple_connections_get_ui_ops();
if (gc->priv->state == PURPLE_CONNECTION_STATE_CONNECTING) {
@@ -394,6 +395,7 @@ purple_connection_set_state(PurpleConnec
else {
connections_connecting = g_list_remove(connections_connecting, gc);
}
+#endif
if (gc->priv->state == PURPLE_CONNECTION_STATE_CONNECTED) {
PurpleAccount *account;
@@ -421,12 +423,12 @@ purple_connection_set_state(PurpleConnec
}
}
+ purple_blist_add_account(account);
+
+#if 0
if (ops != NULL && ops->connected != NULL)
ops->connected(gc);
- purple_blist_add_account(account);
-
-#if 0
purple_signal_emit(purple_connections_get_handle(), "signed-on", gc);
#endif
@@ -454,8 +456,10 @@ purple_connection_set_state(PurpleConnec
purple_account_destroy_log(account);
+#if 0
if (ops != NULL && ops->disconnected != NULL)
ops->disconnected(gc);
+#endif
}
}
@@ -533,7 +537,7 @@ purple_connection_get_password(const Pur
{
g_return_val_if_fail(gc != NULL, NULL);
- return purple_connection_get_password(gc) ? purple_connection_get_password(gc) : purple_account_get_password(gc->priv->account);
+ return gc->priv->password ? gc->priv->password : purple_account_get_password(gc->priv->account);
}
const char *
@@ -555,10 +559,12 @@ purple_connection_update_progress(Purple
g_return_if_fail(step < count);
g_return_if_fail(count > 1);
+#if 0
ops = purple_connections_get_ui_ops();
if (ops != NULL && ops->connect_progress != NULL)
ops->connect_progress(gc, text, step, count);
+#endif
}
void
@@ -575,10 +581,12 @@ purple_connection_notice(PurpleConnectio
g_return_if_fail(gc != NULL);
g_return_if_fail(text != NULL);
+#if 0
ops = purple_connections_get_ui_ops();
if (ops != NULL && ops->notice != NULL)
ops->notice(gc, text);
+#endif
}
static gboolean
@@ -638,6 +646,8 @@ purple_connection_error_reason (PurpleCo
gc->priv->wants_to_die = purple_connection_error_is_fatal (reason);
+#if 0
+ /* This will probably eventually move to ConnectionManager */
ops = purple_connections_get_ui_ops();
if (ops != NULL)
@@ -648,7 +658,6 @@ purple_connection_error_reason (PurpleCo
ops->report_disconnect (gc, description);
}
-#if 0
purple_signal_emit(purple_connections_get_handle(), "connection-error",
gc, reason, description);
#endif
@@ -1028,3 +1037,11 @@ purple_connection_state_get_gtype(void)
return type;
}
+/***
+ * These should move to PurpleConnectionManager
+ */
+GList *purple_connections_get_all(void)
+{
+ return connections;
+}
+
============================================================
--- libpurple/connection.h 100f3e63f17e182b1198cb87afae1bced312a115
+++ libpurple/connection.h be0c2247985e536c69a2cc33b33bba38edb6726c
@@ -519,11 +519,6 @@ purple_connection_error_is_fatal (Purple
/*@{*/
/**
- * Disconnects from all connections.
- */
-void purple_connections_disconnect_all(void);
-
-/**
* Returns a list of all active connections. This does not
* include connections that are in the process of connecting.
*
@@ -531,12 +526,19 @@ GList *purple_connections_get_all(void);
*/
GList *purple_connections_get_all(void);
+#if 0
/**
+ * Disconnects from all connections.
+ */
+void purple_connections_disconnect_all(void);
+
+/**
* Returns a list of all connections in the process of connecting.
*
* @constreturn A list of connecting connections.
*/
GList *purple_connections_get_connecting(void);
+#endif
/**
* Checks if gc is still a valid pointer to a gc.
@@ -556,6 +558,7 @@ GList *purple_connections_get_connecting
/**************************************************************************/
/*@{*/
+#if 0
/**
* Sets the UI operations structure to be used for connections.
*
@@ -569,6 +572,7 @@ PurpleConnectionUiOps *purple_connection
* @return The UI operations structure in use.
*/
PurpleConnectionUiOps *purple_connections_get_ui_ops(void);
+#endif
/*@}*/
============================================================
--- libpurple/core.c e9b3397198dbde5e6dacea354988f6515bb0d6d2
+++ libpurple/core.c 14f9f61417af58bf33e856076fa115197042610b
@@ -187,7 +187,9 @@ purple_core_quit(void)
purple_signal_emit(purple_get_core(), "quitting");
/* Transmission ends */
+#if 0
purple_connections_disconnect_all();
+#endif
/* Save .xml files, remove signals, etc. */
purple_idle_uninit();
============================================================
--- libpurple/network.c 86079b9237ff9b29de277648ee46bb9f1b3483d1
+++ libpurple/network.c 801c63dfa6b4d7002379f6d3e8748162af5d3809
@@ -504,8 +504,11 @@ static gboolean wpurple_network_change_t
static gboolean wpurple_network_change_thread_cb(gpointer data)
{
gint new_count;
+#if 0
PurpleConnectionUiOps *ui_ops = purple_connections_get_ui_ops();
-
+#else
+ PurpleConnectionUiOps *ui_ops = NULL;
+#endif
new_count = wpurple_get_connected_network_count();
if (new_count < 0)
@@ -616,7 +619,11 @@ nm_callback_func(libnm_glib_ctx* ctx, gp
{
static libnm_glib_state prev = LIBNM_NO_DBUS;
libnm_glib_state current;
+#if 0
PurpleConnectionUiOps *ui_ops = purple_connections_get_ui_ops();
+#else
+ PurpleConnectionUiOps *ui_ops = NULL;
+#endif
current = libnm_glib_get_network_state(ctx);
purple_debug_info("network","Entering nm_callback_func!\n");
More information about the Commits
mailing list