Changeset 1723
- Timestamp:
- 03/14/07 20:00:07
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (12 diffs)
- trunk/libtinymail-camel/tny-camel-store-account.c (modified) (2 diffs)
- trunk/libtinymail/tny-folder-store.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1722 r1723 1 2007-03-14 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * tny_folder_store_remove now specifies and its implementation will 4 unsubscribe all the observers of the folder being removed. 5 6 * This was a major API change 7 1 8 2007-03-14 Sergio Villar Senin <svillar@igalia.com> 2 9 trunk/libtinymail-camel/tny-camel-folder-priv.h
r1719 r1723 34 34 guint folder_changed_id; 35 35 guint headers_managed; 36 GStaticRecMutex *folder_lock ;36 GStaticRecMutex *folder_lock, *obs_lock; 37 37 CamelFolder *folder; 38 38 gchar *folder_name; trunk/libtinymail-camel/tny-camel-folder.c
r1720 r1723 81 81 return; 82 82 83 g_static_rec_mutex_lock (priv->obs_lock); 84 83 85 iter = tny_list_create_iterator (priv->sobservers); 84 86 while (!tny_iterator_is_done (iter)) … … 90 92 } 91 93 g_object_unref (G_OBJECT (iter)); 94 95 g_static_rec_mutex_unlock (priv->obs_lock); 96 92 97 } 93 98 … … 100 105 if (!priv->observers) 101 106 return; 107 108 g_static_rec_mutex_lock (priv->obs_lock); 102 109 103 110 iter = tny_list_create_iterator (priv->observers); … … 110 117 } 111 118 g_object_unref (G_OBJECT (iter)); 119 120 g_static_rec_mutex_unlock (priv->obs_lock); 121 112 122 } 113 123 … … 2231 2241 CamelException subex = CAMEL_EXCEPTION_INITIALISER; 2232 2242 2243 g_static_rec_mutex_lock (cpriv->obs_lock); 2244 if (cpriv->observers) { 2245 g_object_unref (G_OBJECT (cpriv->observers)); 2246 cpriv->observers = NULL; 2247 } 2248 if (cpriv->sobservers) { 2249 g_object_unref (G_OBJECT (cpriv->sobservers)); 2250 cpriv->sobservers = NULL; 2251 } 2252 g_static_rec_mutex_unlock (priv->obs_lock); 2253 2233 2254 if (camel_store_supports_subscriptions (store)) 2234 2255 camel_store_subscribe_folder (store, cfolname, &subex); … … 2783 2804 g_assert (TNY_IS_FOLDER_OBSERVER (observer)); 2784 2805 2785 /* TNY TODO: locking */ 2786 2806 g_static_rec_mutex_lock (priv->obs_lock); 2787 2807 if (!priv->observers) 2788 2808 priv->observers = tny_simple_list_new (); 2789 2790 2809 tny_list_prepend (priv->observers, G_OBJECT (observer)); 2810 g_static_rec_mutex_unlock (priv->obs_lock); 2791 2811 2792 2812 determine_push_email (priv); … … 2812 2832 return; 2813 2833 2834 g_static_rec_mutex_lock (priv->obs_lock); 2814 2835 tny_list_remove (priv->observers, G_OBJECT (observer)); 2836 g_static_rec_mutex_unlock (priv->obs_lock); 2815 2837 2816 2838 determine_push_email (priv); … … 2852 2874 g_assert (TNY_IS_FOLDER_STORE_OBSERVER (observer)); 2853 2875 2854 /* TNY TODO: locking */ 2855 2876 g_static_rec_mutex_lock (priv->obs_lock); 2856 2877 if (!priv->sobservers) 2857 2878 priv->sobservers = tny_simple_list_new (); 2858 2859 2879 tny_list_prepend (priv->sobservers, G_OBJECT (observer)); 2880 g_static_rec_mutex_unlock (priv->obs_lock); 2860 2881 2861 2882 return; … … 2879 2900 return; 2880 2901 2902 g_static_rec_mutex_lock (priv->obs_lock); 2881 2903 tny_list_remove (priv->sobservers, G_OBJECT (observer)); 2904 g_static_rec_mutex_unlock (priv->obs_lock); 2882 2905 2883 2906 return; … … 2955 2978 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 2956 2979 2957 g_static_rec_mutex_lock (priv->folder_lock); 2958 priv->dont_fkill = FALSE; 2959 2980 2981 g_static_rec_mutex_lock (priv->obs_lock); 2960 2982 if (priv->observers) 2961 2983 g_object_unref (G_OBJECT (priv->observers)); 2962 2984 if (priv->sobservers) 2963 2985 g_object_unref (G_OBJECT (priv->sobservers)); 2986 g_static_rec_mutex_unlock (priv->obs_lock); 2987 2988 g_static_rec_mutex_lock (priv->folder_lock); 2989 priv->dont_fkill = FALSE; 2964 2990 2965 2991 if (priv->account && TNY_IS_CAMEL_STORE_ACCOUNT (priv->account)) … … 3003 3029 g_static_rec_mutex_free (priv->folder_lock); 3004 3030 priv->folder_lock = NULL; 3031 3032 g_static_rec_mutex_free (priv->obs_lock); 3033 priv->obs_lock = NULL; 3034 3005 3035 3006 3036 if (priv->folder_name) … … 3150 3180 priv->folder_lock = g_new0 (GStaticRecMutex, 1); 3151 3181 g_static_rec_mutex_init (priv->folder_lock); 3182 priv->obs_lock = g_new0 (GStaticRecMutex, 1); 3183 g_static_rec_mutex_init (priv->obs_lock); 3152 3184 3153 3185 return; trunk/libtinymail-camel/tny-camel-store-account.c
r1688 r1723 393 393 g_assert (TNY_IS_CAMEL_FOLDER (folder)); 394 394 395 /* TNY TODO: Support non-TnyCamelFolder TnyFolder implementations too */ 396 395 397 if (!_tny_session_check_operation (apriv->session, err, 396 398 TNY_FOLDER_STORE_ERROR, TNY_FOLDER_STORE_ERROR_REMOVE_FOLDER)) … … 425 427 g_assert (CAMEL_IS_STORE (store)); 426 428 g_assert (cpriv->folder_name != NULL); 429 430 g_static_rec_mutex_lock (cpriv->obs_lock); 431 if (cpriv->observers) { 432 g_object_unref (G_OBJECT (cpriv->observers)); 433 cpriv->observers = NULL; 434 } 435 if (cpriv->sobservers) { 436 g_object_unref (G_OBJECT (cpriv->sobservers)); 437 cpriv->sobservers = NULL; 438 } 439 g_static_rec_mutex_unlock (cpriv->obs_lock); 427 440 428 441 if (camel_store_supports_subscriptions (store)) trunk/libtinymail/tny-folder-store.c
r1716 r1723 80 80 * not do this for you, leaving the @folder instance in an unusable state. The 81 81 * id of the @folder instance will be blanked once really deleted from the 82 * service. 83 * 82 * service. All the #TnyFolderObservers and #TnyFolderStoreObservers of @folder, 83 * but of course not of @self, will automatically be unsubscribed. 84 * 84 85 * Example: 85 86 * <informalexample><programlisting>
