NULL the handle after a failed open so the offline handler won't think
2001-10-26 Iain Holmes <iain@ximian.com> * e-summary-rdf.c (open_callback): NULL the handle after a failed open so the offline handler won't think they're still open. (e_summary_rdf_set_online): Cancel all the open connections when the summary goes offline. * e-summary-weather.c (open_callback): NULL the handle after a failed open so the offline handler won't think they're still open. (e_summary_weather_set_online): Cancel all the open connections when the summary goes offline. * e-summary.c (e_summary_set_online): Call the callback if it's not NULL. svn path=/trunk/; revision=14183
This commit is contained in:

committed by
Ettore Perazzoli

parent
c944779866
commit
0b5c3e9f8b
@ -1,3 +1,18 @@
|
|||||||
|
2001-10-26 Iain Holmes <iain@ximian.com>
|
||||||
|
|
||||||
|
* e-summary-rdf.c (open_callback): NULL the handle after a failed
|
||||||
|
open so the offline handler won't think they're still open.
|
||||||
|
(e_summary_rdf_set_online): Cancel all the open connections when the
|
||||||
|
summary goes offline.
|
||||||
|
|
||||||
|
* e-summary-weather.c (open_callback): NULL the handle after a failed
|
||||||
|
open so the offline handler won't think they're still open.
|
||||||
|
(e_summary_weather_set_online): Cancel all the open connections when the
|
||||||
|
summary goes offline.
|
||||||
|
|
||||||
|
* e-summary.c (e_summary_set_online): Call the callback if it's not
|
||||||
|
NULL.
|
||||||
|
|
||||||
2001-10-25 Jon Trowbridge <trow@ximian.com>
|
2001-10-25 Jon Trowbridge <trow@ximian.com>
|
||||||
|
|
||||||
* e-summary-tasks.c (sort_uids): It is possible for
|
* e-summary-tasks.c (sort_uids): It is possible for
|
||||||
|
@ -564,6 +564,10 @@ e_summary_mail_free (ESummary *summary)
|
|||||||
|
|
||||||
mail = summary->mail;
|
mail = summary->mail;
|
||||||
bonobo_object_release_unref (mail->folder_info, NULL);
|
bonobo_object_release_unref (mail->folder_info, NULL);
|
||||||
|
mail->folder_info = CORBA_OBJECT_NIL;
|
||||||
|
|
||||||
|
gtk_signal_disconnect_by_func (GTK_OBJECT (mail->listener),
|
||||||
|
GTK_SIGNAL_FUNC (mail_change_notify), summary);
|
||||||
bonobo_object_unref (BONOBO_OBJECT (mail->listener));
|
bonobo_object_unref (BONOBO_OBJECT (mail->listener));
|
||||||
|
|
||||||
g_hash_table_foreach (mail->folders, free_folder, NULL);
|
g_hash_table_foreach (mail->folders, free_folder, NULL);
|
||||||
|
@ -51,9 +51,10 @@ e_summary_offline_handler_create_connection_list (ESummary *summary)
|
|||||||
|
|
||||||
list = GNOME_Evolution_ConnectionList__alloc ();
|
list = GNOME_Evolution_ConnectionList__alloc ();
|
||||||
list->_length = 0;
|
list->_length = 0;
|
||||||
list->_maximum = e_summary_count_connections (summary);
|
list->_maximum = e_summary_count_connections (summary) + 1;
|
||||||
list->_buffer = CORBA_sequence_GNOME_Evolution_Connection_allocbuf (list->_maximum);
|
list->_buffer = CORBA_sequence_GNOME_Evolution_Connection_allocbuf (list->_maximum);
|
||||||
|
|
||||||
|
g_print ("_length: %d\n_maximum: %d\n", list->_length, list->_maximum);
|
||||||
connections = e_summary_add_connections (summary);
|
connections = e_summary_add_connections (summary);
|
||||||
for (p = connections; p; p = p->next) {
|
for (p = connections; p; p = p->next) {
|
||||||
ESummaryConnectionData *data;
|
ESummaryConnectionData *data;
|
||||||
|
@ -411,6 +411,7 @@ open_callback (GnomeVFSAsyncHandle *handle,
|
|||||||
if (result != GNOME_VFS_OK) {
|
if (result != GNOME_VFS_OK) {
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
|
r->handle = NULL;
|
||||||
g_free (r->html);
|
g_free (r->html);
|
||||||
str = g_strdup_printf ("<b>%s:</b><br>%s", _("Error downloading RDF"),
|
str = g_strdup_printf ("<b>%s:</b><br>%s", _("Error downloading RDF"),
|
||||||
r->uri);
|
r->uri);
|
||||||
@ -456,6 +457,7 @@ e_summary_rdf_update (ESummary *summary)
|
|||||||
rdf->string = NULL;
|
rdf->string = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_warning ("Opening %s", rdf->uri);
|
||||||
gnome_vfs_async_open (&rdf->handle, rdf->uri,
|
gnome_vfs_async_open (&rdf->handle, rdf->uri,
|
||||||
GNOME_VFS_OPEN_READ,
|
GNOME_VFS_OPEN_READ,
|
||||||
(GnomeVFSAsyncOpenCallback) open_callback, rdf);
|
(GnomeVFSAsyncOpenCallback) open_callback, rdf);
|
||||||
@ -581,6 +583,7 @@ e_summary_rdf_set_online (ESummary *summary,
|
|||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
ESummaryRDF *rdf;
|
ESummaryRDF *rdf;
|
||||||
|
GList *p;
|
||||||
|
|
||||||
rdf = summary->rdf;
|
rdf = summary->rdf;
|
||||||
if (rdf->online == online) {
|
if (rdf->online == online) {
|
||||||
@ -593,6 +596,16 @@ e_summary_rdf_set_online (ESummary *summary,
|
|||||||
(GtkFunction) e_summary_rdf_update,
|
(GtkFunction) e_summary_rdf_update,
|
||||||
summary);
|
summary);
|
||||||
} else {
|
} else {
|
||||||
|
for (p = rdf->rdfs; p; p = p->next) {
|
||||||
|
RDF *r;
|
||||||
|
|
||||||
|
r = p->data;
|
||||||
|
if (r->handle) {
|
||||||
|
gnome_vfs_async_cancel (r->handle);
|
||||||
|
r->handle = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gtk_timeout_remove (rdf->timeout);
|
gtk_timeout_remove (rdf->timeout);
|
||||||
rdf->timeout = 0;
|
rdf->timeout = 0;
|
||||||
}
|
}
|
||||||
|
@ -353,6 +353,7 @@ open_callback (GnomeVFSAsyncHandle *handle,
|
|||||||
w->html = g_strdup ("<dd> </dd>");
|
w->html = g_strdup ("<dd> </dd>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w->handle = NULL;
|
||||||
e_summary_draw (w->summary);
|
e_summary_draw (w->summary);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -590,6 +591,7 @@ e_summary_weather_set_online (ESummary *summary,
|
|||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
ESummaryWeather *weather;
|
ESummaryWeather *weather;
|
||||||
|
GList *p;
|
||||||
|
|
||||||
weather = summary->weather;
|
weather = summary->weather;
|
||||||
if (weather->online == online) {
|
if (weather->online == online) {
|
||||||
@ -602,6 +604,16 @@ e_summary_weather_set_online (ESummary *summary,
|
|||||||
(GtkFunction) e_summary_weather_update,
|
(GtkFunction) e_summary_weather_update,
|
||||||
summary);
|
summary);
|
||||||
} else {
|
} else {
|
||||||
|
for (p = weather->weathers; p; p = p->next) {
|
||||||
|
Weather *w;
|
||||||
|
|
||||||
|
w = p->data;
|
||||||
|
if (w->handle) {
|
||||||
|
gnome_vfs_async_cancel (w->handle);
|
||||||
|
w->handle = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gtk_timeout_remove (weather->timeout);
|
gtk_timeout_remove (weather->timeout);
|
||||||
weather->timeout = 0;
|
weather->timeout = 0;
|
||||||
}
|
}
|
||||||
|
@ -777,6 +777,7 @@ e_summary_count_connections (ESummary *summary)
|
|||||||
count += c->count (summary, c->closure);
|
count += c->count (summary, c->closure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_print ("Count: %d", count);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -824,6 +825,11 @@ e_summary_set_online (ESummary *summary,
|
|||||||
c->callback_closure = closure;
|
c->callback_closure = closure;
|
||||||
|
|
||||||
c->set_online (summary, progress, online, c->closure);
|
c->set_online (summary, progress, online, c->closure);
|
||||||
|
g_print ("Setting %s\n", online ? "online" : "offline");
|
||||||
|
|
||||||
|
if (callback != NULL) {
|
||||||
|
callback (summary, closure);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user