]> git.0d.be Git - empathy.git/commitdiff
Depend on telepathy-logger (#610956)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 18 Jun 2010 15:53:38 +0000 (17:53 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 18 Jun 2010 15:53:38 +0000 (17:53 +0200)
15 files changed:
configure.ac
libempathy-gtk/Makefile.am
libempathy-gtk/empathy-chat.c
libempathy-gtk/empathy-contact-menu.c
libempathy-gtk/empathy-log-window.c
libempathy/Makefile.am
libempathy/empathy-contact.c
libempathy/empathy-contact.h
libempathy/empathy-message.c
libempathy/empathy-message.h
nautilus-sendto-plugin/Makefile.am
src/Makefile.am
src/empathy.c
tests/Makefile.am
tests/interactive/Makefile.am

index d3b3b5c31b79c6d4832b7d8bc0a3ffd67dc2360e..edee9e07ea6c66dab730566d859b62331efad18a 100644 (file)
@@ -136,30 +136,6 @@ AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-d
 
 AC_SUBST(ERROR_CFLAGS)
 
-# -----------------------------------------------------------
-# Enable TPL
-# -----------------------------------------------------------
-
-# It needs to be defined before PKG_CHECK_MODULES calls
-AC_ARG_ENABLE(tpl,
-  AC_HELP_STRING([--enable-tpl],[enable telepathy-logger code and disable the
-    empathy logger]), enable_tpl=$enableval, enable_tpl=no )
-AM_CONDITIONAL(ENABLE_TPL, test "x$enable_tpl" = "xyes")
-
-if test x${enable_tpl} = xyes; then
-  AC_DEFINE(ENABLE_TPL, [], [Enable TPL code])
-fi
-
-if test "x$enable_tpl" = "xyes"; then
-  PKG_CHECK_MODULES(TPL,
-  [
-     telepathy-logger-0.1 >= $TELEPATHY_LOGGER
-  ])
-  AC_SUBST(TPL_CFLAGS)
-  AC_SUBST(TPL_LIBS)
-fi
-
-
 # -----------------------------------------------------------
 # Pkg-Config dependency checks
 # -----------------------------------------------------------
@@ -175,6 +151,7 @@ PKG_CHECK_MODULES(LIBEMPATHY,
    telepathy-farsight
    farsight2-0.10
    gstreamer-0.10
+   telepathy-logger-0.1 >= $TELEPATHY_LOGGER
 ])
 
 PKG_CHECK_MODULES(LIBEMPATHYGTK,
@@ -190,6 +167,7 @@ PKG_CHECK_MODULES(LIBEMPATHYGTK,
    farsight2-0.10
    gstreamer-0.10
    gstreamer-interfaces-0.10
+   telepathy-logger-0.1 >= $TELEPATHY_LOGGER
 ])
 
 PKG_CHECK_MODULES(EMPATHY,
@@ -207,6 +185,7 @@ PKG_CHECK_MODULES(EMPATHY,
    gstreamer-0.10
    unique-1.0 >= $UNIQUE_REQUIRED
    gnome-keyring-1 >= $KEYRING_REQUIRED
+   telepathy-logger-0.1 >= $TELEPATHY_LOGGER
 ])
 
 PKG_CHECK_MODULES(LIBEMPATHY_ACCOUNTS_PANEL,
@@ -221,6 +200,7 @@ PKG_CHECK_MODULES(LIBEMPATHY_ACCOUNTS_PANEL,
    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
    unique-1.0 >= $UNIQUE_REQUIRED
    gnome-keyring-1 >= $KEYRING_REQUIRED
+   telepathy-logger-0.1 >= $TELEPATHY_LOGGER
 ])
 
 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
@@ -584,9 +564,6 @@ Configure summary:
        Favourite contacts .........:  ${have_favourite_contacts}
        Control center embedding....:  ${have_control_center_embedding}
 
-    Logging:
-        Telepathy Logger............:  ${enable_tpl}
-
     Connectivity:
        NetworkManager integration..:  ${have_nm}
        ConnMan integration.........:  ${have_connman}
index c8a4cbb6a0d14c2825cc297e1af0f2842cfc1e5c..43763d56c0fb8ab24d126346ec18098ab9098ac7 100644 (file)
@@ -7,7 +7,6 @@ AM_CPPFLAGS =                                           \
        -DDATADIR=\""$(datadir)"\"                      \
        -DPKGDATADIR=\""$(pkgdatadir)"\"                \
        $(LIBEMPATHYGTK_CFLAGS)                         \
-       $(TPL_CFLAGS)                                   \
        $(LIBNOTIFY_CFLAGS)                             \
        $(ENCHANT_CFLAGS)                               \
        $(LIBCHAMPLAIN_CFLAGS)                          \
@@ -132,7 +131,6 @@ nodist_libempathy_gtk_la_SOURCES =\
 libempathy_gtk_la_LIBADD =                     \
        $(LIBEMPATHYGTK_LIBS)                   \
        $(LIBNOTIFY_LIBS)                       \
-       $(TPL_LIBS)                             \
        $(ENCHANT_LIBS)                         \
        $(LIBCHAMPLAIN_LIBS)                    \
        $(GEOCLUE_LIBS)                         \
index ffb2c512661ac01ba4a8b82a21803fdfc4aea218..9e69c733a2422e806e2b80942a64166c13964fcf 100644 (file)
 
 #include <telepathy-glib/account-manager.h>
 #include <telepathy-glib/util.h>
-#ifdef ENABLE_TPL
 #include <telepathy-logger/log-manager.h>
-#else
-
-#include <libempathy/empathy-log-manager.h>
-#endif /* ENABLE_TPL */
 #include <libempathy/empathy-contact-list.h>
 #include <libempathy/empathy-gsettings.h>
 #include <libempathy/empathy-utils.h>
@@ -80,11 +75,7 @@ typedef struct {
        GSettings         *gsettings_chat;
        GSettings         *gsettings_ui;
 
-#ifdef ENABLE_TPL
        TplLogManager     *log_manager;
-#else
-       EmpathyLogManager *log_manager;
-#endif /* ENABLE_TPL */
        TpAccountManager  *account_manager;
        GList             *input_history;
        GList             *input_history_current;
@@ -1930,43 +1921,28 @@ chat_input_populate_popup_cb (GtkTextView *view,
 }
 
 
-#ifdef ENABLE_TPL
 static gboolean
 chat_log_filter (TplEntry *log,
                 gpointer user_data)
-#else
-static gboolean
-chat_log_filter (EmpathyMessage *message,
-                gpointer user_data)
-#endif /* ENABLE_TPL */
 {
        EmpathyChat *chat = user_data;
-#ifdef ENABLE_TPL
        EmpathyMessage *message;
-#endif /* ENABLE_TPL */
        EmpathyChatPriv *priv = GET_PRIV (chat);
        const GList *pending;
 
-#ifdef ENABLE_TPL
        g_return_val_if_fail (TPL_IS_ENTRY (log), FALSE);
-#else
-       g_return_val_if_fail (EMPATHY_IS_MESSAGE (message), FALSE);
-#endif /* ENABLE_TPL */
        g_return_val_if_fail (EMPATHY_IS_CHAT (chat), FALSE);
 
        pending = empathy_tp_chat_get_pending_messages (priv->tp_chat);
-#ifdef ENABLE_TPL
        message = empathy_message_from_tpl_log_entry (log);
-#endif /* ENABLE_TPL */
 
        for (; pending; pending = g_list_next (pending)) {
                if (empathy_message_equal (message, pending->data)) {
                        return FALSE;
                }
        }
-#ifdef ENABLE_TPL
+
        g_object_unref (message);
-#endif
        return TRUE;
 }
 
@@ -1993,7 +1969,6 @@ show_pending_messages (EmpathyChat *chat) {
 }
 
 
-#ifdef ENABLE_TPL
 static void
 got_filtered_messages_cb (GObject *manager,
                GAsyncResult *result,
@@ -2039,17 +2014,12 @@ out:
        /* Turn back on scrolling */
        empathy_chat_view_scroll (chat->view, TRUE);
 }
-#endif /* ENABLE_TPL */
-
 
 static void
 chat_add_logs (EmpathyChat *chat)
 {
        EmpathyChatPriv *priv = GET_PRIV (chat);
        gboolean         is_chatroom;
-#ifndef ENABLE_TPL
-       GList           *messages, *l;
-#endif /* ENABLE_TPL */
 
        if (!priv->id) {
                return;
@@ -2061,25 +2031,6 @@ chat_add_logs (EmpathyChat *chat)
        /* Add messages from last conversation */
        is_chatroom = priv->handle_type == TP_HANDLE_TYPE_ROOM;
 
-#ifndef ENABLE_TPL
-       messages = empathy_log_manager_get_filtered_messages (priv->log_manager,
-                                                             priv->account,
-                                                             priv->id,
-                                                             is_chatroom,
-                                                             5,
-                                                             chat_log_filter,
-                                                             chat);
-
-       for (l = messages; l; l = g_list_next (l)) {
-               empathy_chat_view_append_message (chat->view, l->data);
-               g_object_unref (l->data);
-       }
-
-       g_list_free (messages);
-
-       /* Turn back on scrolling */
-       empathy_chat_view_scroll (chat->view, TRUE);
-#else
        priv->retrieving_backlogs = TRUE;
        tpl_log_manager_get_filtered_messages_async (priv->log_manager,
                                                              priv->account,
@@ -2090,7 +2041,6 @@ chat_add_logs (EmpathyChat *chat)
                                                              chat,
                                                              got_filtered_messages_cb,
                                                              (gpointer) chat);
-#endif /* ENABLE_TPL */
 }
 
 static gint
@@ -2724,12 +2674,6 @@ chat_constructed (GObject *object)
 
        if (priv->handle_type != TP_HANDLE_TYPE_ROOM)
                chat_add_logs (chat);
-#ifndef ENABLE_TPL
-       /* When async API are involved, pending message are shown at the end of the
-        * callbacks' chain fired by chat_add_logs */
-       priv->can_show_pending = TRUE;
-       show_pending_messages (chat);
-#endif /* ENABLE_TPL */
 }
 
 static void
@@ -2872,11 +2816,7 @@ empathy_chat_init (EmpathyChat *chat)
                EMPATHY_TYPE_CHAT, EmpathyChatPriv);
 
        chat->priv = priv;
-#ifndef ENABLE_TPL
-       priv->log_manager = empathy_log_manager_dup_singleton ();
-#else
        priv->log_manager = tpl_log_manager_dup_singleton ();
-#endif /* ENABLE_TPL */
        priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
        priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
 
index 9cc93b1914d101e66231794150eba3d8de0234cf..9ea19af32b24172b5a6a536d03e41d9618e029d6 100644 (file)
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
-#ifdef ENABLE_TPL
 #include <telepathy-logger/log-manager.h>
-#else
 
-#include <libempathy/empathy-log-manager.h>
-#endif /* ENABLE_TPL */
 #include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-contact-manager.h>
 #include <libempathy/empathy-dispatcher.h>
@@ -322,30 +318,19 @@ contact_log_menu_item_activate_cb (EmpathyContact *contact)
 GtkWidget *
 empathy_contact_log_menu_item_new (EmpathyContact *contact)
 {
-#ifndef ENABLE_TPL
-       EmpathyLogManager *manager;
-#else
        TplLogManager     *manager;
-#endif /* ENABLE_TPL */
        gboolean           have_log;
        GtkWidget         *item;
        GtkWidget         *image;
 
        g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
 
-#ifndef ENABLE_TPL
-       manager = empathy_log_manager_dup_singleton ();
-       have_log = empathy_log_manager_exists (manager,
-                                              empathy_contact_get_account (contact),
-                                              empathy_contact_get_id (contact),
-                                              FALSE);
-#else
        manager = tpl_log_manager_dup_singleton ();
        have_log = tpl_log_manager_exists (manager,
                                               empathy_contact_get_account (contact),
                                               empathy_contact_get_id (contact),
                                               FALSE);
-#endif /* ENABLE_TPL */
+
        g_object_unref (manager);
 
        item = gtk_image_menu_item_new_with_mnemonic (_("_Previous Conversations"));
index c60ca64b34b15122f8701273f1a7e73867dac4e8..04abd010217ada6feb770c245e1bc5ad0990f11b 100644 (file)
 #include <gtk/gtk.h>
 
 #include <telepathy-glib/account-manager.h>
-#ifdef ENABLE_TPL
 #include <telepathy-logger/log-manager.h>
-#endif /* ENABLE_TPL */
 
-#ifndef ENABLE_TPL
-#include <libempathy/empathy-log-manager.h>
-#endif /* ENABLE_TPL */
 #include <libempathy/empathy-chatroom-manager.h>
 #include <libempathy/empathy-chatroom.h>
 #include <libempathy/empathy-message.h>
@@ -76,11 +71,7 @@ typedef struct {
 
        gchar             *last_find;
 
-#ifndef ENABLE_TPL
-       EmpathyLogManager *log_manager;
-#else
        TplLogManager     *log_manager;
-#endif /* ENABLE_TPL */
 
        /* Those are only used while waiting for the account chooser to be ready */
        TpAccount         *selected_account;
@@ -215,11 +206,7 @@ empathy_log_window_show (TpAccount  *account,
        }
 
        window = g_new0 (EmpathyLogWindow, 1);
-#ifndef ENABLE_TPL
-       window->log_manager = empathy_log_manager_dup_singleton ();
-#else
        window->log_manager = tpl_log_manager_dup_singleton ();
-#endif /* ENABLE_TPL */
 
        filename = empathy_file_lookup ("empathy-log-window.ui",
                                        "libempathy-gtk");
@@ -355,7 +342,6 @@ log_window_entry_find_changed_cb (GtkWidget       *entry,
        gtk_widget_set_sensitive (window->button_find, is_sensitive);
 }
 
-#ifdef ENABLE_TPL
 static void
 got_messages_for_date_cb (GObject *manager,
                        GAsyncResult *result,
@@ -430,8 +416,6 @@ gdate_from_str (const gchar *str)
        return g_date_new_dmy (day, month, year);
 }
 
-#endif /* ENABLE_TPL */
-
 static void
 log_window_find_changed_cb (GtkTreeSelection *selection,
                            EmpathyLogWindow  *window)
@@ -443,15 +427,7 @@ log_window_find_changed_cb (GtkTreeSelection *selection,
        gchar         *chat_id;
        gboolean       is_chatroom;
        gchar         *date;
-#ifndef ENABLE_TPL
-       EmpathyMessage *message;
-       GList         *messages;
-       GList         *l;
-       gboolean       can_do_previous;
-       gboolean       can_do_next;
-#else
        GDate         *gdate;
-#endif /* ENABLE_TPL */
 
        /* Get selected information */
        view = GTK_TREE_VIEW (window->treeview_find);
@@ -483,13 +459,6 @@ log_window_find_changed_cb (GtkTreeSelection *selection,
        empathy_chat_view_scroll (window->chatview_find, FALSE);
 
        /* Get messages */
-#ifndef ENABLE_TPL
-       messages = empathy_log_manager_get_messages_for_date (window->log_manager,
-                                                             account,
-                                                             chat_id,
-                                                             is_chatroom,
-                                                             date);
-#else
        gdate = gdate_from_str (date);
 
        if (gdate != NULL) {
@@ -503,43 +472,13 @@ log_window_find_changed_cb (GtkTreeSelection *selection,
 
                g_date_free (gdate);
        }
-#endif /* ENABLE_TPL */
 
        g_object_unref (account);
        g_free (date);
        g_free (chat_id);
-
-#ifndef ENABLE_TPL
-       for (l = messages; l; l = l->next) {
-               message = l->data;
-               empathy_chat_view_append_message (window->chatview_find, message);
-               g_object_unref (message);
-       }
-       g_list_free (messages);
-
-       /* Scroll to the most recent messages */
-       empathy_chat_view_scroll (window->chatview_find, TRUE);
-
-       /* Highlight and find messages */
-       empathy_chat_view_highlight (window->chatview_find,
-                                   window->last_find, FALSE);
-       empathy_chat_view_find_next (window->chatview_find,
-                                   window->last_find,
-                                   TRUE,
-                                   FALSE);
-       empathy_chat_view_find_abilities (window->chatview_find,
-                                        window->last_find,
-                                        FALSE,
-                                        &can_do_previous,
-                                        &can_do_next);
-       gtk_widget_set_sensitive (window->button_previous, can_do_previous);
-       gtk_widget_set_sensitive (window->button_next, can_do_next);
-       gtk_widget_set_sensitive (window->button_find, FALSE);
-#endif /* ENABLE_TPL */
 }
 
 
-#ifdef ENABLE_TPL
 static void
 log_manager_searched_new_cb (GObject *manager,
                              GAsyncResult *result,
@@ -603,24 +542,15 @@ log_manager_searched_new_cb (GObject *manager,
                        tpl_log_manager_search_free (hits);
        }
 }
-#endif /* ENABLE_TPL */
-
 
 static void
 log_window_find_populate (EmpathyLogWindow *window,
                          const gchar     *search_criteria)
 {
-#ifndef ENABLE_TPL
-       GList              *hits, *l;
-
-#endif /* ENABLE_TPL */
        GtkTreeView        *view;
        GtkTreeModel       *model;
        GtkTreeSelection   *selection;
        GtkListStore       *store;
-#ifndef ENABLE_TPL
-       GtkTreeIter         iter;
-#endif /* ENABLE_TPL */
 
        view = GTK_TREE_VIEW (window->treeview_find);
        model = gtk_tree_view_get_model (view);
@@ -636,53 +566,8 @@ log_window_find_populate (EmpathyLogWindow *window,
                return;
        }
 
-#ifdef ENABLE_TPL
        tpl_log_manager_search_async (window->log_manager, search_criteria,
                        log_manager_searched_new_cb, (gpointer) store);
-#else
-       hits = empathy_log_manager_search_new (window->log_manager, search_criteria);
-
-       for (l = hits; l; l = l->next) {
-               EmpathyLogSearchHit *hit;
-               const gchar         *account_name;
-               const gchar         *account_icon;
-               gchar               *date_readable;
-
-               hit = l->data;
-
-               /* Protect against invalid data (corrupt or old log files. */
-               if (!hit->account || !hit->chat_id) {
-                       continue;
-               }
-
-               date_readable = empathy_log_manager_get_date_readable (hit->date);
-               account_name = tp_account_get_display_name (hit->account);
-               account_icon = tp_account_get_icon_name (hit->account);
-
-               gtk_list_store_append (store, &iter);
-               gtk_list_store_set (store, &iter,
-                                   COL_FIND_ACCOUNT_ICON, account_icon,
-                                   COL_FIND_ACCOUNT_NAME, account_name,
-                                   COL_FIND_ACCOUNT, hit->account,
-                                   COL_FIND_CHAT_NAME, hit->chat_id, /* FIXME */
-                                   COL_FIND_CHAT_ID, hit->chat_id,
-                                   COL_FIND_IS_CHATROOM, hit->is_chatroom,
-                                   COL_FIND_DATE, hit->date,
-                                   COL_FIND_DATE_READABLE, date_readable,
-                                   -1);
-
-               g_free (date_readable);
-
-               /* FIXME: Update COL_FIND_CHAT_NAME */
-               if (hit->is_chatroom) {
-               } else {
-               }
-       }
-
-       if (hits) {
-               empathy_log_manager_search_free (hits);
-       }
-#endif /* ENABLE_TPL */
 }
 
 static void
@@ -861,7 +746,6 @@ log_window_chats_changed_cb (GtkTreeSelection *selection,
        log_window_chats_get_messages (window, NULL);
 }
 
-#ifdef ENABLE_TPL
 static void
 log_manager_got_chats_cb (GObject *manager,
                        GAsyncResult *result,
@@ -922,25 +806,17 @@ log_manager_got_chats_cb (GObject *manager,
 
        g_object_unref (account);
 }
-#endif /* ENABLE_TPL */
-
 
 static void
 log_window_chats_populate (EmpathyLogWindow *window)
 {
        EmpathyAccountChooser *account_chooser;
        TpAccount             *account;
-#ifndef ENABLE_TPL
-       GList                *chats, *l;
-#endif /* ENABLE_TPL */
 
        GtkTreeView          *view;
        GtkTreeModel         *model;
        GtkTreeSelection     *selection;
        GtkListStore         *store;
-#ifndef ENABLE_TPL
-       GtkTreeIter           iter;
-#endif /* ENABLE_TPL */
 
        account_chooser = EMPATHY_ACCOUNT_CHOOSER (window->account_chooser_chats);
        account = empathy_account_chooser_dup_account (account_chooser);
@@ -962,40 +838,8 @@ log_window_chats_populate (EmpathyLogWindow *window)
 
        gtk_list_store_clear (store);
 
-#ifdef ENABLE_TPL
        tpl_log_manager_get_chats_async (window->log_manager, account,
                        log_manager_got_chats_cb, (gpointer) window);
-#else
-       chats = empathy_log_manager_get_chats (window->log_manager, account);
-       for (l = chats; l; l = l->next) {
-               EmpathyLogSearchHit *hit;
-
-               hit = l->data;
-
-               gtk_list_store_append (store, &iter);
-               gtk_list_store_set (store, &iter,
-                                   COL_CHAT_ICON, "empathy-available", /* FIXME */
-                                   COL_CHAT_NAME, hit->chat_id,
-                                   COL_CHAT_ACCOUNT, account,
-                                   COL_CHAT_ID, hit->chat_id,
-                                   COL_CHAT_IS_CHATROOM, hit->is_chatroom,
-                                   -1);
-
-               /* FIXME: Update COL_CHAT_ICON/NAME */
-               if (hit->is_chatroom) {
-               } else {
-               }
-       }
-       empathy_log_manager_search_free (chats);
-
-       /* Unblock signals */
-       g_signal_handlers_unblock_by_func (selection,
-                                          log_window_chats_changed_cb,
-                                          window);
-
-
-       g_object_unref (account);
-#endif /* ENABLE_TPL */
 }
 
 static void
@@ -1165,7 +1009,6 @@ log_window_chats_get_selected (EmpathyLogWindow  *window,
        return TRUE;
 }
 
-#ifdef ENABLE_TPL
 static void
 log_window_got_messages_for_date_cb (GObject *manager,
     GAsyncResult *result,
@@ -1367,151 +1210,6 @@ log_window_chats_get_messages (EmpathyLogWindow *window,
        g_free (chat_id);
 }
 
-#else
-
-static void
-log_window_chats_get_messages (EmpathyLogWindow *window,
-                              GDate     *date_to_show)
-{
-       TpAccount     *account;
-       gchar         *chat_id;
-       gboolean       is_chatroom;
-       EmpathyMessage *message;
-       GList         *messages;
-       GList         *dates = NULL;
-       GList         *l;
-       const gchar   *date = NULL;
-       guint          year_selected;
-       guint          year;
-       guint          month;
-       guint          month_selected;
-       guint          day;
-
-       if (!log_window_chats_get_selected (window, &account,
-                                           &chat_id, &is_chatroom)) {
-               return;
-       }
-
-       g_signal_handlers_block_by_func (window->calendar_chats,
-                                        log_window_calendar_chats_day_selected_cb,
-                                        window);
-
-       /* Either use the supplied date or get the last */
-       if (date_to_show == NULL) {
-               gboolean day_selected = FALSE;
-
-               /* Get a list of dates and show them on the calendar */
-               dates = empathy_log_manager_get_dates (window->log_manager,
-                                                      account, chat_id,
-                                                      is_chatroom);
-
-               for (l = dates; l; l = l->next) {
-                       const gchar *str;
-
-                       str = l->data;
-                       if (!str) {
-                               continue;
-                       }
-
-                       sscanf (str, "%4d%2d%2d", &year, &month, &day);
-                       gtk_calendar_get_date (GTK_CALENDAR (window->calendar_chats),
-                                              &year_selected,
-                                              &month_selected,
-                                              NULL);
-
-                       month_selected++;
-
-                       if (!l->next) {
-                               date = str;
-                       }
-
-                       if (year != year_selected || month != month_selected) {
-                               continue;
-                       }
-
-
-                       DEBUG ("Marking date:'%s'", str);
-                       gtk_calendar_mark_day (GTK_CALENDAR (window->calendar_chats), day);
-
-                       if (l->next) {
-                               continue;
-                       }
-
-                       day_selected = TRUE;
-
-                       gtk_calendar_select_day (GTK_CALENDAR (window->calendar_chats), day);
-               }
-
-               if (!day_selected) {
-                       /* Unselect the day in the calendar */
-                       gtk_calendar_select_day (GTK_CALENDAR (window->calendar_chats), 0);
-               }
-       } else {
-               gchar buf[9];
-
-               day = g_date_get_day (date_to_show);
-               gtk_calendar_get_date (GTK_CALENDAR (window->calendar_chats),
-                                      &year_selected,
-                                      &month_selected,
-                                      NULL);
-
-               month_selected++;
-
-               if (g_date_get_year (date_to_show) != year_selected &&
-                       g_date_get_month (date_to_show) != month_selected) {
-                       day = 0;
-               }
-
-               gtk_calendar_select_day (GTK_CALENDAR (window->calendar_chats), day);
-
-               g_date_strftime (buf, 9, "%Y%m%d", date_to_show);
-               date = buf;
-       }
-
-       g_signal_handlers_unblock_by_func (window->calendar_chats,
-                                          log_window_calendar_chats_day_selected_cb,
-                                          window);
-
-       if (!date) {
-               goto OUT;
-       }
-
-       /* Clear all current messages shown in the textview */
-       empathy_chat_view_clear (window->chatview_chats);
-
-       /* Turn off scrolling temporarily */
-       empathy_chat_view_scroll (window->chatview_find, FALSE);
-
-       /* Get messages */
-       messages = empathy_log_manager_get_messages_for_date (window->log_manager,
-                                                             account, chat_id,
-                                                             is_chatroom,
-                                                             date);
-
-       for (l = messages; l; l = l->next) {
-               message = l->data;
-
-               empathy_chat_view_append_message (window->chatview_chats,
-                                                message);
-               g_object_unref (message);
-       }
-       g_list_free (messages);
-
-       /* Turn back on scrolling */
-       empathy_chat_view_scroll (window->chatview_find, TRUE);
-
-       /* Give the search entry main focus */
-       gtk_widget_grab_focus (window->entry_chats);
-
-OUT:
-       g_list_foreach (dates, (GFunc) g_free, NULL);
-       g_list_free (dates);
-       g_object_unref (account);
-       g_free (chat_id);
-}
-
-#endif /* ENABLE_TPL */
-
 static void
 log_window_calendar_chats_day_selected_cb (GtkWidget       *calendar,
                                           EmpathyLogWindow *window)
@@ -1538,8 +1236,6 @@ log_window_calendar_chats_day_selected_cb (GtkWidget       *calendar,
        g_date_free (date);
 }
 
-
-#ifdef ENABLE_TPL
 static void
 log_window_updating_calendar_month_cb (GObject *manager,
                GAsyncResult *result, gpointer user_data)
@@ -1587,8 +1283,6 @@ log_window_updating_calendar_month_cb (GObject *manager,
        DEBUG ("Currently showing month %d and year %d", month_selected,
                        year_selected);
 }
-#endif /* ENABLE_TPL */
-
 
 static void
 log_window_calendar_chats_month_changed_cb (GtkWidget       *calendar,
@@ -1597,13 +1291,6 @@ log_window_calendar_chats_month_changed_cb (GtkWidget       *calendar,
        TpAccount     *account;
        gchar         *chat_id;
        gboolean       is_chatroom;
-#ifndef ENABLE_TPL
-       guint          year_selected;
-       guint          month_selected;
-
-       GList         *dates;
-       GList         *l;
-#endif /* ENABLE_TPL */
 
        gtk_calendar_clear_marks (GTK_CALENDAR (calendar));
 
@@ -1614,48 +1301,10 @@ log_window_calendar_chats_month_changed_cb (GtkWidget       *calendar,
        }
 
        /* Get the log object for this contact */
-#ifdef ENABLE_TPL
        tpl_log_manager_get_dates_async (window->log_manager, account,
                                               chat_id, is_chatroom,
                                               log_window_updating_calendar_month_cb,
                                               (gpointer) window);
-#else
-       dates = empathy_log_manager_get_dates (window->log_manager, account,
-                                              chat_id, is_chatroom);
-
-       g_object_get (calendar,
-                     "month", &month_selected,
-                     "year", &year_selected,
-                     NULL);
-
-       /* We need this here because it appears that the months start from 0 */
-       month_selected++;
-
-       for (l = dates; l; l = l->next) {
-               const gchar *str;
-               guint        year;
-               guint        month;
-               guint        day;
-
-               str = l->data;
-               if (!str) {
-                       continue;
-               }
-
-               sscanf (str, "%4d%2d%2d", &year, &month, &day);
-
-               if (year == year_selected && month == month_selected) {
-                       DEBUG ("Marking date:'%s'", str);
-                       gtk_calendar_mark_day (GTK_CALENDAR (window->calendar_chats), day);
-               }
-       }
-
-       g_list_foreach (dates, (GFunc) g_free, NULL);
-       g_list_free (dates);
-
-       DEBUG ("Currently showing month %d and year %d", month_selected,
-               year_selected);
-#endif /* ENABLE_TPL */
 
        g_object_unref (account);
        g_free (chat_id);
@@ -1693,4 +1342,3 @@ log_window_entry_chats_activate_cb (GtkWidget       *entry,
                                            FALSE);
        }
 }
-
index c8d362952891fac2d53b69a1a93990a84c1851ad..d44d8afefe3162e38f43e7292d54454b8bfd5282 100644 (file)
@@ -8,7 +8,6 @@ AM_CPPFLAGS =                                           \
        -DDATADIR=\""$(datadir)"\"                      \
        -DLOCALEDIR=\""$(datadir)/locale"\"             \
        -DG_LOG_DOMAIN=\"empathy\"                      \
-       $(TPL_CFLAGS)                                   \
        $(LIBEMPATHY_CFLAGS)                            \
        $(GEOCLUE_CFLAGS)                               \
        $(NETWORK_MANAGER_CFLAGS)                       \
@@ -61,14 +60,6 @@ libempathy_headers =                         \
        empathy-types.h                         \
        empathy-utils.h
 
-if !ENABLE_TPL
-libempathy_headers +=  \
-       empathy-log-manager.h                           \
-       empathy-log-store-empathy.h                     \
-       empathy-log-store.h                             \
-       $(NULL)
-endif
-
 libempathy_la_SOURCES =                                        \
        $(libempathy_headers)                           \
        empathy-account-settings.c                      \
@@ -103,14 +94,6 @@ libempathy_la_SOURCES =                                     \
        empathy-tp-roomlist.c                           \
        empathy-utils.c
 
-if !ENABLE_TPL
-libempathy_la_SOURCES += \
-       empathy-log-manager.c                           \
-       empathy-log-store-empathy.c                     \
-       empathy-log-store.c                             \
-       $(NULL)
-endif
-
 # do not distribute generated files
 nodist_libempathy_la_SOURCES =\
        $(BUILT_SOURCES)
@@ -119,7 +102,6 @@ libempathy_la_LIBADD =              \
        $(top_builddir)/extensions/libemp-extensions.la \
        $(LIBEMPATHY_LIBS) \
        $(GEOCLUE_LIBS) \
-       $(TPL_LIBS) \
        $(NETWORK_MANAGER_LIBS) \
        $(CONNMAN_LIBS)
 
@@ -192,11 +174,6 @@ dtd_DATA =                                         \
        empathy-chatroom-manager.dtd            \
        empathy-irc-networks.dtd
 
-if !ENABLE_TPL
-stylesheetdir = $(datadir)/empathy
-stylesheet_DATA = empathy-log-manager.xsl
-endif
-
 ircnetworksdir = $(datadir)/empathy
 ircnetworks_DATA =             \
        irc-networks.xml
@@ -206,10 +183,6 @@ EXTRA_DIST =                       \
        $(dtd_DATA)             \
        $(ircnetworks_DATA)
 
-if !ENABLE_TPL
-EXTRA_DIST +=  $(stylesheet_DATA)
-endif
-
 CLEANFILES =                           \
        $(BUILT_SOURCES)                \
        stamp-empathy-enum-types.h
index 7530730fc1fd7737507dd9a0b6cb3ab8a161a4ce..cbd3bd0ae306c8a72a7ba7950808b77ab74d1dda 100644 (file)
@@ -28,9 +28,6 @@
 #include <telepathy-glib/account-manager.h>
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/util.h>
-#ifdef ENABEL_TPL
-#include <telepathy-logger/contact.h>
-#endif /* ENABLE_TPL */
 
 #if HAVE_GEOCLUE
 #include <geoclue/geoclue-geocode.h>
@@ -479,7 +476,6 @@ empathy_contact_new (TpContact *tp_contact)
       NULL);
 }
 
-#ifdef ENABLE_TPL
 EmpathyContact *
 empathy_contact_from_tpl_contact (TpAccount *account,
     TplEntity *tpl_entity)
@@ -504,7 +500,6 @@ empathy_contact_from_tpl_contact (TpAccount *account,
 
   return retval;
 }
-#endif /* ENABLE_TPL */
 
 EmpathyContact *
 empathy_contact_new_for_log (TpAccount *account,
index 69c215ad40a2892ca94efd9029864a92bfeb11dc..ddb3f66c0231efb67a4cc32e01f7419d1bbb0219 100644 (file)
@@ -26,9 +26,7 @@
 
 #include <telepathy-glib/contact.h>
 #include <telepathy-glib/account.h>
-#ifdef ENABLE_TPL
 #include <telepathy-logger/entity.h>
-#endif /* ENABLE_TPL */
 
 G_BEGIN_DECLS
 
@@ -73,10 +71,8 @@ typedef enum {
 
 GType empathy_contact_get_type (void) G_GNUC_CONST;
 EmpathyContact * empathy_contact_new (TpContact *tp_contact);
-#ifdef ENABLE_TPL
 EmpathyContact * empathy_contact_from_tpl_contact (TpAccount *account,
     TplEntity *tpl_contact);
-#endif /* ENABLE_TPL */
 EmpathyContact * empathy_contact_new_for_log (TpAccount *account,
     const gchar *id, const gchar *name, gboolean is_user);
 TpContact * empathy_contact_get_tp_contact (EmpathyContact *contact);
index ab9e95d375a24a9d065f30e7e7ada18682837ae5..3d755c92b3520ede964c6415cdbb9bdd1602aad7 100644 (file)
 #include <string.h>
 
 #include <telepathy-glib/util.h>
-#ifdef ENABLE_TPL
 #include <telepathy-glib/account.h>
 #include <telepathy-glib/account-manager.h>
 
 #include <telepathy-logger/entity.h>
 #include <telepathy-logger/entry.h>
 #include <telepathy-logger/entry-text.h>
-#endif /* ENABLE_TPL */
 
 #include "empathy-message.h"
 #include "empathy-utils.h"
@@ -260,7 +258,6 @@ empathy_message_new (const gchar *body)
                             NULL);
 }
 
-#ifdef ENABLE_TPL
 EmpathyMessage *
 empathy_message_from_tpl_log_entry (TplEntry *logentry)
 {
@@ -323,7 +320,6 @@ empathy_message_from_tpl_log_entry (TplEntry *logentry)
 
        return retval;
 }
-#endif /* ENABLE_TPL */
 
 TpChannelTextMessageType
 empathy_message_get_tptype (EmpathyMessage *message)
index d7f29f7485ba6399b00278d61c8ed1b7e33c78bf..b7a63f81e027f7301212e2c25af74e63a72330c2 100644 (file)
@@ -26,9 +26,7 @@
 #define __EMPATHY_MESSAGE_H__
 
 #include <glib-object.h>
-#ifdef ENABLE_TPL
 #include <telepathy-logger/entry.h>
-#endif
 
 #include "empathy-contact.h"
 #include "empathy-time.h"
@@ -56,9 +54,7 @@ struct _EmpathyMessageClass {
 
 GType                    empathy_message_get_type          (void) G_GNUC_CONST;
 EmpathyMessage *         empathy_message_new               (const gchar              *body);
-#ifdef ENABLE_TPL
 EmpathyMessage *         empathy_message_from_tpl_log_entry (TplEntry                *logentry);
-#endif /* ENABLE_TPL */
 TpChannelTextMessageType empathy_message_get_tptype        (EmpathyMessage           *message);
 void                     empathy_message_set_tptype        (EmpathyMessage           *message,
                                                            TpChannelTextMessageType  type);
index 83db1b681e683bf950275f957f1a8c6d55903e1a..adc9bfb672d468f27b78ade10604e13e7faba28e 100644 (file)
@@ -7,7 +7,6 @@ INCLUDES =                                      \
        $(NST_CFLAGS)                           \
        $(WARN_CFLAGS)                          \
        $(DISABLE_DEPRECATED)                   \
-       $(TPL_CFLAGS) \
        $(EMPATHY_CFLAGS)
 
 plugin_LTLIBRARIES = libnstempathy.la
index 41020dd11551d65b1f2717dd195d1d1a701d6166..6f8017f4583fa94ba280cec3335cae1eec5a1f1b 100644 (file)
@@ -13,7 +13,6 @@ CPPFLAGS_COMMON =                                     \
 AM_LDFLAGS = -lm
 AM_CPPFLAGS =                                          \
        $(CPPFLAGS_COMMON)                              \
-       $(TPL_CFLAGS)                                   \
        $(LIBNOTIFY_CFLAGS)                             \
        $(LIBCHAMPLAIN_CFLAGS)                          \
        $(WEBKIT_CFLAGS)                                \
@@ -23,7 +22,6 @@ LDADD =                                                               \
        $(top_builddir)/libempathy-gtk/libempathy-gtk.la        \
        $(top_builddir)/libempathy/libempathy.la                \
        $(top_builddir)/extensions/libemp-extensions.la         \
-       $(TPL_LIBS)                                             \
        $(LIBNOTIFY_LIBS)                                       \
        $(EMPATHY_LIBS)                                         \
        $(LIBCHAMPLAIN_LIBS)                                    \
index 552b8e17194e8afb3bb142d9a3b69cf3d1966bf5..5a6b1319917d28f77730a55b2873557647eb6e87 100644 (file)
 #include <telepathy-glib/connection-manager.h>
 #include <telepathy-glib/interfaces.h>
 
-#ifdef ENABLE_TPL
 #include <telepathy-logger/log-manager.h>
-#else
 
-#include <libempathy/empathy-log-manager.h>
-#endif /* ENABLE_TPL */
 #include <libempathy/empathy-idle.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-call-factory.h>
@@ -576,11 +572,7 @@ main (int argc, char *argv[])
   EmpathyStatusIcon *icon;
   EmpathyDispatcher *dispatcher;
   TpAccountManager *account_manager;
-#ifdef ENABLE_TPL
   TplLogManager *log_manager;
-#else
-  EmpathyLogManager *log_manager;
-#endif /* ENABLE_TPL */
   EmpathyChatroomManager *chatroom_manager;
   EmpathyCallFactory *call_factory;
   EmpathyFTFactory  *ft_factory;
@@ -701,12 +693,7 @@ main (int argc, char *argv[])
       G_CALLBACK (unique_app_message_cb), window);
 
   /* Logging */
-#ifdef ENABLE_TPL
   log_manager = tpl_log_manager_dup_singleton ();
-#else
-  log_manager = empathy_log_manager_dup_singleton ();
-  empathy_log_manager_observe (log_manager, dispatcher);
-#endif
 
   chatroom_manager = empathy_chatroom_manager_dup_singleton (NULL);
   empathy_chatroom_manager_observe (chatroom_manager, dispatcher);
index 15503acd1693c3e9c8f6df4d502237d346301e6f..cf3d84cba9deb83fc11ea0280067c932dc63e2f9 100644 (file)
@@ -13,14 +13,12 @@ AM_CPPFLAGS =                                               \
        -I$(top_srcdir)                                 \
        -DPKGDATADIR=\""$(pkgdatadir)"\"                \
        $(EMPATHY_CFLAGS)                               \
-       $(TPL_CFLAGS)                                   \
        $(WARN_CFLAGS)                                  \
        $(DISABLE_DEPRECATED)
 
 LDADD =                                                                \
        $(top_builddir)/libempathy-gtk/libempathy-gtk.la        \
        $(top_builddir)/libempathy/libempathy.la                \
-       $(TPL_LIBS) \
        $(EMPATHY_LIBS)
 
 TEST_PROGS =                                     \
index 5d3a66faadd4725cd4680d5d03241622ad0b8017..8fc19eb3e02384f95a840173acb8d288a87dde36 100644 (file)
@@ -3,14 +3,12 @@ AM_CPPFLAGS =                                         \
        -I$(top_srcdir)                                 \
        -DPKGDATADIR=\""$(pkgdatadir)"\"                \
        $(EMPATHY_CFLAGS)                               \
-       $(TPL_CFLAGS)                                   \
        $(WARN_CFLAGS)                                  \
        $(DISABLE_DEPRECATED)
 
 LDADD =                                                                \
        $(top_builddir)/libempathy-gtk/libempathy-gtk.la        \
        $(top_builddir)/libempathy/libempathy.la                \
-       $(TPL_LIBS) \
        $(EMPATHY_LIBS)
 
 noinst_PROGRAMS =                      \