~ubuntu-branches/ubuntu/precise/evince/precise-updates

« back to all changes in this revision

Viewing changes to shell/ev-utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-06-02 10:30:12 UTC
  • mfrom: (1.1.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20090602103012-liwypsthciko6ae9
Tags: 2.27.1-0ubuntu1
* New upstream version:
  New Features and UI Improvements:
  - Use GtkPrintOperation when printing for the backends that
    support rendering into a cairo context 
  - Recover previous session when running evince after a crash
  - Preliminary annotations support
  - Rename Print Setup menu entry as Page Setup for consistency with
    the GTK+ dialog title 
  - Added F3 as a find-next accelerator key 
  - Support the free Gna! unrar tool in comics backend
  - Add evince-previewer as a separate applicaton that implements
    the printing preview 
  Bug fixes:
  - Fix handling of the tmp folder 
  - Abort dnd operations originated in the same Evince window  
  - Disable bouncing during scrolling 
  - Fix build without gconftool-2 
  - Fix documentation build 
  - Fix error handling of broken documents 
  - Fix several memory leaks in comics backend 
  - Escape URIs for display 
  - Resync with libegg to remove deprecated GTK+ symbols
  - Correct check for exit status of commands in comics backend
  - Add -no-undefined flag for Cygwin build 
  - Use g_file_make_symbolic_link to create symlinks 
  - Delete the temp symlink created when opening a copy
  - Don't redraw again when zoom is set more than once to the same
    scale factor 
  - Fix print preview of empty selection 
  - Don't prevent unmounting in case the initial cwd is on an external device 
  - Create and load the document based on the mime-type provided by
    nautilus instead of using our own documents factory.
  - Fix endianess issues in dvi and tiff backends 
  - Fix memory leak in tiff backend 
  - Fix path where accels file is saved 
  - Fix fading animations 
  - Translate the categories in the nautilus properties tab
* debian/control.in:
  - updated libpoppler and gtk requirements
* debian/patches/01_launchpad.patch:
  - new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
400
400
        return NULL;
401
401
}
402
402
 
 
403
#define XDIGIT(c) ((c) <= '9' ? (c) - '0' : ((c) & 0x4F) - 'A' + 10)
 
404
#define HEXCHAR(s) ((XDIGIT (s[1]) << 4) + XDIGIT (s[2]))
 
405
 
 
406
static char *
 
407
uri_decoded_copy (const char *part, int length)
 
408
{
 
409
        unsigned char *s, *d;
 
410
        char *decoded = g_strndup (part, length);
 
411
 
 
412
        s = d = (unsigned char *)decoded;
 
413
        do {
 
414
                if (*s == '%') {
 
415
                        if (!g_ascii_isxdigit (s[1]) ||
 
416
                            !g_ascii_isxdigit (s[2])) {
 
417
                                g_free (decoded);
 
418
                                return NULL;
 
419
                        }
 
420
                        *d++ = HEXCHAR (s);
 
421
                        s += 2;
 
422
                } else
 
423
                        *d++ = *s;
 
424
        } while (*s++);
 
425
 
 
426
        return decoded;
 
427
}
 
428
 
 
429
char* escape_uri_for_display (const char *uri)
 
430
{
 
431
        GFile *file;
 
432
        char *disp;
 
433
        char *filename;
 
434
 
 
435
        file = g_file_new_for_uri (uri);
 
436
        filename = g_file_get_parse_name (file);
 
437
        disp = uri_decoded_copy (filename, strlen (filename));
 
438
        g_free (filename);
 
439
        g_object_unref (file);
 
440
 
 
441
        return disp;
 
442
}