--- a/qpurple.cpp Tue Jun 18 14:13:39 2013 +0100
+++ b/qpurple.cpp Tue Jun 18 15:43:26 2013 +0100
@@ -1,17 +1,19 @@
#include "qpurpleionotifier.h"
#include "qpurpletimer.h"
-// unique handle for our input events (QPurpleIONotifiers and QPurpleTimers)
+/* unique handle for our input events (QPurpleIONotifiers and QPurpleTimers) */ unsigned int unique_handle = 0;
QMap< int , QPurpleIONotifier* > notifierMap;
QMap< int , QPurpleTimer* > timerMap;
+/* Event loop functions */ QPurpleCore::qpurple_input_add(gint fd,
PurpleInputCondition condition,
@@ -24,8 +26,8 @@
closure->function = function;
- // modified from the nullclient source to integrate with Qt
- handle = unique_handle++; // this will be unique, certainly
+ /* modified from the nullclient source to integrate with Qt */ + handle = unique_handle++; /* this will be unique, certainly */ notifierMap[handle] = new QPurpleIONotifier(fd, closure, condition);
@@ -57,15 +59,17 @@
+ qDebug() << "qpurple_timer_add_seconds()"; return qpurple_timer_add(interval * 1000,function, data);
QPurpleCore::qpurple_timer_remove(guint handle)
+ qDebug() << "qpurple_timer_remove()"; QPurpleTimer *tmp = timerMap.take(handle);
- if (!tmp->defaultConstructed) { // we removed something
+ if (!tmp->defaultConstructed) { /* we removed something */ @@ -95,6 +99,7 @@
PurpleMessageFlags flags,
+ qDebug() << "qpurple_write_conv()"; printf("(%s) %s %s: %s\n", purple_conversation_get_name(conv),
@@ -128,6 +133,7 @@
QPurpleCore::qpurple_ui_init(void)
+ qDebug() << "qpurple_ui_init()"; * This should initialize the UI components for all the modules. Here we
* just initialize the UI for conversations.
@@ -137,21 +143,22 @@
static PurpleCoreUiOps qpurple_core_uiops =
+ NULL, /* ui_prefs_init */ + NULL, /* debug_ui_init */ &QPurpleCore::qpurple_ui_init,
+ NULL, /* get_ui_info */
QPurpleCore::_init_libpurple(void)
+ qDebug() << "_init_libpurple()"; /* Set a custom user directory (optional) */
purple_util_set_user_dir(CUSTOM_USER_DIRECTORY);
@@ -165,11 +172,11 @@
* - uninitialize the ui components for all the modules when the core terminates.
purple_core_set_ui_ops(&qpurple_core_uiops);
- /* Set the uiops for the eventloop. If your client is glib-based, you can safely
- * copy this verbatim. */
+ qDebug() << "qpurple_init().purple_core_set_ui_ops"; + /* Set the uiops for the eventloop. If your client is glib-based, + * you can safely copy this verbatim. */ purple_eventloop_set_ui_ops(&qpurple_eventloops);
+ qDebug() << "qpurple_init().purple_eventloop_set_ui_ops"; /* Set path to search for plugins. The core (libpurple) takes care of loading the
* core-plugins, which includes the protocol-plugins. So it is not essential to add
* any path here, but it might be desired, especially for ui-specific plugins. */
@@ -180,6 +187,7 @@
* is used by stuff that depends on this ui, for example the ui-specific plugins. */
if (!purple_core_init(UI_ID)) {
/* Initializing the core failed. Terminate. */
+ qDebug() << "qpurple_init() Initializing the core failed. Terminate"; "libpurple initialization failed. Dumping core.\n"
"Please report this!\n");
@@ -203,6 +211,8 @@
QPurpleCore::qpurple_init() {
+ qDebug() << "qpurple_init()"; + emit signalDebugMessages("qpurple_init()"); QPurpleCore::_init_libpurple();