Emit folder updated signal if there are new messages.
authorJosé Dapena Paz <jdapena@igalia.com>
Tue, 26 Jan 2010 10:19:10 +0000 (11:19 +0100)
committerJosé Dapena Paz <jdapena@igalia.com>
Tue, 26 Jan 2010 10:19:10 +0000 (11:19 +0100)
src/gnome/modest-platform.c
src/hildon2/modest-platform.c
src/maemo/modest-platform.c
src/modest-mail-operation.c
src/modest-platform.h

index e9204d4..de14914 100644 (file)
@@ -652,3 +652,15 @@ modest_platform_get_list_to_move (ModestWindow *window)
 
        return list;
 }
+
+DBusConnection*
+modest_platform_get_dbus_connection (void)
+{
+       return NULL;
+}
+
+void
+modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id)
+{
+       return;
+}
index 8c787e0..e46686f 100644 (file)
@@ -3162,3 +3162,27 @@ modest_platform_get_list_to_move (ModestWindow *window)
 
        return list;
 }
+
+DBusConnection*
+modest_platform_get_dbus_connection (void)
+{
+       osso_context_t *osso_context;
+       DBusConnection *con;
+
+       osso_context = modest_maemo_utils_get_osso_context();
+
+       con = osso_get_dbus_connection (osso_context);
+
+       return con;
+}
+
+void
+modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id)
+{
+       DBusConnection *con;
+
+       con = modest_platform_get_dbus_connection ();
+       if (!con) return;
+
+       modest_dbus_emit_folder_updated_signal (con, account_id, folder_id);
+}
index 1b54395..9485a63 100644 (file)
@@ -2255,3 +2255,27 @@ modest_platform_get_list_to_move (ModestWindow *window)
 
        return list;
 }
+
+DBusConnection*
+modest_platform_get_dbus_connection (void)
+{
+       osso_context_t *osso_context;
+       DBusConnection *con;
+
+       osso_context = modest_maemo_utils_get_osso_context();
+
+       con = osso_get_dbus_connection (osso_context);
+
+       return con;
+}
+
+void
+modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id)
+{
+       DBusConnection *con;
+
+       con = modest_platform_get_dbus_connection ();
+       if (!con) return;
+
+       modest_dbus_emit_folder_updated_signal (con, account_id, folder_id);
+}
index 9b01218..2a0176e 100644 (file)
@@ -1710,6 +1710,9 @@ inbox_refreshed_cb (TnyFolder *inbox,
        new_headers_array = g_ptr_array_new ();
        if (info->inbox_observer) {
                new_headers_iter = tny_list_create_iterator (((InternalFolderObserver *) info->inbox_observer)->new_headers);
+               if (!tny_iterator_is_done (new_headers_iter)) {
+                       modest_platform_emit_folder_updated_signal (info->account_name, tny_folder_get_id (TNY_FOLDER (inbox)));
+               }
                while (!tny_iterator_is_done (new_headers_iter)) {
                        TnyHeader *header = NULL;
 
index 3e13146..e3f346f 100644 (file)
@@ -34,6 +34,7 @@
 #include "widgets/modest-window.h"
 #include "widgets/modest-folder-view.h"
 #include "widgets/modest-sort-criterium-view.h"
+#include <dbus/dbus.h>
 #ifndef MODEST_TOOLKIT_GTK
 #include <libosso.h>
 #endif
@@ -561,6 +562,10 @@ GtkWidget* modest_platform_create_move_to_dialog (GtkWindow *parent_window,
 
 TnyList* modest_platform_get_list_to_move (ModestWindow *window);
 
+DBusConnection* modest_platform_get_dbus_connection (void);
+
+void modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id);
+
 G_END_DECLS
 
 #endif /* __MODEST_PLATFORM_UTILS_H__ */