diff options
author | Radek Doulik <rodo@helixcode.com> | 2000-11-15 16:45:22 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2000-11-15 16:45:22 +0800 |
commit | c9c591526f3104831f2ccefaf907cee6bd0ac2d5 (patch) | |
tree | 1434e4d3bde969171826a070c3bb54384ea765db /composer/e-msg-composer.c | |
parent | 7384e82aa7369af5d6aa07afd856a5f9cf1f6841 (diff) | |
download | gsoc2013-evolution-c9c591526f3104831f2ccefaf907cee6bd0ac2d5.tar.gz gsoc2013-evolution-c9c591526f3104831f2ccefaf907cee6bd0ac2d5.tar.zst gsoc2013-evolution-c9c591526f3104831f2ccefaf907cee6bd0ac2d5.zip |
e_msg_composer_guess_mime_type renamed and moved
2000-11-15 Radek Doulik <rodo@helixcode.com>
* e-msg-composer.h: e_msg_composer_guess_mime_type renamed and
moved mime_guess_type_from_file_name from camel as it uses VFS
svn path=/trunk/; revision=6579
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 72c74ecc10..4472bae4eb 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -204,7 +204,7 @@ add_inlined_image (gpointer key, gpointer value, gpointer data) camel_data_wrapper_construct_from_stream (wrapper, stream); camel_object_unref (CAMEL_OBJECT (stream)); - mime_type = mime_guess_type_from_file_name (file_name); + mime_type = e_msg_composer_guess_mime_type (file_name); camel_data_wrapper_set_mime_type (wrapper, mime_type ? mime_type : "application/octet-stream"); g_free (mime_type); @@ -1394,9 +1394,12 @@ e_msg_composer_construct (EMsgComposer *composer) e_msg_composer_show_attachments (composer, FALSE); - /* Set focus on the `To:' field. */ + /* Set focus on the `To:' field. - gtk_widget_grab_focus (e_msg_composer_hdrs_get_to_entry (E_MSG_COMPOSER_HDRS (composer->hdrs))); + gtk_widget_grab_focus (e_msg_composer_hdrs_get_to_entry (E_MSG_COMPOSER_HDRS (composer->hdrs))); + GTK_WIDGET_SET_FLAGS (composer->editor, GTK_CAN_FOCUS); + gtk_window_set_focus (GTK_WINDOW (composer), composer->editor); */ + gtk_widget_grab_focus (composer->editor); } static EMsgComposer * @@ -2001,3 +2004,23 @@ e_msg_composer_get_send_html (EMsgComposer *composer) return composer->send_html; } + + +gchar * +e_msg_composer_guess_mime_type (const gchar *file_name) +{ + GnomeVFSFileInfo info; + GnomeVFSResult result; + + result = gnome_vfs_get_file_info (file_name, &info, + GNOME_VFS_FILE_INFO_GET_MIME_TYPE | + GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (result == GNOME_VFS_OK) { + gchar *type; + + type = g_strdup (gnome_vfs_file_info_get_mime_type (&info)); + gnome_vfs_file_info_unref (&info); + return type; + } else + return NULL; +} |