diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-11-08 01:44:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-11-08 03:01:46 +0800 |
commit | 86ecfc50539ddef82205551c11a6a13b135bbab4 (patch) | |
tree | cc25ca582935748885a23d665a1d9e1bbc1d4d9c /e-util/e-util.c | |
parent | aa66a17e401d73cbe394ed7f99bf73350e9b938b (diff) | |
download | gsoc2013-evolution-86ecfc50539ddef82205551c11a6a13b135bbab4.tar.gz gsoc2013-evolution-86ecfc50539ddef82205551c11a6a13b135bbab4.tar.zst gsoc2013-evolution-86ecfc50539ddef82205551c11a6a13b135bbab4.zip |
Convert some "Save As" actions to run asynchronously.
This introduces e-shell-utils for miscellaneous utility functions
that integrate with the shell or shell settings. First function
is e_shell_run_save_dialog(), which automatically remembers the
selected folder in the file chooser dialog.
Also, kill some redundant save dialog functions, as well as some
write-this-string-to-disk functions that block.
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r-- | e-util/e-util.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index bf1f387d15..9ad252a37d 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -618,65 +618,6 @@ e_int_compare (gconstpointer x, gconstpointer y) return (nx == ny) ? 0 : (nx < ny) ? -1 : 1; } -gboolean -e_write_file_uri (const gchar *filename, - const gchar *data) -{ - gboolean res; - gsize length; - GFile *file; - GOutputStream *stream; - GError *error = NULL; - - g_return_val_if_fail (filename != NULL, FALSE); - g_return_val_if_fail (data != NULL, FALSE); - - length = strlen (data); - - /* if it is uri, then create file for uri, otherwise for path */ - if (strstr (filename, "://")) - file = g_file_new_for_uri (filename); - else - file = g_file_new_for_path (filename); - - if (!file) { - g_warning ("Couldn't save item"); - return FALSE; - } - - stream = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &error)); - g_object_unref (file); - - if (!stream || error) { - g_warning ("Couldn't save item%s%s", error ? ": " : "", error ? error->message : ""); - - if (stream) - g_object_unref (stream); - - if (error) - g_error_free (error); - - return FALSE; - } - - res = g_output_stream_write_all (stream, data, length, NULL, NULL, &error); - - if (error) { - g_warning ("Couldn't save item: %s", error->message); - g_clear_error (&error); - } - - g_output_stream_close (stream, NULL, &error); - g_object_unref (stream); - - if (error) { - g_warning ("Couldn't close output stream: %s", error->message); - g_error_free (error); - } - - return res; -} - /** * e_color_to_value: * color: a #GdkColor |