Changeset 850
- Timestamp:
- 08/31/06 12:00:12
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/Makefile.am (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-folder.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-imap-store-account.c (added)
- trunk/libtinymail-camel/tny-camel-imap-store-account.h (added)
- trunk/libtinymail-camel/tny-camel-nntp-store-account.c (added)
- trunk/libtinymail-camel/tny-camel-nntp-store-account.h (added)
- trunk/libtinymail-camel/tny-camel-pop-store-account.c (added)
- trunk/libtinymail-camel/tny-camel-pop-store-account.h (added)
- trunk/libtinymail-camel/tny-camel-store-account.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-store-account.h (modified) (1 diff)
- trunk/libtinymail-gnome-desktop/tny-account-store.c (modified) (4 diffs)
- trunk/libtinymail-gpe/tny-account-store.c (modified) (2 diffs)
- trunk/libtinymail-maemo/tny-account-store.c (modified) (2 diffs)
- trunk/libtinymail-olpc/tny-account-store.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r849 r850 4 4 and get_folders_async methods virtual ones that can be 5 5 overridden 6 7 * Refactored TnyCamelStoreAccount into three types: 8 TnyCamelIMAPStoreAccount, TnyCamelNNTPStoreAccount and 9 TnyCamelPOPStoreAccount (todo: the folders and implementing 10 custom get_folders and get_folders_async methods for NNTP 11 and POP) 12 13 * This was a major API change 6 14 7 15 2006-08-30 Thomas Hisch <t.hisch@gmail.com> trunk/libtinymail-camel/Makefile.am
r843 r850 13 13 tny-camel-account.h \ 14 14 tny-camel-store-account.h \ 15 tny-camel-imap-store-account.h \ 16 tny-camel-nntp-store-account.h \ 17 tny-camel-pop-store-account.h \ 15 18 tny-camel-transport-account.h \ 16 19 tny-camel-stream.h \ … … 36 39 tny-camel-account.c \ 37 40 tny-camel-store-account.c \ 41 tny-camel-imap-store-account.c \ 42 tny-camel-nntp-store-account.c \ 43 tny-camel-pop-store-account.c \ 38 44 tny-camel-transport-account.c \ 39 45 tny-camel-stream.c \ trunk/libtinymail-camel/tny-camel-folder.c
r849 r850 893 893 tny_camel_folder_remove_folder (TnyFolderStoreIface *self, TnyFolderIface *folder) 894 894 { 895 TNY_CAMEL_FOLDER_GET_CLASS (self)->remove_folder_func (self, folder); 896 } 897 898 static void 899 tny_camel_folder_remove_folder_default (TnyFolderStoreIface *self, TnyFolderIface *folder) 900 { 895 901 /* TODO */ 896 902 … … 902 908 static TnyFolderIface* 903 909 tny_camel_folder_create_folder (TnyFolderStoreIface *self, const gchar *name) 910 { 911 return TNY_CAMEL_FOLDER_GET_CLASS (self)->create_folder_func (self, name); 912 } 913 914 915 static TnyFolderIface* 916 tny_camel_folder_create_folder_default (TnyFolderStoreIface *self, const gchar *name) 904 917 { 905 918 /* TODO */ … … 1138 1151 class->get_folders_async_func = tny_camel_folder_get_folders_async_default; 1139 1152 class->get_folders_func = tny_camel_folder_get_folders_default; 1153 class->create_folder_func = tny_camel_folder_create_folder_default; 1154 class->remove_folder_func = tny_camel_folder_remove_folder_default; 1140 1155 1141 1156 g_type_class_add_private (object_class, sizeof (TnyCamelFolderPriv)); trunk/libtinymail-camel/tny-camel-folder.h
r849 r850 53 53 void (*get_folders_async_func) (TnyFolderStoreIface *self, TnyListIface *list, TnyGetFoldersCallback callback, TnyFolderStoreQuery *query, gpointer user_data); 54 54 void (*get_folders_func) (TnyFolderStoreIface *self, TnyListIface *list, TnyFolderStoreQuery *query); 55 55 void (*remove_folder_func) (TnyFolderStoreIface *self, TnyFolderIface *folder); 56 TnyFolderIface* (*create_folder_func) (TnyFolderStoreIface *self, const gchar *name); 56 57 }; 57 58 trunk/libtinymail-camel/tny-camel-store-account.c
r849 r850 285 285 tny_camel_store_account_remove_folder (TnyFolderStoreIface *self, TnyFolderIface *folder) 286 286 { 287 TNY_CAMEL_STORE_ACCOUNT_GET_CLASS (self)->remove_folder_func (self, folder); 288 } 289 290 static void 291 tny_camel_store_account_remove_folder_default (TnyFolderStoreIface *self, TnyFolderIface *folder) 292 { 287 293 /* TODO */ 288 294 … … 294 300 static TnyFolderIface* 295 301 tny_camel_store_account_create_folder (TnyFolderStoreIface *self, const gchar *name) 302 { 303 return TNY_CAMEL_STORE_ACCOUNT_GET_CLASS (self)->create_folder_func (self, name); 304 } 305 306 307 static TnyFolderIface* 308 tny_camel_store_account_create_folder_default (TnyFolderStoreIface *self, const gchar *name) 296 309 { 297 310 /* TODO */ … … 507 520 class->get_folders_async_func = tny_camel_store_account_get_folders_async_default; 508 521 class->get_folders_func = tny_camel_store_account_get_folders_default; 522 class->create_folder_func = tny_camel_store_account_create_folder_default; 523 class->remove_folder_func = tny_camel_store_account_remove_folder_default; 509 524 510 525 g_type_class_add_private (object_class, sizeof (TnyCamelStoreAccountPriv)); trunk/libtinymail-camel/tny-camel-store-account.h
r849 r850 51 51 void (*get_folders_async_func) (TnyFolderStoreIface *self, TnyListIface *list, TnyGetFoldersCallback callback, TnyFolderStoreQuery *query, gpointer user_data); 52 52 void (*get_folders_func) (TnyFolderStoreIface *self, TnyListIface *list, TnyFolderStoreQuery *query); 53 53 void (*remove_folder_func) (TnyFolderStoreIface *self, TnyFolderIface *folder); 54 TnyFolderIface* (*create_folder_func) (TnyFolderStoreIface *self, const gchar *name); 54 55 }; 55 56 trunk/libtinymail-gnome-desktop/tny-account-store.c
r843 r850 40 40 #include <tny-camel-account.h> 41 41 #include <tny-camel-store-account.h> 42 #include <tny-camel-imap-store-account.h> 43 #include <tny-camel-nntp-store-account.h> 44 #include <tny-camel-pop-store-account.h> 42 45 #include <tny-camel-transport-account.h> 43 46 #include <tny-device.h> … … 49 52 #endif 50 53 51 /* "GConf vs. Camel" accountimplementation */54 /* "GConf vs. libtinymail-camel" account-store implementation */ 52 55 53 56 static GObjectClass *parent_class = NULL; … … 363 366 g_free (key); 364 367 368 365 369 key = g_strdup_printf ("/apps/tinymail/accounts/%d/type", i); 366 370 type = gconf_client_get_string (priv->client, 367 371 (const gchar*) key, NULL); 368 372 g_free (key); 369 373 374 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", i); 375 proto = gconf_client_get_string (priv->client, 376 (const gchar*) key, NULL); 377 g_free (key); 378 379 370 380 if (type && G_LIKELY (!g_ascii_strncasecmp (type, "transport", 9))) 371 381 { 372 382 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_TRANSPORT_ACCOUNTS) 373 383 account = TNY_ACCOUNT_IFACE (tny_camel_transport_account_new ()); 374 } else { 375 376 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 377 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 384 } else if (type && types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 385 { 386 if (!g_ascii_strncasecmp (proto, "imap", 4)) 387 account = TNY_ACCOUNT_IFACE (tny_camel_imap_store_account_new ()); 388 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 389 account = TNY_ACCOUNT_IFACE (tny_camel_nntp_store_account_new ()); 390 else if (!g_ascii_strncasecmp (proto, "pop", 4)) 391 account = TNY_ACCOUNT_IFACE (tny_camel_pop_store_account_new ()); 392 else /* Unknown, create a generic one? */ 393 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 378 394 } 379 395 … … 384 400 { 385 401 tny_camel_account_set_session (TNY_CAMEL_ACCOUNT (account), priv->session); 386 387 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", i);388 proto = gconf_client_get_string (priv->client,389 (const gchar*) key, NULL);390 g_free (key);391 402 tny_account_iface_set_proto (TNY_ACCOUNT_IFACE (account), proto); 392 403 trunk/libtinymail-gpe/tny-account-store.c
r848 r850 253 253 g_free (key); 254 254 255 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", i); 256 proto = gconf_client_get_string (priv->client, 257 (const gchar*) key, NULL); 258 g_free (key); 259 260 255 261 if (type && G_LIKELY (!g_ascii_strncasecmp (type, "transport", 9))) 256 262 { 257 263 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_TRANSPORT_ACCOUNTS) 258 264 account = TNY_ACCOUNT_IFACE (tny_camel_transport_account_new ()); 259 } else { 260 261 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 262 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 265 } else if (type && types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 266 { 267 if (!g_ascii_strncasecmp (proto, "imap", 4)) 268 account = TNY_ACCOUNT_IFACE (tny_camel_imap_store_account_new ()); 269 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 270 account = TNY_ACCOUNT_IFACE (tny_camel_nntp_store_account_new ()); 271 else if (!g_ascii_strncasecmp (proto, "pop", 4)) 272 account = TNY_ACCOUNT_IFACE (tny_camel_pop_store_account_new ()); 273 else /* Unknown, create a generic one? */ 274 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 263 275 } 264 276 265 277 if (type) 266 278 g_free (type); … … 269 281 { 270 282 tny_camel_account_set_session (TNY_CAMEL_ACCOUNT (account), priv->session); 271 272 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", i);273 proto = gconf_client_get_string (priv->client,274 (const gchar*) key, NULL);275 g_free (key);276 283 tny_account_iface_set_proto (TNY_ACCOUNT_IFACE (account), proto); 277 284 trunk/libtinymail-maemo/tny-account-store.c
r848 r850 254 254 g_free (key); 255 255 256 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", i); 257 proto = gconf_client_get_string (priv->client, 258 (const gchar*) key, NULL); 259 g_free (key); 260 261 256 262 if (type && G_LIKELY (!g_ascii_strncasecmp (type, "transport", 9))) 257 263 { 258 264 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_TRANSPORT_ACCOUNTS) 259 265 account = TNY_ACCOUNT_IFACE (tny_camel_transport_account_new ()); 260 } else { 261 262 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 263 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 266 } else if (type && types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 267 { 268 if (!g_ascii_strncasecmp (proto, "imap", 4)) 269 account = TNY_ACCOUNT_IFACE (tny_camel_imap_store_account_new ()); 270 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 271 account = TNY_ACCOUNT_IFACE (tny_camel_nntp_store_account_new ()); 272 else if (!g_ascii_strncasecmp (proto, "pop", 4)) 273 account = TNY_ACCOUNT_IFACE (tny_camel_pop_store_account_new ()); 274 else /* Unknown, create a generic one? */ 275 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 264 276 } 265 277 … … 270 282 { 271 283 tny_camel_account_set_session (TNY_CAMEL_ACCOUNT (account), priv->session); 272 273 274 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", i);275 proto = gconf_client_get_string (priv->client,276 (const gchar*) key, NULL);277 g_free (key);278 284 tny_account_iface_set_proto (TNY_ACCOUNT_IFACE (account), proto); 279 285 trunk/libtinymail-olpc/tny-account-store.c
r848 r850 211 211 212 212 type = g_key_file_get_value (keyfile, "tinymail", "type", NULL); 213 213 proto = g_key_file_get_value (keyfile, "tinymail", "proto", NULL); 214 214 215 if (type && G_LIKELY (!g_ascii_strncasecmp (type, "transport", 9))) 215 216 { 216 217 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_TRANSPORT_ACCOUNTS) 217 218 account = TNY_ACCOUNT_IFACE (tny_camel_transport_account_new ()); 218 } else { 219 220 if (types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 221 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 219 } else if (type && types == TNY_ACCOUNT_STORE_IFACE_BOTH || types == TNY_ACCOUNT_STORE_IFACE_STORE_ACCOUNTS) 220 { 221 if (!g_ascii_strncasecmp (proto, "imap", 4)) 222 account = TNY_ACCOUNT_IFACE (tny_camel_imap_store_account_new ()); 223 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 224 account = TNY_ACCOUNT_IFACE (tny_camel_nntp_store_account_new ()); 225 else if (!g_ascii_strncasecmp (proto, "pop", 4)) 226 account = TNY_ACCOUNT_IFACE (tny_camel_pop_store_account_new ()); 227 else /* Unknown, create a generic one? */ 228 account = TNY_ACCOUNT_IFACE (tny_camel_store_account_new ()); 222 229 } 223 230 … … 231 238 232 239 tny_camel_account_set_session (TNY_CAMEL_ACCOUNT (account), priv->session); 233 234 proto = g_key_file_get_value (keyfile, "tinymail", "proto", NULL);235 240 tny_account_iface_set_proto (TNY_ACCOUNT_IFACE (account), proto); 236 241
