Changeset 1730
- Timestamp:
- 03/15/07 17:15:45
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-session-camel-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-session-camel.c (modified) (5 diffs)
- trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (modified) (2 diffs)
- trunk/tests/functional/.svnignore (modified) (1 diff)
- trunk/tests/functional/Makefile.am (modified) (2 diffs)
- trunk/tests/functional/folder-transfer.c (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1728 r1730 1 2007-03-15 Sergio Villar Senin <svillar@igalia.com> 2 3 * tests/funtional: added a functional test to transfer folders 4 * libtinymail-camel/tny-camel-session.c: removed the first_switch 5 attribute of TnySessionCamel 6 * libtinymailui-gtk/tny-gtk-folder-store-tree-model.c: the deleter 7 method now returns just after deleting a row 8 * libtinymail-camel/tny-camel-folder.c: 9 Added some error management code when loading folders 10 Added notification code to tny_camel_folder_copy_folder 11 1 12 2007-03-14 Juerg Billeter 2 13 trunk/libtinymail-camel/tny-camel-folder.c
r1723 r1730 288 288 (store, priv->folder_name, 0, &ex); 289 289 290 if (priv->folder->folder_flags & CAMEL_FOLDER_IS_READONLY) 291 priv->caps &= ~TNY_FOLDER_CAPS_WRITABLE; 292 else 293 priv->caps |= TNY_FOLDER_CAPS_WRITABLE; 294 295 if (priv->folder->folder_flags & CAMEL_FOLDER_HAS_PUSHEMAIL_CAPABILITY) 296 priv->caps |= TNY_FOLDER_CAPS_PUSHEMAIL; 297 else 298 priv->caps &= ~TNY_FOLDER_CAPS_PUSHEMAIL; 299 300 /* printf ("LOAD (%s): %d\n", 301 priv->folder_name?priv->folder_name:"NUL", 302 (((CamelObject*)priv->folder)->ref_count)); */ 303 304 if (!priv->iter || !priv->iter->name || strcmp (priv->iter->full_name, priv->folder_name) != 0) 305 { 306 guint32 flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL; 307 308 if (priv->iter && !priv->iter_parented) 309 camel_folder_info_free (priv->iter); 310 311 priv->iter = camel_store_get_folder_info (store, priv->folder_name, flags, &ex); 312 priv->iter_parented = TRUE; 290 if (priv->folder && !camel_exception_is_set (&ex) && CAMEL_IS_FOLDER (priv->folder)) { 291 292 if (priv->folder->folder_flags & CAMEL_FOLDER_IS_READONLY) 293 priv->caps &= ~TNY_FOLDER_CAPS_WRITABLE; 294 else 295 priv->caps |= TNY_FOLDER_CAPS_WRITABLE; 296 297 if (priv->folder->folder_flags & CAMEL_FOLDER_HAS_PUSHEMAIL_CAPABILITY) 298 priv->caps |= TNY_FOLDER_CAPS_PUSHEMAIL; 299 else 300 priv->caps &= ~TNY_FOLDER_CAPS_PUSHEMAIL; 301 302 /* printf ("LOAD (%s): %d\n", 303 priv->folder_name?priv->folder_name:"NUL", 304 (((CamelObject*)priv->folder)->ref_count)); */ 305 306 if (!priv->iter || !priv->iter->name || strcmp (priv->iter->full_name, priv->folder_name) != 0) 307 { 308 guint32 flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL; 309 310 if (priv->iter && !priv->iter_parented) 311 camel_folder_info_free (priv->iter); 312 313 priv->iter = camel_store_get_folder_info (store, priv->folder_name, flags, &ex); 314 priv->iter_parented = TRUE; 315 } 313 316 } 314 317 … … 1430 1433 gchar *final_name; 1431 1434 TnyFolderStoreChange *change; 1435 TnyFolderStore *old_parent; 1432 1436 1433 1437 if (!_tny_session_check_operation (TNY_FOLDER_PRIV_GET_SESSION(priv), err, … … 1586 1590 } 1587 1591 1588 retval = _tny_camel_folder_new (); 1589 fpriv = TNY_CAMEL_FOLDER_GET_PRIVATE (retval); 1592 old_parent = tny_folder_get_folder_store (self); 1593 1594 if (tostore == fromstore && del) { 1595 retval = self; 1596 1597 /* No need to notify the folder if there was not an 1598 actual change in the short (visual) name */ 1599 if (strcmp (tny_folder_get_name (self), new_name)) { 1600 TnyFolderChange *change; 1601 1602 change = tny_folder_change_new (self); 1603 tny_folder_change_set_rename (change, new_name); 1604 notify_folder_observers_about (self, change); 1605 g_object_unref (G_OBJECT (change)); 1606 } 1607 } else { 1608 retval = _tny_camel_folder_new (); 1609 1610 fpriv = TNY_CAMEL_FOLDER_GET_PRIVATE (retval); 1611 camel_object_ref (CAMEL_OBJECT (tostore)); 1612 fpriv->store = tostore; 1613 } 1614 1615 /* Notify the deletion before the addition because otherwise 1616 we could delete the recently created folder instead of the 1617 old one. */ 1618 if (del) { 1619 TnyFolderStoreChange *change = tny_folder_store_change_new (old_parent); 1620 tny_folder_store_change_add_removed_folder (change, self); 1621 notify_folder_store_observers_about (old_parent, change); 1622 g_object_unref (G_OBJECT (change)); 1623 } 1590 1624 1591 1625 _tny_camel_folder_set_folder_info (into, TNY_CAMEL_FOLDER (retval), iter); 1592 camel_object_ref (CAMEL_OBJECT (tostore)); 1593 fpriv->store = tostore; 1594 _tny_camel_folder_set_parent (TNY_CAMEL_FOLDER (retval), into); 1595 1596 change = tny_folder_store_change_new (TNY_FOLDER_STORE (self)); 1626 1627 /* Notify addition */ 1628 change = tny_folder_store_change_new (into); 1597 1629 tny_folder_store_change_add_created_folder (change, retval); 1598 notify_folder_store_observers_about ( TNY_FOLDER_STORE (self), change);1630 notify_folder_store_observers_about (into, change); 1599 1631 g_object_unref (G_OBJECT (change)); 1600 1632 1633 g_object_unref (G_OBJECT (old_parent)); 1601 1634 camel_object_unref (CAMEL_OBJECT (tostore)); 1602 1635 camel_object_unref (CAMEL_OBJECT (fromstore)); trunk/libtinymail-camel/tny-session-camel-priv.h
r1567 r1730 6 6 gpointer device; 7 7 gpointer account_store; 8 gboolean interactive, prev_constat , first_switch;8 gboolean interactive, prev_constat; 9 9 guint connchanged_signal; 10 10 GList *current_accounts; trunk/libtinymail-camel/tny-session-camel.c
r1567 r1730 440 440 TnySessionCamelPriv *priv = self->priv; 441 441 442 if (priv->account_store && !priv->first_switch)442 if (priv->account_store) 443 443 g_signal_emit (priv->account_store, 444 444 tny_account_store_signals [TNY_ACCOUNT_STORE_ACCOUNTS_RELOADED], 0); … … 458 458 priv->is_connecting = TRUE; 459 459 460 if (priv->current_accounts && !priv->first_switch &&460 if (priv->current_accounts && 461 461 priv->prev_constat != info->online && priv->account_store) 462 462 463 { 463 464 g_list_foreach (priv->current_accounts, … … 471 472 info, background_connect_destroy); 472 473 473 priv->first_switch = FALSE;474 474 priv->prev_constat = info->online; 475 475 … … 563 563 gchar *base_directory = NULL; 564 564 gchar *camel_dir = NULL; 565 gboolean online; 565 566 TnySessionCamelPriv *priv = self->priv; 566 567 … … 579 580 camel_session_construct (session, camel_dir); 580 581 581 /* Avoid the first question in connection_changed */ 582 priv->first_switch = tny_device_is_online (device); 583 camel_session_set_online ((CamelSession *) session, 584 priv->first_switch); 582 online = tny_device_is_online (device); 583 camel_session_set_online ((CamelSession *) session, online); 585 584 priv->camel_dir = camel_dir; 586 585 g_free (base_directory); trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
r1686 r1730 600 600 deleter (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data1) 601 601 { 602 gboolean retval = FALSE; 602 603 gint type; 603 604 GObject *folder = user_data1; … … 615 616 &fol, -1); 616 617 617 if (fol == folder) 618 if (fol == folder) { 618 619 gtk_tree_store_remove (GTK_TREE_STORE (model), iter); 620 retval = TRUE; 621 } 619 622 620 623 g_object_unref (G_OBJECT (fol)); 621 624 } 622 625 623 return FALSE;626 return retval; 624 627 } 625 628 trunk/tests/functional/.svnignore
r1464 r1730 12 12 .deps 13 13 Makefile 14 folder-transfer trunk/tests/functional/Makefile.am
r1464 r1730 16 16 endif 17 17 18 bin_PROGRAMS = folder-lister folder-lister-async msg-transfer msg-sender anything 18 bin_PROGRAMS = folder-lister folder-lister-async msg-transfer msg-sender anything folder-transfer 19 19 20 20 anything_SOURCES = anything.c … … 62 62 $(top_builddir)/libtinymail-camel/libtinymail-camel-$(API_VERSION).la \ 63 63 $(top_builddir)/tests/shared/libtestsshared.a 64 65 folder_transfer_SOURCES = folder-transfer.c 66 folder_transfer_LDADD = \ 67 $(TINYMAIL_LIBS) $(LIBTINYMAIL_GNOME_DESKTOP_LIBS) \ 68 $(top_builddir)/libtinymail/libtinymail-$(API_VERSION).la \ 69 $(top_builddir)/libtinymailui/libtinymailui-$(API_VERSION).la \ 70 $(top_builddir)/libtinymailui-gtk/libtinymailui-gtk-$(API_VERSION).la \ 71 $(top_builddir)/libtinymail-camel/libtinymail-camel-$(API_VERSION).la \ 72 $(top_builddir)/tests/shared/libtestsshared.a
