~ubuntu-branches/ubuntu/oneiric/evince/oneiric-updates

« back to all changes in this revision

Viewing changes to libdocument/ev-attachment.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Josselin Mouette, Marc 'HE' Brockschmidt
  • Date: 2008-12-31 16:41:58 UTC
  • mfrom: (1.1.36 upstream)
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 109.
  • Revision ID: james.westby@ubuntu.com-20081231164158-xnobl1sokvvc6ho8
Tags: 2.24.2-1
[ Josselin Mouette ]
* README.Debian: document that you need to install poppler-data.
  Closes: #506836.

[ Marc 'HE' Brockschmidt ]
* debian/control: Make the Gnome team maintainer. I'm not doing the job
   anyway.

[ Josselin Mouette ]
* New upstream release.
* Require nautilus 2.22 to build the extension for the correct 
  version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <config.h>
21
21
#include <glib/gi18n.h>
22
22
#include <glib/gstdio.h>
 
23
#include <gtk/gtk.h>
23
24
#include "ev-file-helpers.h"
24
25
#include "ev-attachment.h"
25
26
 
340
341
 
341
342
static gboolean
342
343
ev_attachment_launch_app (EvAttachment *attachment,
 
344
                          GdkScreen    *screen,
 
345
                          guint32       timestamp,
343
346
                          GError      **error)
344
347
{
345
 
        gboolean result;
346
 
        GList   *files = NULL;
347
 
        GError  *ioerror = NULL;
 
348
        gboolean           result;
 
349
        GList             *files = NULL;
 
350
        GAppLaunchContext *context = NULL;
 
351
        GError            *ioerror = NULL;
348
352
 
349
353
        g_assert (G_IS_FILE (attachment->priv->tmp_file));
350
354
        g_assert (G_IS_APP_INFO (attachment->priv->app));
351
355
 
352
356
        files = g_list_prepend (files, attachment->priv->tmp_file);
 
357
        
 
358
#if GTK_CHECK_VERSION (2, 14, 0)
 
359
        context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ());
 
360
        gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context), screen);
 
361
        gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context), timestamp);
 
362
#endif
353
363
        result = g_app_info_launch (attachment->priv->app, files,
354
 
                                    NULL, &ioerror);
 
364
                                    context, &ioerror);
 
365
        
 
366
        if (context)
 
367
                g_object_unref (context);
355
368
 
356
369
        if (!result) {
357
370
                g_set_error (error,
374
387
 
375
388
gboolean
376
389
ev_attachment_open (EvAttachment *attachment,
 
390
                    GdkScreen    *screen,
 
391
                    guint32       timestamp,
377
392
                    GError      **error)
378
393
{
379
394
        GAppInfo *app_info;
398
413
 
399
414
        if (attachment->priv->tmp_file &&
400
415
            g_file_query_exists (attachment->priv->tmp_file, NULL)) {
401
 
                retval = ev_attachment_launch_app (attachment, error);
 
416
                retval = ev_attachment_launch_app (attachment, screen,
 
417
                                                   timestamp, error);
402
418
        } else {
403
419
                GFile *tmpdir;
404
420
                GFile *file;
411
427
                                g_object_unref (attachment->priv->tmp_file);
412
428
                        attachment->priv->tmp_file = g_object_ref (file);
413
429
 
414
 
                        retval = ev_attachment_launch_app (attachment, error);
 
430
                        retval = ev_attachment_launch_app (attachment, screen,
 
431
                                                           timestamp, error);
415
432
                }
416
433
 
417
434
                g_object_unref (file);