projects
/
modest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d41a3c7
)
Fixes several reference leaks that were preventing the folder view window from being...
author
Sergio Villar Senin
<svillar@igalia.com>
Thu, 12 Feb 2009 12:15:14 +0000
(12:15 +0000)
committer
Sergio Villar Senin
<svillar@igalia.com>
Thu, 12 Feb 2009 12:15:14 +0000
(12:15 +0000)
pmo-trunk-r7474
src/hildon2/modest-folder-window.c
patch
|
blob
|
history
src/hildon2/modest-header-window.c
patch
|
blob
|
history
src/hildon2/modest-hildon2-window.c
patch
|
blob
|
history
src/modest-mail-operation-queue.c
patch
|
blob
|
history
src/modest-mail-operation-queue.h
patch
|
blob
|
history
src/modest-ui-actions.c
patch
|
blob
|
history
src/modest-ui-dimming-rules.c
patch
|
blob
|
history
diff --git
a/src/hildon2/modest-folder-window.c
b/src/hildon2/modest-folder-window.c
index
4fd5f50
..
f34ac92
100644
(file)
--- a/
src/hildon2/modest-folder-window.c
+++ b/
src/hildon2/modest-folder-window.c
@@
-438,7
+438,7
@@
on_folder_activated (ModestFolderView *folder_view,
return;
headerwin = modest_header_window_new (folder, modest_window_get_active_account (MODEST_WINDOW (self)));
return;
headerwin = modest_header_window_new (folder, modest_window_get_active_account (MODEST_WINDOW (self)));
- modest_window_mgr_register_window (modest_runtime_get_window_mgr (),
+ modest_window_mgr_register_window (modest_runtime_get_window_mgr (),
MODEST_WINDOW (headerwin),
MODEST_WINDOW (self));
MODEST_WINDOW (headerwin),
MODEST_WINDOW (self));
diff --git
a/src/hildon2/modest-header-window.c
b/src/hildon2/modest-header-window.c
index
bad4b7e
..
e2dfaee
100644
(file)
--- a/
src/hildon2/modest-header-window.c
+++ b/
src/hildon2/modest-header-window.c
@@
-247,8
+247,6
@@
modest_header_window_finalize (GObject *obj)
priv = MODEST_HEADER_WINDOW_GET_PRIVATE(obj);
priv = MODEST_HEADER_WINDOW_GET_PRIVATE(obj);
- g_object_unref (priv->header_view);
- g_object_unref (priv->empty_view);
g_object_unref (priv->folder);
if (priv->current_store_account) {
g_object_unref (priv->folder);
if (priv->current_store_account) {
@@
-274,8
+272,8
@@
modest_header_window_finalize (GObject *obj)
static void
modest_header_window_disconnect_signals (ModestWindow *self)
static void
modest_header_window_disconnect_signals (ModestWindow *self)
-{
- ModestHeaderWindowPrivate *priv;
+{
+ ModestHeaderWindowPrivate *priv;
priv = MODEST_HEADER_WINDOW_GET_PRIVATE(self);
if (g_signal_handler_is_connected (G_OBJECT (modest_runtime_get_mail_operation_queue ()),
priv = MODEST_HEADER_WINDOW_GET_PRIVATE(self);
if (g_signal_handler_is_connected (G_OBJECT (modest_runtime_get_mail_operation_queue ()),
@@
-419,8
+417,6
@@
modest_header_window_new (TnyFolder *folder, const gchar *account_name)
priv->header_view = create_header_view (MODEST_WINDOW (self), folder);
priv->empty_view = create_empty_view ();
priv->header_view = create_header_view (MODEST_WINDOW (self), folder);
priv->empty_view = create_empty_view ();
- g_object_ref (priv->header_view);
- g_object_ref (priv->empty_view);
g_signal_connect (G_OBJECT (self), "edit-mode-changed",
G_CALLBACK (edit_mode_changed), (gpointer) self);
setup_menu (self);
g_signal_connect (G_OBJECT (self), "edit-mode-changed",
G_CALLBACK (edit_mode_changed), (gpointer) self);
setup_menu (self);
@@
-446,7
+442,7
@@
modest_header_window_new (TnyFolder *folder, const gchar *account_name)
app = hildon_program_get_instance ();
hildon_program_add_window (app, HILDON_WINDOW (self));
app = hildon_program_get_instance ();
hildon_program_add_window (app, HILDON_WINDOW (self));
-
+
/* Set window icon */
window_icon = modest_platform_get_icon (MODEST_APP_ICON, MODEST_ICON_SIZE_BIG);
if (window_icon) {
/* Set window icon */
window_icon = modest_platform_get_icon (MODEST_APP_ICON, MODEST_ICON_SIZE_BIG);
if (window_icon) {
@@
-481,6
+477,7
@@
modest_header_window_new (TnyFolder *folder, const gchar *account_name)
GTK_SELECTION_MULTIPLE,
EDIT_MODE_CALLBACK (modest_ui_actions_on_edit_mode_move_to));
GTK_SELECTION_MULTIPLE,
EDIT_MODE_CALLBACK (modest_ui_actions_on_edit_mode_move_to));
+
modest_window_set_active_account (MODEST_WINDOW (self), account_name);
mgr = modest_runtime_get_account_mgr ();
settings = modest_account_mgr_load_account_settings (mgr, account_name);
modest_window_set_active_account (MODEST_WINDOW (self), account_name);
mgr = modest_runtime_get_account_mgr ();
settings = modest_account_mgr_load_account_settings (mgr, account_name);
@@
-493,6
+490,7
@@
modest_header_window_new (TnyFolder *folder, const gchar *account_name)
}
g_object_unref (settings);
}
}
g_object_unref (settings);
}
+
update_progress_hint (self);
update_sort_button (self);
update_progress_hint (self);
update_sort_button (self);
@@
-784,31
+782,43
@@
has_active_operations (ModestHeaderWindow *self)
queue = modest_runtime_get_mail_operation_queue ();
operations = modest_mail_operation_queue_get_by_source (queue, G_OBJECT (self));
queue = modest_runtime_get_mail_operation_queue ();
operations = modest_mail_operation_queue_get_by_source (queue, G_OBJECT (self));
+
for (node = operations; node != NULL; node = g_slist_next (node)) {
if (!modest_mail_operation_is_finished (MODEST_MAIL_OPERATION (node->data))) {
has_active = TRUE;
break;
}
}
for (node = operations; node != NULL; node = g_slist_next (node)) {
if (!modest_mail_operation_is_finished (MODEST_MAIL_OPERATION (node->data))) {
has_active = TRUE;
break;
}
}
- g_slist_free (operations);
+
+ if (operations) {
+ g_slist_foreach (operations, (GFunc) g_object_unref, NULL);
+ g_slist_free (operations);
+ }
+
return has_active;
}
static void
update_progress_hint (ModestHeaderWindow *self)
{
return has_active;
}
static void
update_progress_hint (ModestHeaderWindow *self)
{
- ModestHeaderWindowPrivate *priv = MODEST_HEADER_WINDOW_GET_PRIVATE (self);
+ ModestHeaderWindowPrivate *priv;
+
+ priv = MODEST_HEADER_WINDOW_GET_PRIVATE (self);
+
priv->progress_hint = FALSE;
if (has_active_operations (self)) {
priv->progress_hint = TRUE;
}
priv->progress_hint = FALSE;
if (has_active_operations (self)) {
priv->progress_hint = TRUE;
}
+ return;
+
if (!priv->progress_hint && priv->current_store_account) {
if (!priv->progress_hint && priv->current_store_account) {
- priv->progress_hint = modest_window_mgr_has_progress_operation_on_account (modest_runtime_get_window_mgr (),
- priv->current_store_account);
+ priv->progress_hint =
+ modest_window_mgr_has_progress_operation_on_account (modest_runtime_get_window_mgr (),
+ priv->current_store_account);
}
}
-
+
modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
if (GTK_WIDGET_VISIBLE (self)) {
modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
if (GTK_WIDGET_VISIBLE (self)) {
@@
-816,7
+826,7
@@
update_progress_hint (ModestHeaderWindow *self)
}
}
}
}
-gboolean
+gboolean
modest_header_window_toolbar_on_transfer_mode (ModestHeaderWindow *self)
{
ModestHeaderWindowPrivate *priv= NULL;
modest_header_window_toolbar_on_transfer_mode (ModestHeaderWindow *self)
{
ModestHeaderWindowPrivate *priv= NULL;
@@
-860,21
+870,13
@@
on_mail_operation_finished (ModestMailOperation *mail_op,
gpointer user_data)
{
ModestHeaderWindow *self;
gpointer user_data)
{
ModestHeaderWindow *self;
- ModestMailOperationTypeOperation op_type;
- GSList *operations = NULL;
- ModestMailOperationQueue *queue;
self = MODEST_HEADER_WINDOW (user_data);
self = MODEST_HEADER_WINDOW (user_data);
- op_type = modest_mail_operation_get_type_operation (mail_op);
-
- queue = modest_runtime_get_mail_operation_queue ();
- operations = modest_mail_operation_queue_get_by_source (queue, user_data);
/* Don't disable the progress hint if there are more pending
operations from this window */
update_progress_hint (self);
/* Don't disable the progress hint if there are more pending
operations from this window */
update_progress_hint (self);
- g_slist_free (operations);
modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
}
modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
}
diff --git
a/src/hildon2/modest-hildon2-window.c
b/src/hildon2/modest-hildon2-window.c
index
015dedc
..
a3d0433
100644
(file)
--- a/
src/hildon2/modest-hildon2-window.c
+++ b/
src/hildon2/modest-hildon2-window.c
@@
-496,7
+496,7
@@
edit_toolbar_button_clicked (HildonEditToolbar *toolbar,
EditModeRegister *reg;
g_return_if_fail (MODEST_IS_HILDON2_WINDOW (self));
EditModeRegister *reg;
g_return_if_fail (MODEST_IS_HILDON2_WINDOW (self));
-
+
reg = (EditModeRegister *) g_hash_table_lookup (priv->edit_mode_registry,
GINT_TO_POINTER (priv->edit_command));
if (reg == NULL)
reg = (EditModeRegister *) g_hash_table_lookup (priv->edit_mode_registry,
GINT_TO_POINTER (priv->edit_command));
if (reg == NULL)
@@
-512,7
+512,7
@@
edit_toolbar_arrow_clicked (HildonEditToolbar *toolbar,
ModestHildon2Window *self)
{
g_return_if_fail (MODEST_IS_HILDON2_WINDOW (self));
ModestHildon2Window *self)
{
g_return_if_fail (MODEST_IS_HILDON2_WINDOW (self));
-
+
modest_hildon2_window_unset_edit_mode (self);
}
modest_hildon2_window_unset_edit_mode (self);
}
diff --git
a/src/modest-mail-operation-queue.c
b/src/modest-mail-operation-queue.c
index
720e668
..
352c26f
100644
(file)
--- a/
src/modest-mail-operation-queue.c
+++ b/
src/modest-mail-operation-queue.c
@@
-452,18
+452,20
@@
typedef struct
static void
on_find_by_source_foreach (gpointer op, gpointer data)
{
static void
on_find_by_source_foreach (gpointer op, gpointer data)
{
- FindBySourceInfo *info = (FindBySourceInfo*) data;
+ FindBySourceInfo *info = (FindBySourceInfo*) data;
+ GObject *source;
- if ( info->source == modest_mail_operation_get_source (MODEST_MAIL_OPERATION (op))) {
+ source = modest_mail_operation_get_source (MODEST_MAIL_OPERATION (op));
+ if ( info->source == source) {
g_object_ref (G_OBJECT (op));
*(info->new_list) = g_slist_prepend (*(info->new_list), MODEST_MAIL_OPERATION (op));
}
g_object_ref (G_OBJECT (op));
*(info->new_list) = g_slist_prepend (*(info->new_list), MODEST_MAIL_OPERATION (op));
}
+ g_object_unref (source);
}
GSList*
}
GSList*
-modest_mail_operation_queue_get_by_source (
- ModestMailOperationQueue *self,
- GObject *source)
+modest_mail_operation_queue_get_by_source (ModestMailOperationQueue *self,
+ GObject *source)
{
ModestMailOperationQueuePrivate *priv;
GSList* found_operations= NULL;
{
ModestMailOperationQueuePrivate *priv;
GSList* found_operations= NULL;
@@
-471,18
+473,18
@@
modest_mail_operation_queue_get_by_source (
g_return_val_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self), NULL);
g_return_val_if_fail (source != NULL, NULL);
g_return_val_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self), NULL);
g_return_val_if_fail (source != NULL, NULL);
-
+
priv = MODEST_MAIL_OPERATION_QUEUE_GET_PRIVATE(self);
info->new_list = &found_operations;
info->source = source;
priv = MODEST_MAIL_OPERATION_QUEUE_GET_PRIVATE(self);
info->new_list = &found_operations;
info->source = source;
-
+
g_mutex_lock (priv->queue_lock);
g_queue_foreach (priv->op_queue, (GFunc) on_find_by_source_foreach, info);
g_mutex_unlock (priv->queue_lock);
g_mutex_lock (priv->queue_lock);
g_queue_foreach (priv->op_queue, (GFunc) on_find_by_source_foreach, info);
g_mutex_unlock (priv->queue_lock);
-
+
g_free (info);
g_free (info);
-
+
return found_operations;
}
return found_operations;
}
diff --git
a/src/modest-mail-operation-queue.h
b/src/modest-mail-operation-queue.h
index
4171306
..
9f0cd25
100644
(file)
--- a/
src/modest-mail-operation-queue.h
+++ b/
src/modest-mail-operation-queue.h
@@
-117,7
+117,7
@@
void modest_mail_operation_queue_cancel (ModestMailOperationQueue *op_que
/**
* modest_mail_operation_queue_cancel_all:
* @op_queue: a #ModestMailOperationQueue
/**
* modest_mail_operation_queue_cancel_all:
* @op_queue: a #ModestMailOperationQueue
- *
+ *
* Cancels all the unfinished #ModestMailOperation of the queue
**/
void modest_mail_operation_queue_cancel_all (ModestMailOperationQueue *op_queue);
* Cancels all the unfinished #ModestMailOperation of the queue
**/
void modest_mail_operation_queue_cancel_all (ModestMailOperationQueue *op_queue);
@@
-126,16
+126,18
@@
void modest_mail_operation_queue_cancel_all (ModestMailOperationQueue *op_que
* modest_mail_operation_queue_get_by_source:
* @op_queue: a #ModestMailOperationQueue
* @source: the source of the operations
* modest_mail_operation_queue_get_by_source:
* @op_queue: a #ModestMailOperationQueue
* @source: the source of the operations
- *
- * Returns a list with the #ModestMailOperation that have the given source
+ *
+ * Returns a list with the #ModestMailOperation that have the given
+ * source. Each #ModestMailOperation is getting a new reference so you
+ * MUST unref it when done
**/
GSList* modest_mail_operation_queue_get_by_source (ModestMailOperationQueue *op_queue, GObject *source);
/**
**/
GSList* modest_mail_operation_queue_get_by_source (ModestMailOperationQueue *op_queue, GObject *source);
/**
- * modest_mail_operation_queue_get_by_source:
+ * modest_mail_operation_queue_queue_to_string:
* @op_queue: a #ModestMailOperationQueue
* @op_queue: a #ModestMailOperationQueue
- *
+ *
* Returns a string representation of the operation queue (for debugging)
*
* Returns: a newly allocated string, or NULL in case of error
* Returns a string representation of the operation queue (for debugging)
*
* Returns: a newly allocated string, or NULL in case of error
diff --git
a/src/modest-ui-actions.c
b/src/modest-ui-actions.c
index
5662273
..
bb59a55
100644
(file)
--- a/
src/modest-ui-actions.c
+++ b/
src/modest-ui-actions.c
@@
-3537,10
+3537,10
@@
on_rename_folder_performer (gboolean canceled,
(const gchar *) (data->new_name),
on_rename_folder_cb,
folder_view);
(const gchar *) (data->new_name),
on_rename_folder_cb,
folder_view);
- g_object_unref (data->folder);
g_object_unref (mail_op);
}
g_object_unref (mail_op);
}
+ g_object_unref (data->folder);
g_free (data->new_name);
g_free (data);
}
g_free (data->new_name);
g_free (data);
}
diff --git
a/src/modest-ui-dimming-rules.c
b/src/modest-ui-dimming-rules.c
index
f110751
..
23a9254
100644
(file)
--- a/
src/modest-ui-dimming-rules.c
+++ b/
src/modest-ui-dimming-rules.c
@@
-2985,8
+2985,10
@@
_send_receive_in_progress (ModestWindow *win)
}
}
}
}
- g_slist_foreach (op_list, (GFunc) g_object_unref, NULL);
- g_slist_free (op_list);
+ if (op_list) {
+ g_slist_foreach (op_list, (GFunc) g_object_unref, NULL);
+ g_slist_free (op_list);
+ }
return found_send_receive;
}
return found_send_receive;
}