* src/main.c

No access to GTK structures if we're a spawned child
	(and clean up code a little bit...) Should fix #126.
This commit is contained in:
Alfons Hoogervorst 2003-04-21 09:34:15 +00:00
parent b4de225354
commit 2dec436878
3 changed files with 32 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2003-04-21 [alfons] 0.8.11claws105
* src/main.c
No access to GTK structures if we're a spawned child
(and clean up code a little bit...) Should fix #126.
2003-04-21 [melvin] 0.8.11claws104 2003-04-21 [melvin] 0.8.11claws104
* src/plugins/dillo_viewer/README * src/plugins/dillo_viewer/README

View file

@ -11,7 +11,7 @@ MINOR_VERSION=8
MICRO_VERSION=11 MICRO_VERSION=11
INTERFACE_AGE=0 INTERFACE_AGE=0
BINARY_AGE=0 BINARY_AGE=0
EXTRA_VERSION=claws104 EXTRA_VERSION=claws105
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target dnl set $target

View file

@ -160,13 +160,14 @@ _("File `%s' already exists.\n"
} }
static MainWindow *static_mainwindow; static MainWindow *static_mainwindow;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
gchar *userrc; gchar *userrc;
MainWindow *mainwin; MainWindow *mainwin;
FolderView *folderview; FolderView *folderview;
if(!sylpheed_init(&argc, &argv)) { if (!sylpheed_init(&argc, &argv)) {
return 0; return 0;
} }
@ -501,10 +502,12 @@ static void initial_processing(FolderItem *item, gpointer data)
static void draft_all_messages(void) static void draft_all_messages(void)
{ {
GList * compose_list = compose_get_compose_list(); GList *compose_list = compose_get_compose_list();
GList * elem = NULL; GList *elem = NULL;
if(compose_list) {
for (elem = compose_list; elem != NULL && elem->data != NULL; elem = elem->next) { if (compose_list) {
for (elem = compose_list; elem != NULL && elem->data != NULL;
elem = elem->next) {
Compose *c = (Compose*)elem->data; Compose *c = (Compose*)elem->data;
compose_draft(c); compose_draft(c);
} }
@ -513,10 +516,25 @@ static void draft_all_messages(void)
void clean_quit(void) void clean_quit(void)
{ {
/*!< Good idea to have the main window stored in a
* static variable so we can check that variable
* to see if we're really allowed to do things
* that actually the spawner is supposed to
* do (like: sending mail, composing messages).
* Because, really, if we're the spawnee, and
* we touch GTK stuff, we're hosed. See the
* next fixme. */
/* FIXME: Use something else to signal that we're
* in the original spawner, and not in a spawned
* child. */
if (!static_mainwindow)
return;
draft_all_messages(); draft_all_messages();
if (prefs_common.warn_queued_on_exit) if (prefs_common.warn_queued_on_exit) {
{ /* disable the popup */ /* disable the popup */
prefs_common.warn_queued_on_exit = FALSE; prefs_common.warn_queued_on_exit = FALSE;
app_will_exit(NULL, static_mainwindow); app_will_exit(NULL, static_mainwindow);
prefs_common.warn_queued_on_exit = TRUE; prefs_common.warn_queued_on_exit = TRUE;