pidgin/quail/qpurple

Setup basic debugging information to check what is happening in QPurpleCore
  • +23 -13
    qpurple.cpp
  • +1 -1
    qpurple.h
  • --- 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 <QMap>
    +#include <QDebug>
    +
    #include "qpurple.h"
    #include "qpurpleionotifier.h"
    #include "qpurpletimer.h"
    namespace QPurple {
    -// 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
    +/* Event loop functions */
    guint
    QPurpleCore::qpurple_input_add(gint fd,
    PurpleInputCondition condition,
    @@ -24,8 +26,8 @@
    closure->function = function;
    closure->data = data;
    - // 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);
    return handle;
    @@ -57,15 +59,17 @@
    GSourceFunc function,
    gpointer data)
    {
    + qDebug() << "qpurple_timer_add_seconds()";
    return qpurple_timer_add(interval * 1000,function, data);
    }
    gboolean
    QPurpleCore::qpurple_timer_remove(guint handle)
    {
    + qDebug() << "qpurple_timer_remove()";
    int toReturn = 0;
    QPurpleTimer *tmp = timerMap.take(handle);
    - if (!tmp->defaultConstructed) { // we removed something
    + if (!tmp->defaultConstructed) { /* we removed something */
    toReturn = 1;
    delete tmp; }
    @@ -95,6 +99,7 @@
    PurpleMessageFlags flags,
    time_t mtime)
    {
    + qDebug() << "qpurple_write_conv()";
    Q_UNUSED(alias)
    Q_UNUSED(flags)
    printf("(%s) %s %s: %s\n", purple_conversation_get_name(conv),
    @@ -128,6 +133,7 @@
    void
    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,
    - NULL,
    + NULL, /* ui_prefs_init */
    + NULL, /* debug_ui_init */
    &QPurpleCore::qpurple_ui_init,
    - NULL,
    + NULL, /* quit */
    + NULL, /* get_ui_info */
    /* padding */
    NULL,
    NULL,
    - NULL,
    NULL
    };
    void
    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";
    fprintf(stderr,
    "libpurple initialization failed. Dumping core.\n"
    "Please report this!\n");
    @@ -203,6 +211,8 @@
    void
    QPurpleCore::qpurple_init() {
    + qDebug() << "qpurple_init()";
    + emit signalDebugMessages("qpurple_init()");
    QPurpleCore::_init_libpurple();
    }
    --- a/qpurple.h Tue Jun 18 14:13:39 2013 +0100
    +++ b/qpurple.h Tue Jun 18 15:43:26 2013 +0100
    @@ -62,7 +62,7 @@
    signals:
    -
    + void signalDebugMessages(QString msg);
    private:
    static void _init_libpurple(void);