+/* EvJobAttachments */
+static void
+ev_job_attachments_init (EvJobAttachments *job)
+{
+ EV_JOB (job)->run_mode = EV_JOB_RUN_THREAD;
+}
+
+static void
+ev_job_attachments_dispose (GObject *object)
+{
+ EvJobAttachments *job;
+
+ ev_debug_message (DEBUG_JOBS, NULL);
+
+ job = EV_JOB_ATTACHMENTS (object);
+
+ if (job->attachments) {
+ g_list_foreach (job->attachments, (GFunc)g_object_unref, NULL);
+ g_list_free (job->attachments);
+ job->attachments = NULL;
+ }
+
+ (* G_OBJECT_CLASS (ev_job_attachments_parent_class)->dispose) (object);
+}
+
+static gboolean
+ev_job_attachments_run (EvJob *job)
+{
+ EvJobAttachments *job_attachments = EV_JOB_ATTACHMENTS (job);
+
+ ev_debug_message (DEBUG_JOBS, NULL);
+ ev_profiler_start (EV_PROFILE_JOBS, "%s (%p)", EV_GET_TYPE_NAME (job), job);
+
+ ev_document_doc_mutex_lock ();
+ job_attachments->attachments = ev_document_get_attachments (job->document);
+ ev_document_doc_mutex_unlock ();
+
+ ev_job_succeeded (job);
+
+ return FALSE;
+}
+
+static void
+ev_job_attachments_class_init (EvJobAttachmentsClass *class)
+{
+ GObjectClass *oclass = G_OBJECT_CLASS (class);
+ EvJobClass *job_class = EV_JOB_CLASS (class);
+
+ oclass->dispose = ev_job_attachments_dispose;
+ job_class->run = ev_job_attachments_run;
+}
+
+EvJob *
+ev_job_attachments_new (EvDocument *document)
+{
+ EvJob *job;
+
+ ev_debug_message (DEBUG_JOBS, NULL);
+
+ job = g_object_new (EV_TYPE_JOB_ATTACHMENTS, NULL);
+ job->document = g_object_ref (document);
+
+ return job;
+}
+