#include <glib-object.h>
#include <gio/gio.h>
Go to the source code of this file.
|
GType | ev_attachment_get_type (void) G_GNUC_CONST |
|
GQuark | ev_attachment_error_quark (void) G_GNUC_CONST |
|
EvAttachment * | ev_attachment_new (const gchar *name, const gchar *description, GTime mtime, GTime ctime, gsize size, gpointer data) |
|
const gchar * | ev_attachment_get_name (EvAttachment *attachment) |
|
const gchar * | ev_attachment_get_description (EvAttachment *attachment) |
|
GTime | ev_attachment_get_modification_date (EvAttachment *attachment) |
|
GTime | ev_attachment_get_creation_date (EvAttachment *attachment) |
|
const gchar * | ev_attachment_get_mime_type (EvAttachment *attachment) |
|
gboolean | ev_attachment_save (EvAttachment *attachment, GFile *file, GError **error) |
|
gboolean | ev_attachment_open (EvAttachment *attachment, GdkScreen *screen, guint32 timestamp, GError **error) |
|
#define EV_IS_ATTACHMENT |
( |
|
object) | |
(G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_ATTACHMENT)) |
#define EV_IS_ATTACHMENT_CLASS |
( |
|
klass) | |
(G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_ATTACHMENT)) |
GQuark ev_attachment_error_quark |
( |
void |
) | |
|
Definition at line 57 of file ev-attachment.c.
59 static GQuark error_quark = 0;
63 g_quark_from_static_string (
"ev-attachment-error-quark");
GTime ev_attachment_get_creation_date |
( |
EvAttachment * |
attachment) | |
|
const gchar* ev_attachment_get_description |
( |
EvAttachment * |
attachment) | |
|
const gchar* ev_attachment_get_mime_type |
( |
EvAttachment * |
attachment) | |
|
GTime ev_attachment_get_modification_date |
( |
EvAttachment * |
attachment) | |
|
const gchar* ev_attachment_get_name |
( |
EvAttachment * |
attachment) | |
|
GType ev_attachment_get_type |
( |
void |
) | |
|
EvAttachment* ev_attachment_new |
( |
const gchar * |
name, |
|
|
const gchar * |
description, |
|
|
GTime |
mtime, |
|
|
GTime |
ctime, |
|
|
gsize |
size, |
|
|
gpointer |
data |
|
) |
| |
gboolean ev_attachment_open |
( |
EvAttachment * |
attachment, |
|
|
GdkScreen * |
screen, |
|
|
guint32 |
timestamp, |
|
|
GError ** |
error |
|
) |
| |
Definition at line 395 of file ev-attachment.c.
401 gboolean retval =
FALSE;
405 if (!attachment->priv->app) {
406 app_info = g_app_info_get_default_for_type (attachment->priv->mime_type,
FALSE);
407 attachment->priv->app = app_info;
410 if (!attachment->priv->app) {
414 _(
"Couldn’t open attachment “%s”"),
415 attachment->priv->name);
420 if (attachment->priv->tmp_file) {
430 template = g_strdup_printf (
"%s.XXXXXX", basename);
436 if (attachment->priv->tmp_file)
437 g_object_unref (attachment->priv->tmp_file);
438 attachment->priv->tmp_file = g_object_ref (file);
444 g_object_unref (file);
gboolean ev_attachment_save |
( |
EvAttachment * |
attachment, |
|
|
GFile * |
file, |
|
|
GError ** |
error |
|
) |
| |
Definition at line 291 of file ev-attachment.c.
295 GFileOutputStream *output_stream;
296 GError *ioerror = NULL;
297 gssize written_bytes;
300 g_return_val_if_fail (G_IS_FILE (file),
FALSE);
302 output_stream = g_file_replace (file, NULL,
FALSE, 0, NULL, &ioerror);
303 if (output_stream == NULL) {
306 uri = g_file_get_uri (file);
310 _(
"Couldn’t save attachment “%s”: %s"),
314 g_error_free (ioerror);
320 written_bytes = g_output_stream_write (G_OUTPUT_STREAM (output_stream),
321 attachment->priv->data,
322 attachment->priv->size,
324 if (written_bytes == -1) {
327 uri = g_file_get_uri (file);
331 _(
"Couldn’t save attachment “%s”: %s"),
335 g_output_stream_close (G_OUTPUT_STREAM (output_stream), NULL, NULL);
336 g_error_free (ioerror);
342 g_output_stream_close (G_OUTPUT_STREAM (output_stream), NULL, NULL);