Changeset 2109
- Timestamp:
- 06/08/07 16:16:25
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-service.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/smtp/camel-smtp-transport.c (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-send-queue.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-transport-account.c (modified) (1 diff)
- trunk/libtinymail/tny-folder-monitor.c (modified) (1 diff)
- trunk/tests/c-demo/tny-demoui-summary-view.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r2107 r2109 10 10 * Total and ~unread even when the folder was never refreshed 11 11 * Support for the Content-Disposition header in mime parts 12 * Some bugfixes in the SMTP support 13 * Bugfix in the TnyFolderMonitor 12 14 13 15 2007-06-08 Jose Dapena Paz <jdapena@igalia.com> trunk/libtinymail-camel/camel-lite/camel/camel-service.c
r2073 r2109 441 441 camel_operation_unregister (service->connect_op); 442 442 443 camel_operation_unref (service->connect_op); 443 if (service->connect_op) 444 camel_operation_unref (service->connect_op); 444 445 service->connect_op = NULL; 445 446 CAMEL_SERVICE_UNLOCK (service, connect_op_lock); trunk/libtinymail-camel/camel-lite/camel/providers/smtp/camel-smtp-transport.c
r1943 r2109 125 125 } 126 126 127 static void 128 camel_smtp_transport_finalize (CamelSmtpTransport *self) 129 { 130 g_print ("debug\n"); 131 } 132 127 133 CamelType 128 134 camel_smtp_transport_get_type (void) … … 138 144 NULL, 139 145 (CamelObjectInitFunc) camel_smtp_transport_init, 140 NULL);146 (CamelObjectFinalizeFunc) camel_smtp_transport_finalize); 141 147 } 142 148 … … 495 501 "authentication type %s."), 496 502 service->url->host, service->url->authmech); 503 504 camel_session_alert_user (session, CAMEL_SESSION_ALERT_ERROR, 505 camel_exception_get_description (ex), FALSE); 506 497 507 camel_service_disconnect (service, TRUE, NULL); 498 508 return FALSE; … … 1394 1404 } 1395 1405 g_free (cmdbuf); 1396 1397 do { 1398 /* Check for "221" */ 1406 1407 if (FALSE && transport->istream && CAMEL_STREAM_BUFFER (transport->istream)) 1408 { 1409 do { 1410 /* Check for "221" */ 1411 if (respbuf) 1412 g_free (respbuf); 1413 respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream)); 1414 1415 d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)")); 1416 1417 if (!respbuf || strncmp (respbuf, "221", 3)) { 1418 smtp_set_exception (transport, FALSE, respbuf, _("QUIT command failed"), ex); 1419 g_free (respbuf); 1420 return FALSE; 1421 } 1422 } while (*(respbuf+3) == '-'); /* if we got "221-" then loop again */ 1423 } 1424 1425 if (respbuf) 1399 1426 g_free (respbuf); 1400 respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream)); 1401 1402 d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)")); 1403 1404 if (!respbuf || strncmp (respbuf, "221", 3)) { 1405 smtp_set_exception (transport, FALSE, respbuf, _("QUIT command failed"), ex); 1406 g_free (respbuf); 1407 return FALSE; 1408 } 1409 } while (*(respbuf+3) == '-'); /* if we got "221-" then loop again */ 1410 g_free (respbuf); 1411 1427 1412 1428 return TRUE; 1413 1429 } trunk/libtinymail-camel/tny-camel-send-queue.c
r2069 r2109 186 186 tny_list_prepend (hassent, G_OBJECT (header)); 187 187 msg = tny_folder_get_msg (outbox, header, &err); 188 g_object_unref (G_OBJECT (header)); 188 g_object_unref (G_OBJECT (header)); 189 189 190 190 if (err == NULL) … … 192 192 tny_transport_account_send (priv->trans_account, msg, &err); 193 193 194 if (err != NULL) 194 if (err != NULL) { 195 195 emit_error (self, msg, err, i, priv->total); 196 197 } else 196 priv->do_continue = FALSE; 197 } 198 } else { 198 199 emit_error (self, msg, err, i, priv->total); 200 priv->do_continue = FALSE; 201 } 199 202 200 203 g_mutex_lock (priv->todo_lock); … … 207 210 { 208 211 emit_error (self, msg, newerr, i, priv->total); 212 priv->do_continue = FALSE; 209 213 g_error_free (newerr); 210 214 } trunk/libtinymail-camel/tny-camel-transport-account.c
r1997 r2109 292 292 } 293 293 294 camel_service_disconnect (apriv->service, FALSE, &ex);294 camel_service_disconnect (apriv->service, TRUE, &ex); 295 295 apriv->connected = FALSE; 296 296 trunk/libtinymail/tny-folder-monitor.c
r1920 r2109 165 165 header = TNY_HEADER (tny_iterator_get_current (iter)); 166 166 id = tny_header_get_uid (header); 167 if (id && (!strcmp (id, uid)))167 if (id && uid && (!strcmp (id, uid))) 168 168 { 169 169 found = TRUE; trunk/tests/c-demo/tny-demoui-summary-view.c
r2097 r2109 68 68 #include <tny-merge-folder.h> 69 69 70 #include <tny-camel-send-queue.h> 71 70 72 #define GO_ONLINE_TXT _("Go online") 71 73 #define GO_OFFLINE_TXT _("Go offline") … … 103 105 TnyFolderMonitor *monitor; GMutex *monitor_lock; 104 106 gboolean handle_recon; 107 TnySendQueue *send_queue; 105 108 }; 106 109 … … 214 217 215 218 TnyList *accounts = TNY_LIST (mailbox_model); 219 TnyList *saccounts = tny_simple_list_new (); 216 220 217 221 maccounts = tny_gtk_account_list_model_new (); 218 219 222 220 223 clear_header_view (priv); … … 234 237 tny_account_store_get_accounts (account_store, TNY_LIST (maccounts), 235 238 TNY_ACCOUNT_STORE_STORE_ACCOUNTS); 239 236 240 gtk_combo_box_set_model (priv->account_view, maccounts); 241 242 tny_account_store_get_accounts (account_store, saccounts, 243 TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS); 244 245 if (tny_list_get_length (saccounts) > 0) 246 { 247 TnyIterator *iter = tny_list_create_iterator (saccounts); 248 TnyTransportAccount *tacc = (TnyTransportAccount *)tny_iterator_get_current (iter); 249 if (priv->send_queue) 250 g_object_unref (priv->send_queue); 251 priv->send_queue = tny_camel_send_queue_new ((TnyCamelTransportAccount *) tacc); 252 g_object_unref (tacc); 253 g_object_unref (iter); 254 } 255 g_object_unref (saccounts); 237 256 238 257 /* Here we use the TnyFolderStoreTreeModel as a GtkTreeModel */ … … 402 421 on_header_view_key_press_event (GtkTreeView *header_view, GdkEventKey *event, gpointer user_data) 403 422 { 423 TnyDemouiSummaryView *self = (TnyDemouiSummaryView *) user_data; 424 TnyDemouiSummaryViewPriv *priv = TNY_DEMOUI_SUMMARY_VIEW_GET_PRIVATE (self); 425 426 427 if (event->keyval == GDK_Home && priv->send_queue) 428 { 429 GtkTreeSelection *selection = gtk_tree_view_get_selection (header_view); 430 GtkTreeModel *model; 431 GtkTreeIter iter; 432 433 if (gtk_tree_selection_get_selected (selection, &model, &iter)) 434 { 435 TnyHeader *header; 436 437 gtk_tree_model_get (model, &iter, 438 TNY_GTK_HEADER_LIST_MODEL_INSTANCE_COLUMN, 439 &header, -1); 440 441 if (header) 442 { 443 GError *err = NULL; 444 TnyMsg *msg; 445 TnyFolder *folder; 446 447 GtkWidget *entry1, *entry2; 448 GtkWidget *dialog; 449 450 folder = tny_header_get_folder (header); 451 if (folder) { 452 msg = tny_folder_get_msg (folder, header, &err); 453 g_object_unref (folder); 454 } 455 456 if (!msg || err != NULL) 457 { 458 g_warning ("Can't forward message: %s\n", err->message); 459 if (msg) 460 g_object_unref (msg); 461 g_object_unref (header); 462 return; 463 } 464 465 dialog = gtk_dialog_new_with_buttons (_("Forward a message"), 466 NULL, GTK_DIALOG_MODAL, 467 GTK_STOCK_OK, 468 GTK_RESPONSE_YES, 469 GTK_STOCK_CANCEL, 470 GTK_RESPONSE_REJECT, 471 NULL); 472 473 entry1 = gtk_entry_new (); 474 gtk_entry_set_text (GTK_ENTRY (entry1), _("To: ")); 475 gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), entry1); 476 gtk_widget_show (entry1); 477 478 entry2 = gtk_entry_new (); 479 gtk_entry_set_text (GTK_ENTRY (entry2), _("From: ")); 480 gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), entry2); 481 gtk_widget_show (entry2); 482 483 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES) 484 { 485 TnyHeader *nheader = tny_msg_get_header (msg); 486 const gchar *to = gtk_entry_get_text (GTK_ENTRY (entry1)); 487 const gchar *from = gtk_entry_get_text (GTK_ENTRY (entry2)); 488 489 tny_header_set_to (nheader, to); 490 tny_header_set_to (nheader, from); 491 492 g_object_unref (nheader); 493 tny_send_queue_add (priv->send_queue, msg, NULL); 494 } 495 496 gtk_widget_destroy (dialog); 497 498 g_object_unref (msg); 499 g_object_unref (G_OBJECT (header)); 500 } 501 } 502 } 503 404 504 if (event->keyval == GDK_Delete) 405 505 { … … 768 868 if (G_LIKELY (msg)) 769 869 { 770 771 /* DEBUG772 TnyAccountStore *astore = priv->account_store;773 TnyList *accs = tny_simple_list_new ();774 tny_account_store_get_accounts (astore, accs, TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS);775 TnyIterator *iter = tny_list_create_iterator (accs);776 TnyCamelTransportAccount *acc = (TnyCamelTransportAccount *) tny_iterator_get_current (iter);777 778 g_print ("--> %s\n", tny_account_get_name (TNY_ACCOUNT (acc)));779 780 if (!queue)781 queue = tny_camel_send_queue_new (acc);782 783 tny_send_queue_add (queue, msg, NULL);784 785 g_object_unref (G_OBJECT (acc));786 g_object_unref (G_OBJECT (iter));787 g_object_unref (G_OBJECT (accs));788 */789 790 870 msgwin = tny_gtk_msg_window_new ( 791 871 tny_platform_factory_new_msg_view (platfact)); … … 796 876 gtk_widget_show (GTK_WIDGET (msgwin)); 797 877 } else { 798 799 800 801 878 msgwin = tny_gtk_msg_window_new ( 802 879 tny_platform_factory_new_msg_view (platfact)); … … 1147 1224 1148 1225 dialog = gtk_dialog_new_with_buttons (_("Create a folder"), 1149 GTK_WINDOW (gtk_widget_get_parent (GTK_WIDGET (self))),1150 GTK_DIALOG_MODAL,1151 GTK_STOCK_OK,1152 GTK_RESPONSE_ACCEPT,1153 GTK_STOCK_CANCEL,1154 GTK_RESPONSE_REJECT,1155 NULL);1226 GTK_WINDOW (gtk_widget_get_parent (GTK_WIDGET (self))), 1227 GTK_DIALOG_MODAL, 1228 GTK_STOCK_OK, 1229 GTK_RESPONSE_ACCEPT, 1230 GTK_STOCK_CANCEL, 1231 GTK_RESPONSE_REJECT, 1232 NULL); 1156 1233 1157 1234 entry = gtk_entry_new (); … … 1404 1481 priv->monitor = NULL; 1405 1482 1483 priv->send_queue = NULL; 1406 1484 priv->last_mailbox_correct_select_set = FALSE; 1407 1485 priv->online_button = gtk_toggle_button_new_with_label (GO_ONLINE_TXT);
