/soc/2013/ankitkv/gobjectification: 7d9d0d7b7b62: Merged default...
Ankit Vani
a at nevitus.org
Fri Aug 16 20:39:24 EDT 2013
Changeset: 7d9d0d7b7b62ab6d90bed20241a0962cdfd036af
Author: Ankit Vani <a at nevitus.org>
Date: 2013-08-17 06:01 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/7d9d0d7b7b62
Description:
Merged default branch
diffstat:
libpurple/core.c | 25 ++++++
libpurple/dbus-server.c | 5 +-
libpurple/debug.c | 32 +++++++-
libpurple/debug.h | 7 +
libpurple/keyring.c | 4 +-
libpurple/prefs.c | 5 +-
libpurple/protocols/jabber/data.c | 6 +-
libpurple/protocols/jabber/jabber.c | 4 +-
libpurple/protocols/mxit/mxit.c | 4 -
libpurple/protocols/myspace/myspace.c | 2 -
libpurple/protocols/sametime/sametime.c | 17 +---
libpurple/util.c | 4 +-
libpurple/xmlnode.c | 2 +-
pidgin/gtkmain.c | 10 +-
pidgin/gtkprefs.c | 20 +++--
pidgin/gtksession.c | 24 ++++-
pidgin/gtkwebview.c | 63 ++++++++++++++-
pidgin/gtkwebviewtoolbar.c | 9 ++
pidgin/plugins/webkit.c | 126 +------------------------------
19 files changed, 190 insertions(+), 179 deletions(-)
diffs (truncated from 810 to 300 lines):
diff --git a/libpurple/core.c b/libpurple/core.c
--- a/libpurple/core.c
+++ b/libpurple/core.c
@@ -77,6 +77,29 @@ static PurpleCore *_core = NULL;
STATIC_PROTO_INIT
+static void
+purple_core_print_version(void)
+{
+ GHashTable *ui_info = purple_core_get_ui_info();
+ const gchar *ui_name;
+ const gchar *ui_version;
+ gchar *ui_full_name = NULL;
+
+ ui_name = ui_info ? g_hash_table_lookup(ui_info, "name") : NULL;
+ ui_version = ui_info ? g_hash_table_lookup(ui_info, "version") : NULL;
+
+ if (ui_name) {
+ ui_full_name = g_strdup_printf("%s%s%s", ui_name,
+ ui_version ? " " : "", ui_version);
+ }
+
+ purple_debug_info("main", "Launching %s%slibpurple %s",
+ ui_full_name ? ui_full_name : "",
+ ui_full_name ? " with " : "",
+ purple_core_get_version());
+
+}
+
gboolean
purple_core_init(const char *ui)
{
@@ -121,6 +144,8 @@ purple_core_init(const char *ui)
purple_signal_register(core, "core-initialized", purple_marshal_VOID,
G_TYPE_NONE, 0);
+ purple_core_print_version();
+
/* The prefs subsystem needs to be initialized before static protocols
* for protocol prefs to work. */
purple_prefs_init();
diff --git a/libpurple/dbus-server.c b/libpurple/dbus-server.c
--- a/libpurple/dbus-server.c
+++ b/libpurple/dbus-server.c
@@ -625,8 +625,6 @@ purple_dbus_dispatch_init(void)
dbus_connection_setup_with_g_main(purple_dbus_connection, NULL);
- purple_debug_misc("dbus", "okkk\n");
-
purple_signal_register(purple_dbus_get_handle(), "dbus-method-called",
purple_marshal_BOOLEAN__POINTER_POINTER,
G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_POINTER);
@@ -636,6 +634,9 @@ purple_dbus_dispatch_init(void)
G_TYPE_POINTER); /* pointer to a pointer */
PURPLE_DBUS_REGISTER_BINDINGS(purple_dbus_get_handle());
+
+ if (purple_debug_is_verbose())
+ purple_debug_misc("dbus", "initialized");
}
diff --git a/libpurple/debug.c b/libpurple/debug.c
--- a/libpurple/debug.c
+++ b/libpurple/debug.c
@@ -50,6 +50,8 @@ static gboolean debug_enabled = FALSE;
static gboolean debug_verbose = FALSE;
static gboolean debug_unsafe = FALSE;
+static gboolean debug_colored = FALSE;
+
static void
purple_debug_vargs(PurpleDebugLevel level, const char *category,
const char *format, va_list args)
@@ -67,20 +69,40 @@ purple_debug_vargs(PurpleDebugLevel leve
return;
arg_s = g_strdup_vprintf(format, args);
+ g_strchomp(arg_s); /* strip trailing linefeeds */
if (debug_enabled) {
gchar *ts_s;
const char *mdate;
time_t mtime = time(NULL);
+ const gchar *format_pre, *format_post;
+ format_pre = "";
+ format_post = "";
+
+ if (!debug_colored)
+ format_pre = "";
+ else if (level == PURPLE_DEBUG_MISC)
+ format_pre = "\033[0;37m";
+ else if (level == PURPLE_DEBUG_INFO)
+ format_pre = "";
+ else if (level == PURPLE_DEBUG_WARNING)
+ format_pre = "\033[0;33m";
+ else if (level == PURPLE_DEBUG_ERROR)
+ format_pre = "\033[1;31m";
+ else if (level == PURPLE_DEBUG_FATAL)
+ format_pre = "\033[1;33;41m";
+
+ if (format_pre[0] != '\0')
+ format_post = "\033[0m";
mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime));
ts_s = g_strdup_printf("(%s) ", mdate);
if (category == NULL)
- g_print("%s%s", ts_s, arg_s);
+ g_print("%s%s%s%s\n", format_pre, ts_s, arg_s, format_post);
else
- g_print("%s%s: %s", ts_s, category, arg_s);
+ g_print("%s%s%s: %s%s\n", format_pre, ts_s, category, arg_s, format_post);
g_free(ts_s);
}
@@ -207,6 +229,12 @@ purple_debug_set_unsafe(gboolean unsafe)
debug_unsafe = unsafe;
}
+void
+purple_debug_set_colored(gboolean colored)
+{
+ debug_colored = colored;
+}
+
PurpleDebugUiOps *
purple_debug_get_ui_ops(void)
{
diff --git a/libpurple/debug.h b/libpurple/debug.h
--- a/libpurple/debug.h
+++ b/libpurple/debug.h
@@ -189,6 +189,13 @@ void purple_debug_set_unsafe(gboolean un
*/
gboolean purple_debug_is_unsafe(void);
+/**
+ * Enable or disable colored output for bash console.
+ *
+ * @param colored TRUE to enable colored output, FALSE to disable it.
+ */
+void purple_debug_set_colored(gboolean colored);
+
/*@}*/
/**************************************************************************/
diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -478,8 +478,8 @@ purple_keyring_register(PurpleKeyring *k
/* If this is the configured keyring, use it. */
if (purple_keyring_inuse == NULL &&
g_strcmp0(keyring_id, purple_keyring_to_use) == 0) {
- purple_debug_info("keyring", "Keyring %s matches keyring to "
- "use, using it.\n", keyring_id);
+ purple_debug_misc("keyring", "Keyring %s matches keyring to "
+ "use, using it.", keyring_id);
purple_keyring_set_inuse(keyring, TRUE, NULL, NULL);
}
diff --git a/libpurple/prefs.c b/libpurple/prefs.c
--- a/libpurple/prefs.c
+++ b/libpurple/prefs.c
@@ -386,7 +386,7 @@ purple_prefs_load()
return FALSE;
}
- purple_debug_info("prefs", "Reading %s\n", filename);
+ purple_debug_misc("prefs", "Reading %s", filename);
if(!g_file_get_contents(filename, &contents, &length, &error)) {
#ifdef _WIN32
@@ -438,7 +438,8 @@ purple_prefs_load()
return FALSE;
}
- purple_debug_info("prefs", "Finished reading %s\n", filename);
+ if (purple_debug_is_verbose())
+ purple_debug_misc("prefs", "Finished reading %s", filename);
g_markup_parse_context_free(context);
g_free(contents);
g_free(filename);
diff --git a/libpurple/protocols/jabber/data.c b/libpurple/protocols/jabber/data.c
--- a/libpurple/protocols/jabber/data.c
+++ b/libpurple/protocols/jabber/data.c
@@ -437,7 +437,8 @@ jabber_data_parse(JabberStream *js, cons
void
jabber_data_init(void)
{
- purple_debug_info("jabber", "creating hash tables for data objects\n");
+ if (purple_debug_is_verbose())
+ purple_debug_misc("jabber", "creating hash tables for data objects");
local_data_by_alt = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, NULL);
local_data_by_cid = g_hash_table_new_full(g_str_hash, g_str_equal,
@@ -451,7 +452,8 @@ jabber_data_init(void)
void
jabber_data_uninit(void)
{
- purple_debug_info("jabber", "destroying hash tables for data objects\n");
+ if (purple_debug_is_verbose())
+ purple_debug_info("jabber", "destroying hash tables for data objects");
g_hash_table_destroy(local_data_by_alt);
g_hash_table_destroy(local_data_by_cid);
g_hash_table_destroy(remote_data_by_cid);
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -658,7 +658,7 @@ jabber_recv_cb_ssl(gpointer data, Purple
while((len = purple_ssl_read(gsc, buf, sizeof(buf) - 1)) > 0) {
purple_connection_update_last_received(gc);
buf[len] = '\0';
- purple_debug_info("jabber", "Recv (ssl)(%d): %s\n", len, buf);
+ purple_debug_misc("jabber", "Recv (ssl)(%d): %s", len, buf);
jabber_parser_process(js, buf, len);
if(js->reinit)
jabber_stream_init(js);
@@ -718,7 +718,7 @@ jabber_recv_cb(gpointer data, gint sourc
}
#endif
buf[len] = '\0';
- purple_debug_info("jabber", "Recv (%d): %s\n", len, buf);
+ purple_debug_misc("jabber", "Recv (%d): %s", len, buf);
jabber_parser_process(js, buf, len);
if(js->reinit)
jabber_stream_init(js);
diff --git a/libpurple/protocols/mxit/mxit.c b/libpurple/protocols/mxit/mxit.c
--- a/libpurple/protocols/mxit/mxit.c
+++ b/libpurple/protocols/mxit/mxit.c
@@ -487,8 +487,6 @@ static void mxit_free_buddy( PurpleBuddy
{
struct contact* contact;
- purple_debug_info( MXIT_PLUGIN_ID, "mxit_free_buddy\n" );
-
contact = purple_buddy_get_protocol_data( buddy );
if ( contact ) {
if ( contact->statusMsg )
@@ -844,8 +842,6 @@ static void init_plugin( PurplePlugin* p
{
PurpleAccountOption* option;
- purple_debug_info( MXIT_PLUGIN_ID, "Loading MXit libPurple plugin...\n" );
-
/* Configuration options */
/* WAP server (reference: "libpurple/accountopt.h") */
diff --git a/libpurple/protocols/myspace/myspace.c b/libpurple/protocols/myspace/myspace.c
--- a/libpurple/protocols/myspace/myspace.c
+++ b/libpurple/protocols/myspace/myspace.c
@@ -456,8 +456,6 @@ msim_status_types(PurpleAccount *acct)
GList *types;
PurpleStatusType *status;
- purple_debug_info("myspace", "returning status types\n");
-
types = NULL;
/* Statuses are almost all the same. Define a macro to reduce code repetition. */
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -5174,7 +5174,7 @@ static PurplePluginProtocolInfo mw_prpl_
NULL
};
-
+#if 0
static PurplePluginPrefFrame *
mw_plugin_get_plugin_pref_frame(PurplePlugin *plugin) {
PurplePluginPrefFrame *frame;
@@ -5203,18 +5203,7 @@ mw_plugin_get_plugin_pref_frame(PurplePl
return frame;
}
-
-
-static PurplePluginUiInfo mw_plugin_ui_info = {
- mw_plugin_get_plugin_pref_frame,
- 0, /* page_num */
- NULL, /* frame */
- NULL,
- NULL,
- NULL,
- NULL
-};
-
+#endif
static void st_import_action_cb(PurpleConnection *gc, char *filename) {
struct mwSametimeList *l;
@@ -5718,7 +5707,7 @@ static PurplePluginInfo mw_plugin_info =
NULL, /**< ui_info */
&mw_prpl_info, /**< extra_info */
- &mw_plugin_ui_info, /**< prefs_info */
+ NULL, /**< prefs_info */
More information about the Commits
mailing list