}
static MainWindow *static_mainwindow;
+
int main(int argc, char *argv[])
{
gchar *userrc;
MainWindow *mainwin;
FolderView *folderview;
- if(!sylpheed_init(&argc, &argv)) {
+ if (!sylpheed_init(&argc, &argv)) {
return 0;
}
static void draft_all_messages(void)
{
- GList * compose_list = compose_get_compose_list();
- GList * elem = NULL;
- if(compose_list) {
- for (elem = compose_list; elem != NULL && elem->data != NULL; elem = elem->next) {
+ GList *compose_list = compose_get_compose_list();
+ GList *elem = NULL;
+
+ if (compose_list) {
+ for (elem = compose_list; elem != NULL && elem->data != NULL;
+ elem = elem->next) {
Compose *c = (Compose*)elem->data;
compose_draft(c);
}
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();
- if (prefs_common.warn_queued_on_exit)
- { /* disable the popup */
+ if (prefs_common.warn_queued_on_exit) {
+ /* disable the popup */
prefs_common.warn_queued_on_exit = FALSE;
app_will_exit(NULL, static_mainwindow);
prefs_common.warn_queued_on_exit = TRUE;