cpw.nader.asynclogging-3: 7ce90c0f: Cleaned up variable / type names in gtkl..
morshed.nader at gmail.com
morshed.nader at gmail.com
Sun Jan 8 01:21:26 EST 2012
----------------------------------------------------------------------
Revision: 7ce90c0f4577f787f7e88577fe383b0c1d3fd597
Parent: 9069247967495c487054ab7bf69932cb453eca33
Author: morshed.nader at gmail.com
Date: 01/07/12 14:10:43
Branch: im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/7ce90c0f4577f787f7e88577fe383b0c1d3fd597
Changelog:
Cleaned up variable / type names in gtklog.c
Changes against parent 9069247967495c487054ab7bf69932cb453eca33
patched pidgin/gtklog.c
-------------- next part --------------
============================================================
--- pidgin/gtklog.c ecef243cdae5e1956614fbfba5a9f63bd3f7cc2e
+++ pidgin/gtklog.c 26526e7bc556b35b81a484652e1113d339401b12
@@ -142,16 +142,16 @@ typedef struct {
guint count;
guint total;
-} _pidgin_log_data;
+} pidgin_log_data;
typedef struct {
- _pidgin_log_data *log_data;
+ pidgin_log_data *log_data;
GtkMenuPositionFunc func;
GtkTreeIter *iter;
} log_menu_callback_data;
typedef struct {
- _pidgin_log_data *log_data;
+ pidgin_log_data *log_data;
GtkTreeIter *iter;
guint destroy_handler_id;
} log_delete_callback_data;
@@ -165,7 +165,7 @@ typedef struct {
/* Prototypes */
-static void pidgin_window_destroy_cb(_pidgin_log_data *);
+static void pidgin_window_destroy_cb(pidgin_log_data *);
static guint log_viewer_hash(gconstpointer);
static gboolean log_viewer_equal(gconstpointer, gconstpointer);
static void select_first_log(PidginLogViewer *);
@@ -191,9 +191,9 @@ static void insert_log_viewer_log(Pidgin
static PidginLogViewer *pidgin_log_viewer_new(log_viewer_hash_t *,
const gchar *, GtkWidget *, gboolean);
static void insert_log_viewer_log(PidginLogViewer *, PurpleLog *);
-static void pidgin_log_done_cb(_pidgin_log_data *);
-static void pidgin_log_viewer_update_list_bar(_pidgin_log_data *);
-static void pidgin_log_viewer_update_search_bar(_pidgin_log_data *);
+static void pidgin_log_done_cb(pidgin_log_data *);
+static void pidgin_log_viewer_update_list_bar(pidgin_log_data *);
+static void pidgin_log_viewer_update_search_bar(pidgin_log_data *);
static void pidgin_log_size_cb(GObject *, GAsyncResult *, gpointer);
static void pidgin_log_list_cb(GObject *, GAsyncResult *, gpointer);
static void pidgin_log_system_list_cb(GObject *, GAsyncResult *, gpointer);
@@ -211,7 +211,7 @@ static void
/* Main functions */
static void
-pidgin_log_data_free(_pidgin_log_data *data)
+pidgin_log_data_free(pidgin_log_data *data)
{
if (data->destroy_handler_id > 0)
g_signal_handler_disconnect(data->log_viewer,
@@ -222,7 +222,7 @@ static void
}
static void
-pidgin_window_destroy_cb(_pidgin_log_data *data)
+pidgin_window_destroy_cb(pidgin_log_data *data)
{
data->destroy_handler_id = 0;
data->is_window_open = FALSE;
@@ -300,14 +300,14 @@ static void
}
static void
-pidgin_log_search_done_cb(_pidgin_log_data *pidgin_log_data)
+pidgin_log_search_done_cb(pidgin_log_data *data)
{
- if (pidgin_log_data->is_window_open) {
- PidginLogViewer *lv = pidgin_log_data->log_viewer;
+ if (data->is_window_open) {
+ PidginLogViewer *lv = data->log_viewer;
PidginLogViewerPrivate *priv = PIDGIN_LOG_VIEWER_GET_PRIVATE(lv);
if (priv->search == NULL ||
- purple_strequal(priv->search, pidgin_log_data->string))
+ purple_strequal(priv->search, data->string))
{
if (!priv->selected)
select_first_log(lv);
@@ -316,13 +316,13 @@ pidgin_log_search_done_cb(_pidgin_log_da
}
}
- pidgin_log_data_free(pidgin_log_data);
+ pidgin_log_data_free(data);
}
static void
pidgin_log_search_cb(GObject *object, GAsyncResult *res, gpointer userdata)
{
- _pidgin_log_data *data = userdata;
+ pidgin_log_data *data = userdata;
GError *error = NULL;
GList *logs;
@@ -356,7 +356,7 @@ search_cb(GtkWidget *button, PidginLogVi
static void
search_cb(GtkWidget *button, PidginLogViewer *lv)
{
- _pidgin_log_data *data;
+ pidgin_log_data *data;
PidginLogViewerPrivate *priv = PIDGIN_LOG_VIEWER_GET_PRIVATE(lv);
WebKitWebView *wv = WEBKIT_WEB_VIEW(pidgin_log_viewer_get_text_area(lv));
GtkWidget *bar;
@@ -399,7 +399,7 @@ search_cb(GtkWidget *button, PidginLogVi
webkit_web_view_open(wv, "about:blank"); /* clear the view */
pidgin_log_viewer_set_selected(lv, FALSE);
- data = g_new0(_pidgin_log_data, 1);
+ data = g_new0(pidgin_log_data, 1);
data->is_window_open = TRUE;
data->log_viewer = lv;
data->string = g_strdup(search_term);
@@ -621,24 +621,24 @@ static void
}
static void
-log_menu_callback_data_free(log_menu_callback_data *data)
+log_menu_callback_data_free(log_menu_callback_data *callback_data)
{
- _pidgin_log_data *pidgin_log_data = data->log_data;
+ pidgin_log_data *data = callback_data->log_data;
pidgin_log_data->count--;
if (pidgin_log_data->count < 1)
pidgin_log_data_free(pidgin_log_data);
- g_free(data->iter);
- g_free(data);
+ g_free(callback_data->iter);
+ g_free(callback_data);
}
static void
log_show_popup_menu(GdkEventButton *event, log_menu_callback_data *data)
{
- _pidgin_log_data *pidgin_log_data = data->log_data;
- PidginLogViewer *lv = pidgin_log_data->log_viewer;
+ pidgin_log_data *data = data->log_data;
+ PidginLogViewer *lv = data->log_viewer;
GtkWidget *menu, *menuitem;
menu = gtk_menu_new();
@@ -653,10 +653,10 @@ log_show_popup_menu(GdkEventButton *even
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
gtk_widget_show_all(menu);
- pidgin_log_data->count = 1;
- pidgin_log_data->is_window_open = TRUE;
- pidgin_log_data->destroy_handler_id = g_signal_connect_swapped(lv,
- "destroy", G_CALLBACK(pidgin_window_destroy_cb), pidgin_log_data);
+ data->count = 1;
+ data->is_window_open = TRUE;
+ data->destroy_handler_id = g_signal_connect_swapped(lv,
+ "destroy", G_CALLBACK(pidgin_window_destroy_cb), data);
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, data->func, NULL,
event != NULL ? event->button : 0,
@@ -693,7 +693,7 @@ log_button_press_cb(GtkTreeView *treevie
}
data = g_new(log_menu_callback_data, 1);
- data->log_data = g_new0(_pidgin_log_data, 1);
+ data->log_data = g_new0(pidgin_log_data, 1);
data->log_data->log_viewer = lv;
data->log_data->log = log;
data->func = NULL;
@@ -732,7 +732,7 @@ log_popup_menu_cb(GtkTreeView *treeview,
}
data = g_new(log_menu_callback_data, 1);
- data->log_data = g_new0(_pidgin_log_data, 1);
+ data->log_data = g_new0(pidgin_log_data, 1);
data->log_data->log_viewer = lv;
data->log_data->log = log;
data->func = pidgin_treeview_popup_menu_position_func;
@@ -746,9 +746,9 @@ search_find_cb(gpointer userdata)
static gboolean
search_find_cb(gpointer userdata)
{
- _pidgin_log_data *pidgin_log_data = userdata;
- if (pidgin_log_data->is_window_open) {
- PidginLogViewer *lv = pidgin_log_data->log_viewer;
+ pidgin_log_data *data = userdata;
+ if (data->is_window_open) {
+ PidginLogViewer *lv = data->log_viewer;
WebKitWebView *wv = WEBKIT_WEB_VIEW(pidgin_log_viewer_get_text_area(lv));
const gchar *search = pidgin_log_viewer_get_search_string(lv);
@@ -757,7 +757,7 @@ search_find_cb(gpointer userdata)
webkit_web_view_search_text(wv, search, FALSE, TRUE, TRUE);
}
- pidgin_log_data_free(pidgin_log_data);
+ pidgin_log_data_free(data);
return FALSE;
}
@@ -765,7 +765,7 @@ pidgin_log_read_cb(GObject *object, GAsy
static void
pidgin_log_read_cb(GObject *object, GAsyncResult *res, gpointer userdata)
{
- _pidgin_log_data *data = userdata;
+ pidgin_log_data *data = userdata;
if (data->is_window_open) {
PurpleLog *log = data->log;
@@ -830,7 +830,7 @@ log_select_cb(GtkTreeSelection *sel, Pid
static void
log_select_cb(GtkTreeSelection *sel, PidginLogViewer *lv)
{
- _pidgin_log_data *data;
+ pidgin_log_data *data;
PurpleLog *log = NULL;
PurpleLogChatType chat_type;
GtkTreeModel *model = GTK_TREE_MODEL(pidgin_log_viewer_get_tree_store(lv));
@@ -870,7 +870,7 @@ log_select_cb(GtkTreeSelection *sel, Pid
}
wv = WEBKIT_WEB_VIEW(pidgin_log_viewer_get_text_area(lv));
- data = g_new0(_pidgin_log_data, 1);
+ data = g_new0(pidgin_log_data, 1);
data->is_window_open = TRUE;
data->total = data->count = 1;
webkit_web_view_open(wv, "about:blank");
@@ -1069,10 +1069,10 @@ static void
}
static void
-pidgin_log_done_cb(_pidgin_log_data *pidgin_log_data)
+pidgin_log_done_cb(pidgin_log_data *data)
{
- if (pidgin_log_data->is_window_open) {
- PidginLogViewer *lv = pidgin_log_data->log_viewer;
+ if (data->is_window_open) {
+ PidginLogViewer *lv = data->log_viewer;
GtkWidget *bar = pidgin_log_viewer_get_list_bar(lv);
GList *logs = pidgin_log_viewer_get_logs(lv);
@@ -1106,49 +1106,49 @@ pidgin_log_done_cb(_pidgin_log_data *pid
select_first_log(lv);
}
- pidgin_log_data_free(pidgin_log_data);
+ pidgin_log_data_free(data);
}
static void
-pidgin_log_viewer_update_list_bar(_pidgin_log_data *pidgin_log_data)
+pidgin_log_viewer_update_list_bar(pidgin_log_data *data)
{
- PidginLogViewer *lv = pidgin_log_data->log_viewer;
+ PidginLogViewer *lv = data->log_viewer;
GtkWidget *bar = pidgin_log_viewer_get_list_bar(lv);
gdouble fraction;
- fraction = (gdouble) pidgin_log_data->count /
- (gdouble) pidgin_log_data->total;
+ fraction = (gdouble) data->count /
+ (gdouble) data->total;
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar), 1.0 - fraction);
}
static void
-pidgin_log_viewer_update_search_bar(_pidgin_log_data *pidgin_log_data)
+pidgin_log_viewer_update_search_bar(pidgin_log_data *data)
{
- PidginLogViewer *lv = pidgin_log_data->log_viewer;
+ PidginLogViewer *lv = data->log_viewer;
GtkWidget *bar = pidgin_log_viewer_get_search_bar(lv);
gdouble fraction;
- fraction = (gdouble) pidgin_log_data->count /
- (gdouble) pidgin_log_data->total;
+ fraction = (gdouble) data->count /
+ (gdouble) data->total;
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar), 1.0 - fraction);
}
static void
pidgin_log_size_cb(GObject *object, GAsyncResult *res, gpointer userdata)
{
- _pidgin_log_data *pidgin_log_data = userdata;
+ pidgin_log_data *data = userdata;
GError *error = NULL;
gssize log_size;
log_size = purple_logs_total_size_finish(res, &error);
- pidgin_log_data->count--;
+ data->count--;
if (log_size < 0) {
if (error->code != G_IO_ERROR_CANCELLED)
purple_debug_error("gtklog", "Error getting total log size: %s\n",
error->message);
- } else if (pidgin_log_data->is_window_open) {
- PidginLogViewer *lv = pidgin_log_data->log_viewer;
+ } else if (data->is_window_open) {
+ PidginLogViewer *lv = data->log_viewer;
gsize total;
total = pidgin_log_viewer_get_total_size(lv);
@@ -1158,64 +1158,64 @@ pidgin_log_size_cb(GObject *object, GAsy
g_clear_error(&error);
- if (pidgin_log_data->is_window_open)
- pidgin_log_viewer_update_list_bar(pidgin_log_data);
+ if (data->is_window_open)
+ pidgin_log_viewer_update_list_bar(data);
- if (pidgin_log_data->count < 1)
- pidgin_log_done_cb(pidgin_log_data);
+ if (data->count < 1)
+ pidgin_log_done_cb(data);
}
static void
pidgin_log_list_cb(GObject *object, GAsyncResult *res, gpointer userdata)
{
- _pidgin_log_data *pidgin_log_data = userdata;
+ pidgin_log_data *data = userdata;
GError *error = NULL;
GList *list;
list = purple_logs_list_finish(res, &error);
if (list == NULL) {
- pidgin_log_data->count--;
+ data->count--;
if (error != NULL && error->code != G_IO_ERROR_CANCELLED)
purple_debug_error("gtklog", "Error getting logs: %s\n",
error->message);
- } else if (pidgin_log_data->is_window_open)
- pidgin_log_viewer_add_logs(pidgin_log_data->log_viewer, list);
+ } else if (data->is_window_open)
+ pidgin_log_viewer_add_logs(data->log_viewer, list);
g_clear_error(&error);
- if (pidgin_log_data->is_window_open)
- pidgin_log_viewer_update_list_bar(pidgin_log_data);
+ if (data->is_window_open)
+ pidgin_log_viewer_update_list_bar(data);
- if (pidgin_log_data->count < 1)
- pidgin_log_done_cb(pidgin_log_data);
+ if (data->count < 1)
+ pidgin_log_done_cb(data);
}
static void
pidgin_log_system_list_cb(GObject *object, GAsyncResult *res, gpointer userdata)
{
- _pidgin_log_data *pidgin_log_data = userdata;
+ pidgin_log_data *data = userdata;
GError *error = NULL;
GList *list;
list = purple_logs_list_finish(res, &error);
if (list == NULL) {
- pidgin_log_data->count--;
+ data->count--;
if (error != NULL && error->code != G_IO_ERROR_CANCELLED)
purple_debug_error("gtklog", "Error getting system logs: %s\n",
error->message);
- } else if (pidgin_log_data->is_window_open)
- pidgin_log_viewer_add_logs(pidgin_log_data->log_viewer, list);
+ } else if (data->is_window_open)
+ pidgin_log_viewer_add_logs(data->log_viewer, list);
g_clear_error(&error);
- if (pidgin_log_data->is_window_open)
- pidgin_log_viewer_update_list_bar(pidgin_log_data);
+ if (data->is_window_open)
+ pidgin_log_viewer_update_list_bar(data);
- if (pidgin_log_data->count < 1)
- pidgin_log_done_cb(pidgin_log_data);
+ if (data->count < 1)
+ pidgin_log_done_cb(data);
}
void
@@ -1223,7 +1223,7 @@ pidgin_log_show(PurpleLogChatType chat_t
PurpleAccount *account)
{
log_viewer_hash_t *ht;
- _pidgin_log_data *data;
+ pidgin_log_data *data;
PidginLogViewer *lv;
PidginLogViewerPrivate *priv;
GdkPixbuf *prpl_icon;
@@ -1271,7 +1271,7 @@ pidgin_log_show(PurpleLogChatType chat_t
title = g_strdup_printf(_("Conversations with %s"), name);
}
- data = g_new0(_pidgin_log_data, 1);
+ data = g_new0(pidgin_log_data, 1);
data->is_window_open = TRUE;
data->total = data->count = 2;
@@ -1308,7 +1308,7 @@ pidgin_log_show_contact(PurpleContact *c
pidgin_log_show_contact(PurpleContact *contact)
{
log_viewer_hash_t *ht;
- _pidgin_log_data *data;
+ pidgin_log_data *data;
PurpleBlistNode *child;
PidginLogViewer *lv;
PidginLogViewerPrivate *priv;
@@ -1365,7 +1365,7 @@ pidgin_log_show_contact(PurpleContact *c
name = "";
}
- data = g_new0(_pidgin_log_data, 1);
+ data = g_new0(pidgin_log_data, 1);
data->is_window_open = TRUE;
data->count = data->total = 0;
@@ -1419,7 +1419,7 @@ pidgin_syslog_show(void)
void
pidgin_syslog_show(void)
{
- _pidgin_log_data *data;
+ pidgin_log_data *data;
PidginLogViewer *lv;
PidginLogViewerPrivate *priv;
GCancellable *cancel;
@@ -1433,7 +1433,7 @@ pidgin_syslog_show(void)
return;
}
- data = g_new0(_pidgin_log_data, 1);
+ data = g_new0(pidgin_log_data, 1);
data->is_window_open = TRUE;
data->count = data->total = 0;
More information about the Commits
mailing list