From f9804e11931411358ce98ad5a7726de6d68f2115 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 12 Nov 2002 14:59:35 +0000 Subject: Commented out stuff that doesn't build yet. Also fixed idl build rule. 2002-11-13 Not Zed * Makefile.am: Commented out stuff that doesn't build yet. Also fixed idl build rule. importers still not built. * main.c (main): bonobactivationise. remove push visual/colormap. (main): no longer activate activation, let bonobo_init do it. * mail-signature-editor.c (menu_help): Change help api. * mail-session.c (user_message_destroy_noreply): removed. Not used? * mail-local.c (load_metainfo): xml root->children. * mail-format.c (g_string_append_len): Removed, it exists now. 2002-11-12 Not Zed * subscribe-dialog.c: gnome2ised, use gtkdialog. (subscribe_get_global_extras): use a weak ref rather than destroy signal. * message-tag-followup.c: gnome2ised. * message-tag-editor.c: gnome2ised & converted to gtkdialog. * message-list.c: gnome2ised. (message_list_finalise): From destroy method. maybe should be destroy still. * message-browser.c: port to gnome2 (message_browser_finalise): renamed from destroy method. * mail-stream-gtkhtml.c: removed redundant camel_class_get_global_classfuncs() call. * mail-signature-editor.c: gtkdialogised, & bonobo api changes. * mail-search-dialogue.c: gtkdialogised. * mail-folder-cache.c: cleaned up camel ref/hook casts. * mail-composer-prefs.c (mail_composer_prefs_get_type): convert to gtype. * mail-font-prefs.c (mail_font_prefs_destroy): from finalise. * mail-config.c: s/bonobo_config/e_config_listener/ Added /apps/Evolution prefix to the evolution keys. Changed to use e_config_listener, etc. (mail_config_init): remove bonobo_config stuff. (mail_config_check_service): gtk dialogise. (check_response): from check_cancelled. * mail-config-druid.c (mail_config_druid_destroy): renamed from _finalize, turned into destroy handler. (construct): set type to toplevel, GTK_WINDOW_DIALOG no longer exists. * mail-config-factory.c (mail_config_register_factory): bonobo api changes. * mail-crypto.c (mail_crypto_get_pgp_cipher_context): cleaned up unref casts. * mail-display.c (write_data_to_file): gnome->gtkdialog. (on_link_clicked): use ascii_str*cmp on url. (save_part): g_path stuff. (launch_cb): gtk dialog. (pixmap_press): de-oafify. (pixbuf_for_mime_type): gnome-vfs api changes. (do_attachment_header): Change the pixmap to a gtkimage. (do_signature): " (pixbuf_gen_idle): " (do_attachment_header): ascii_str*cmp (do_attachment_header): gnome pixmap->gtkimage. (mail_display_destroy): protect against gtk mentalness. (html_button_press_event): ascii_str*cmp (drag_data_get_cb): added comment for translators of filename. * mail-format.c (component_supports): de-oafise. (is_anonymous): ascii_strncmp (attachment_header): remove utf8<>locale stuff, and gnomevfs api changes. (format_mime_part): fix g_strdown call. (write_field_row_begin): kill utf8->gtk stuff. (write_address): " (default_header_index): ascii_strcasecmp (handle_text_plain): " (handle_text_enriched): " (handle_multipart_encrypted): remove utf/gtk stuff. (handle_message_external_body): ascii_str*cmp * mail-identify.c (mail_identify_mime_part): (identify_by_magic): gnome vfs api changes. * mail-importer.c: Converted. * mail-local.c (load_metainfo): xml childs -> children. (mls_get_folder): g_strerror. (mls_delete_folder): g_strerror. (reconfigure_got_folder): Gnome->GtkDialog (reconfigure_response): from reconfigure_clicked. * mail-mt.c (mail_msg_check_error): gnome -> gtk dialog (error_response): renmae from error_gone. destroy widget on any response. * mail-offline-handler.c (impl_finalise): renamed from impl_destroy since thats what it should be anyway. * mail-ops.c: removed utf8 widget conversion & camel_object_un/ref casts. * mail-preferences.c (mail_preferences_get_type): glib2'ised. * mail-search.c (mail_search_finalise): renmaed from destroy & properly chain. (mail_search_get_type): glib2 & make gtkdialog parent. (entry_run_search): run search when entry activated. not sure if gtkdialog has anohter way to do this on an arbitrary widget. * mail-send-recv.c (dialogue_response): renamed from clicked. Use gtkdialog. * mail-session.c (request_password_deleted): removed, redundant. (pass_response): rename from pass_got, changed for gtkdialog. (user_message_destroy): Removed, redundant. (user_message_response): Renamed from user_message_clicked. 2002-11-11 Not Zed * mail-stream-gtkhtml.c (mail_stream_gtkhtml_class_init): dont use get_global_classfuncs, just get the type * mail-tools.c: converted gnome2 api's. * mail-vfolder.c (vfolder_editor_response): clicked->response. (vfolder_editor_destroy): Removed. (vfolder_edit): gtk dialog api (edit_rule_response): clicked->response. (vfolder_edit_rule): gnomedialog->gtkdialog. (vfolder_gui_add_rule): " (new_rule_clicked): clicked->response svn path=/trunk/; revision=18723 --- mail/mail-local.c | 163 +++++++++++++++++++++++++++--------------------------- 1 file changed, 83 insertions(+), 80 deletions(-) (limited to 'mail/mail-local.c') diff --git a/mail/mail-local.c b/mail/mail-local.c index eba907e178..ccec409a06 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -32,14 +32,11 @@ #include #include -#include -#include -#include +#include #include #include "e-util/e-path.h" #include -#include #include #include "Evolution.h" @@ -151,11 +148,11 @@ load_metainfo(const char *path) if (doc == NULL) goto dodefault; - node = doc->root; + node = doc->children; if (strcmp(node->name, "folderinfo")) goto dodefault; - node = node->childs; + node = node->children; while (node) { if (!strcmp(node->name, "folder")) { char *index, *txt; @@ -239,11 +236,11 @@ mlf_refresh_info(CamelFolder *folder, CamelException *ex) LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_refresh_info(f, ex); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } static void @@ -254,11 +251,11 @@ mlf_sync(CamelFolder *folder, gboolean expunge, CamelException *ex) LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_sync(f, expunge, ex); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } static void @@ -269,11 +266,11 @@ mlf_expunge(CamelFolder *folder, CamelException *ex) LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_expunge(f, ex); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } static void @@ -284,11 +281,11 @@ mlf_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMe LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_append_message(f, message, info, appended_uid, ex); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } static CamelMimeMessage * @@ -300,11 +297,11 @@ mlf_get_message(CamelFolder *folder, const char *uid, CamelException *ex) LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); ret = camel_folder_get_message(f, uid, ex); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); return ret; } @@ -318,11 +315,11 @@ mlf_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); ret = camel_folder_search_by_expression(f, expression, ex); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); return ret; } @@ -336,11 +333,11 @@ mlf_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); ret = camel_folder_search_by_uids(f, expression, uids, ex); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); return ret; } @@ -353,11 +350,11 @@ mlf_search_free(CamelFolder *folder, GPtrArray *result) LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_search_free(f, result); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } static void @@ -368,11 +365,11 @@ mlf_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_set_message_flags(mlf->real_folder, uid, flags, set); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } static void @@ -383,11 +380,11 @@ mlf_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_set_message_user_flag(mlf->real_folder, uid, name, value); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } static void @@ -398,11 +395,11 @@ mlf_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, LOCAL_FOLDER_LOCK(mlf); f = mlf->real_folder; - camel_object_ref((CamelObject *)f); + camel_object_ref(f); LOCAL_FOLDER_UNLOCK(mlf); camel_folder_set_message_user_tag(mlf->real_folder, uid, name, value); - camel_object_unref((CamelObject *)f); + camel_object_unref(f); } /* Internal store-rename call, update our strings */ @@ -437,13 +434,13 @@ mlf_rename(CamelFolder *folder, const char *new) static void mlf_proxy_message_changed(CamelObject *real_folder, gpointer event_data, gpointer user_data) { - camel_object_trigger_event((CamelObject *)user_data, "message_changed", event_data); + camel_object_trigger_event(user_data, "message_changed", event_data); } static void mlf_proxy_folder_changed(CamelObject *real_folder, gpointer event_data, gpointer user_data) { - camel_object_trigger_event((CamelObject *)user_data, "folder_changed", event_data); + camel_object_trigger_event(user_data, "folder_changed", event_data); } static void @@ -453,20 +450,20 @@ mlf_unset_folder (MailLocalFolder *mlf) g_assert(mlf->real_folder); - camel_object_unhook_event(CAMEL_OBJECT(mlf->real_folder), + camel_object_unhook_event(mlf->real_folder, "message_changed", mlf_proxy_message_changed, mlf); - camel_object_unhook_event(CAMEL_OBJECT(mlf->real_folder), + camel_object_unhook_event(mlf->real_folder, "folder_changed", mlf_proxy_folder_changed, mlf); - camel_object_unref((CamelObject *)folder->summary); + camel_object_unref(folder->summary); folder->summary = NULL; - camel_object_unref((CamelObject *)mlf->real_folder); + camel_object_unref(mlf->real_folder); mlf->real_folder = NULL; - camel_object_unref((CamelObject *)mlf->real_store); + camel_object_unref(mlf->real_store); mlf->real_store = NULL; folder->permanent_flags = 0; @@ -502,14 +499,14 @@ mlf_set_folder(MailLocalFolder *mlf, guint32 flags, CamelException *ex) if (mlf->real_folder->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY) { folder->summary = mlf->real_folder->summary; - camel_object_ref((CamelObject *)mlf->real_folder->summary); + camel_object_ref(mlf->real_folder->summary); } folder->permanent_flags = mlf->real_folder->permanent_flags; folder->folder_flags = mlf->real_folder->folder_flags; - camel_object_hook_event((CamelObject *)mlf->real_folder, "message_changed", mlf_proxy_message_changed, mlf); - camel_object_hook_event((CamelObject *)mlf->real_folder, "folder_changed", mlf_proxy_folder_changed, mlf); + camel_object_hook_event(mlf->real_folder, "message_changed", mlf_proxy_message_changed, mlf); + camel_object_hook_event(mlf->real_folder, "folder_changed", mlf_proxy_folder_changed, mlf); return TRUE; } @@ -536,9 +533,9 @@ mlf_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args) /* string to describe a local folder as the location of a message */ pathlen = strlen(evolution_dir) + strlen("local") + 1; if (strlen(folder->full_name) > pathlen) - mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->full_name+pathlen); + mlf->description = g_strdup_printf(_("Local folders/%s"), folder->full_name+pathlen); else - mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->name); + mlf->description = g_strdup_printf(_("Local folders/%s"), folder->name); } *arg->ca_str = mlf->description; break; @@ -622,7 +619,7 @@ mail_local_folder_get_type (void) NULL, mlf_init, mlf_finalize); - mlf_parent_class = (CamelFolderClass *)camel_type_get_global_classfuncs (CAMEL_FOLDER_TYPE); + mlf_parent_class = (CamelFolderClass *)CAMEL_FOLDER_TYPE; } return mail_local_folder_type; @@ -740,7 +737,7 @@ mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, int camel_folder_expunge(fromfolder, ex); d(printf("delete old mbox ...\n")); - camel_object_unref(CAMEL_OBJECT(fromfolder)); + camel_object_unref(fromfolder); fromfolder = NULL; camel_store_delete_folder(fromstore, tmpname, ex); @@ -763,9 +760,9 @@ mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, int if (mlf->real_folder == NULL) mlf_set_folder (mlf, CAMEL_STORE_FOLDER_CREATE, ex); if (fromfolder) - camel_object_unref((CamelObject *)fromfolder); + camel_object_unref(fromfolder); if (fromstore) - camel_object_unref((CamelObject *)fromstore); + camel_object_unref(fromstore); g_free(tmpname); g_free(mbox); @@ -798,7 +795,7 @@ mls_get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelE return NULL; if (!mlf_set_folder(folder, flags, ex)) { - camel_object_unref(CAMEL_OBJECT(folder)); + camel_object_unref(folder); return NULL; } @@ -806,8 +803,8 @@ mls_get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelE if (save_metainfo(folder->meta) == FALSE) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot save folder metainfo to %s: %s"), - folder->meta->path, strerror(errno)); - camel_object_unref(CAMEL_OBJECT (folder)); + folder->meta->path, g_strerror(errno)); + camel_object_unref(folder); return NULL; } } @@ -836,7 +833,7 @@ mls_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex if (real_store == NULL) { g_free(metapath); free_metainfo(meta); - camel_object_unref((CamelObject *)real_store); + camel_object_unref(real_store); return; } @@ -847,7 +844,7 @@ mls_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex camel_exception_xfer(ex, &local_ex); g_free(metapath); free_metainfo(meta); - camel_object_unref((CamelObject *)real_store); + camel_object_unref(real_store); return; } @@ -858,7 +855,7 @@ mls_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex if (unlink(metapath) == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot delete folder metadata %s: %s"), - metapath, strerror(errno)); + metapath, g_strerror(errno)); } g_free(metapath); @@ -938,7 +935,7 @@ mls_rename_folder(CamelStore *store, const char *old_name, const char *new_name, reninfo.new = info; reninfo.old_base = (char *)old_name; - camel_object_trigger_event((CamelObject *)store, "folder_renamed", &reninfo); + camel_object_trigger_event(store, "folder_renamed", &reninfo); } else { g_free(newuri); g_warning("Cannot find existing folder '%s' in table?\n", olduri); @@ -952,7 +949,7 @@ mls_rename_folder(CamelStore *store, const char *old_name, const char *new_name, g_free(newname); g_free(oldname); - camel_object_unref((CamelObject *)real_store); + camel_object_unref(real_store); free_metainfo(meta); @@ -1064,7 +1061,7 @@ static void mail_local_store_add_folder(MailLocalStore *mls, const char *uri, co if (info) { /* FIXME: should copy info, so we dont get a removed while we're using it? */ - camel_object_trigger_event((CamelObject *)mls, "folder_created", info); + camel_object_trigger_event(mls, "folder_created", info); /* this is just so the folder is opened at least once to setup the folder counts etc in the display. Joy eh? The result is discarded. */ @@ -1099,7 +1096,7 @@ static void mail_local_store_remove_folder(MailLocalStore *mls, const char *path LOCAL_STORE_UNLOCK(mls); if (data.info) { - camel_object_trigger_event((CamelObject *)mls, "folder_deleted", data.info); + camel_object_trigger_event(mls, "folder_deleted", data.info); g_free(data.info->url); g_free(data.info->full_name); @@ -1192,7 +1189,7 @@ local_storage_new_folder_cb (EvolutionStorageListener *storage_listener, info.unread_message_count = 0; info.path = (char *)path; - camel_object_trigger_event((CamelObject *)global_local_store, "folder_created", &info); + camel_object_trigger_event(global_local_store, "folder_created", &info); g_free(info.url); camel_url_free(url); } @@ -1233,18 +1230,19 @@ storage_listener_startup (EvolutionShellClient *shellclient) corba_local_storage_listener = evolution_storage_listener_corba_objref ( local_storage_listener); - gtk_signal_connect (GTK_OBJECT (local_storage_listener), - "destroyed", - GTK_SIGNAL_FUNC (local_storage_destroyed_cb), - corba_storage); - gtk_signal_connect (GTK_OBJECT (local_storage_listener), - "new_folder", - GTK_SIGNAL_FUNC (local_storage_new_folder_cb), - corba_storage); - gtk_signal_connect (GTK_OBJECT (local_storage_listener), - "removed_folder", - GTK_SIGNAL_FUNC (local_storage_removed_folder_cb), - corba_storage); + /* FIXME: is this supposed to be destroy? */ + g_signal_connect(local_storage_listener, + "destroyed", + G_CALLBACK (local_storage_destroyed_cb), + corba_storage); + g_signal_connect(local_storage_listener, + "new_folder", + G_CALLBACK (local_storage_new_folder_cb), + corba_storage); + g_signal_connect(local_storage_listener, + "removed_folder", + G_CALLBACK (local_storage_removed_folder_cb), + corba_storage); CORBA_exception_init (&ev); GNOME_Evolution_Storage_addListener (corba_storage, @@ -1370,7 +1368,7 @@ reconfigure_folder_free (struct _mail_msg *mm) } if (m->folder) - camel_object_unref (CAMEL_OBJECT (m->folder)); + camel_object_unref (m->folder); g_free(m->uri); g_free (m->newtype); } @@ -1383,10 +1381,12 @@ static struct _mail_msg_op reconfigure_folder_op = { }; static void -reconfigure_clicked (GnomeDialog *dialog, int button, struct _reconfigure_msg *m) +reconfigure_response(GtkDialog *dialog, int button, struct _reconfigure_msg *m) { - if (button == 0) { + switch(button) { + case GTK_RESPONSE_OK: { GtkWidget *menu, *item; + menu = gtk_option_menu_get_menu(m->optionlist); item = gtk_menu_get_active(GTK_MENU(menu)); m->newtype = g_strdup(gtk_object_get_data((GtkObject *)item, "type")); @@ -1397,21 +1397,24 @@ reconfigure_clicked (GnomeDialog *dialog, int button, struct _reconfigure_msg *m gtk_widget_set_sensitive (m->cancel, FALSE); e_thread_put (mail_thread_queued, (EMsg *)m); - } else { + break; } + case GTK_RESPONSE_CANCEL: + default: if (m->done) m->done(m->uri, NULL, m->done_data); mail_msg_free ((struct _mail_msg *)m); + break; } - - if (button != -1) - gnome_dialog_close (dialog); + + gtk_widget_destroy((GtkWidget *)dialog); + g_object_unref(dialog); } static void reconfigure_got_folder(char *uri, CamelFolder *folder, void *data) { GladeXML *gui; - GnomeDialog *gd; + GtkDialog *gd; struct _reconfigure_msg *m = data; char *title; GList *p; @@ -1440,8 +1443,8 @@ reconfigure_got_folder(char *uri, CamelFolder *folder, void *data) return; } - gui = glade_xml_new (EVOLUTION_GLADEDIR "/local-config.glade", "dialog_format"); - gd = (GnomeDialog *)glade_xml_get_widget (gui, "dialog_format"); + gui = glade_xml_new (EVOLUTION_GLADEDIR "/local-config.glade", "dialog_format", NULL); + gd = (GtkDialog *)glade_xml_get_widget (gui, "dialog_format"); title = g_strdup_printf (_("Reconfigure /%s"), camel_folder_get_full_name (folder)); @@ -1477,7 +1480,7 @@ reconfigure_got_folder(char *uri, CamelFolder *folder, void *data) label = g_strdup_printf("%s (%s)", cp->protocol, _(cp->name)); item = gtk_menu_item_new_with_label(label); g_free(label); - gtk_object_set_data((GtkObject *)item, "type", cp->protocol); + g_object_set_data(G_OBJECT(item), "type", cp->protocol); gtk_widget_show(item); gtk_menu_append(GTK_MENU(menu), item); index++; @@ -1492,8 +1495,8 @@ reconfigure_got_folder(char *uri, CamelFolder *folder, void *data) gtk_label_set_text ((GtkLabel *)glade_xml_get_widget (gui, "label_format"), MAIL_LOCAL_FOLDER (folder)->meta->format); - gtk_signal_connect (GTK_OBJECT (gd), "clicked", reconfigure_clicked, m); - gtk_object_unref (GTK_OBJECT (gui)); + g_signal_connect(gd, "response", G_CALLBACK(reconfigure_response), m); + g_object_unref(gui); g_hash_table_insert (reconfigure_folder_hash, (gpointer) folder, (gpointer) gd); -- cgit