~mfisch/brasero/update-to-3.8.0

« back to all changes in this revision

Viewing changes to libbrasero-burn/burn-mkisofs-base.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-07-14 14:13:00 UTC
  • mfrom: (1.1.25 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714141300-e08q13sp48b2xzwd
Tags: 2.27.4-0ubuntu1
* New upstream release: (LP: #399112)
  - Hal support removed, now relies on GIO only for drives/media probing
  - New layout for size reporting in data/audio/video project
  - Lot's of bug fixes
  - Fixed some memleaks
  - Bump libbrasero-media version to reflect changes (important to packagers)
  - Fix #582261 – brasero shows 0% done, while continues burning disc
  - Fix #582513 – Bogus VIDEO_TS directory error if AUDIO_TS directory present
  - Fix #573805 – "Increase compatibility with Windows systems"?
  - Fix #585190 – remove 0 from 03 % status
  - Fix #586744 – Use AS_HELP_STRING for configure switches
  - Fix #584793 – Poor language in warning dialog when attempting to burn an audio CD onto a CDRW
  - Fix #580617 – Brasero floods .xsession-errors log with "Unknown (or already deleted) monitored directory" warnings
  - Fix #563501 – Brasero burning window shouldn't try to show drive speed while is converting audio files
  - Fix #485719 – Burn dialog CD icon
  - Fix #585481 – Deep hierarchy warning
  - Fix #554070 – The need of a "replace all" and "replace non" button
  - Fix #582461 – Brasero hangs at normalizing tracks
  - Fix #587284 – nautilus hangs every time
  - Fix #574093 – Caret visible in instructions for project creation
  - Fix #581742 – port from HAL to DeviceKit-disks
  - Fix #573801 – Bad error message when burning empty burn:///
  - Fix #573486 – Various i18n and string issues for good
  - Fix #587399 – License clarification
  - Fix #587554 – Unclear meaning of text
  - Fix #582979 – brasero should not include Categories in mime handler .desktop files
  - Fix #586040 – duplicated command listed in open-with dialog
  - Fixes for #573486 – Various i18n and string issues
* debian/control.in:
  - Add in missing comma in brasero suggests

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
        gint forbidden;
133
133
        gchar *character;
134
134
        gchar *localpath;
135
 
        gchar *unescaped_uri;
136
135
        BraseroBurnResult result = BRASERO_BURN_OK;
137
136
 
138
137
        /* make sure uri is local: otherwise error out */
139
138
        /* FIXME: uri can be path or URI? problem with graft->uri */
140
139
        if (uri && uri [0] == '/') {
141
 
                localpath = g_strdup (unescaped_uri);
 
140
                localpath = g_strdup (uri);
142
141
        }
143
142
        else if (uri && g_str_has_prefix (uri, "file://")) {
144
143
                gchar *unescaped_uri;
495
494
}
496
495
 
497
496
static BraseroBurnResult
 
497
brasero_mkisofs_base_create_video_empty (BraseroMkisofsBase *base,
 
498
                                         const gchar *disc_path)
 
499
{
 
500
        gchar *path;
 
501
 
 
502
        BRASERO_BURN_LOG ("Creating an empty Video or Audio directory");
 
503
 
 
504
        if (base->found_video_ts)
 
505
                return BRASERO_BURN_OK;
 
506
 
 
507
        base->found_video_ts = TRUE;
 
508
 
 
509
        path = g_build_path (G_DIR_SEPARATOR_S,
 
510
                             base->videodir,
 
511
                             disc_path,
 
512
                             NULL);
 
513
 
 
514
        g_mkdir_with_parents (path, S_IRWXU);
 
515
        g_free (path);
 
516
 
 
517
        return BRASERO_BURN_OK;
 
518
}
 
519
 
 
520
static BraseroBurnResult
498
521
brasero_mkisofs_base_empty_directory (BraseroMkisofsBase *base,
499
522
                                      const gchar *disc_path,
500
523
                                      GError **error)
504
527
        gchar *graft_point;
505
528
        const gchar *path;
506
529
 
 
530
        /* This is a special case when the URI is NULL which can happen mainly
 
531
         * when we have to deal with burn:// uri. */
 
532
        if (base->videodir) {
 
533
                /* try with "VIDEO_TS", "VIDEO_TS/", "VIDEO_TS/" and "/VIDEO_TS/"
 
534
                 * to make sure we don't miss one */
 
535
                if (!strcmp (disc_path, "VIDEO_TS")
 
536
                ||  !strcmp (disc_path, "/VIDEO_TS")
 
537
                ||  !strcmp (disc_path, "VIDEO_TS/")
 
538
                ||  !strcmp (disc_path, "/VIDEO_TS/")) {
 
539
                        brasero_mkisofs_base_create_video_empty (base, disc_path);
 
540
 
 
541
                        /* NOTE: joliet cannot be used in this case so that's
 
542
                         * perfectly fine to forget about it. */
 
543
                        return BRASERO_BURN_OK;
 
544
                }
 
545
        }
 
546
 
507
547
        /* Mangle the name in case joliet is required */
508
548
        if (base->use_joliet) {
509
549
                base->joliet = brasero_mkisofs_base_mangle_joliet_name (base->joliet,
531
571
        gchar *path;
532
572
        int res;
533
573
 
534
 
        path = g_filename_from_uri (graft->uri, NULL, NULL);
 
574
        /* Make sure it's a path and not a URI */
 
575
        if (!strncmp (graft->uri, "file:", 5))
 
576
                path = g_filename_from_uri (graft->uri, NULL, NULL);
 
577
        else
 
578
                path = g_strdup (graft->uri);
 
579
 
535
580
        if (g_str_has_suffix (path, G_DIR_SEPARATOR_S)) {
536
581
                gchar *tmp;
537
582
 
601
646
         * passed by the calling plugins. */
602
647
        if (base->videodir) {
603
648
                BraseroBurnResult res;
 
649
                gchar *parent;
604
650
 
605
651
                /* try with "VIDEO_TS", "VIDEO_TS/", "VIDEO_TS/" and "/VIDEO_TS/"
606
652
                 * to make sure we don't miss one */
607
 
                if (!strcmp (graft->path , "VIDEO_TS")
608
 
                ||  !strcmp (graft->path , "/VIDEO_TS")
609
 
                ||  !strcmp (graft->path , "VIDEO_TS/")
610
 
                ||  !strcmp (graft->path , "/VIDEO_TS/")) {
 
653
                if (!strcmp (graft->path, "VIDEO_TS")
 
654
                ||  !strcmp (graft->path, "/VIDEO_TS")
 
655
                ||  !strcmp (graft->path, "VIDEO_TS/")
 
656
                ||  !strcmp (graft->path, "/VIDEO_TS/")) {
611
657
                        res = brasero_mkisofs_base_process_video_graft (base, graft, error);
612
658
                        if (res != BRASERO_BURN_OK)
613
659
                                return res;
615
661
                        base->found_video_ts = TRUE;
616
662
                        return BRASERO_BURN_OK;
617
663
                }
618
 
                else if (!strcmp (graft->path , "AUDIO_TS")
619
 
                     ||  !strcmp (graft->path , "/AUDIO_TS")
620
 
                     ||  !strcmp (graft->path , "AUDIO_TS/")
621
 
                     ||  !strcmp (graft->path , "/AUDIO_TS/"))
622
 
                        return brasero_mkisofs_base_process_video_graft (base, graft, error);
 
664
 
 
665
                if (!strcmp (graft->path, "AUDIO_TS")
 
666
                ||  !strcmp (graft->path, "/AUDIO_TS")
 
667
                ||  !strcmp (graft->path, "AUDIO_TS/")
 
668
                ||  !strcmp (graft->path, "/AUDIO_TS/"))
 
669
                        return brasero_mkisofs_base_process_video_graft (base, graft, error);
 
670
 
 
671
                /* it could also be a direct child of the VIDEO_TS directory */
 
672
                parent = g_path_get_dirname (graft->path);
 
673
                if (!strcmp (parent, "VIDEO_TS")
 
674
                ||  !strcmp (parent, "/VIDEO_TS")
 
675
                ||  !strcmp (parent, "VIDEO_TS/")
 
676
                ||  !strcmp (parent, "/VIDEO_TS/")) {
 
677
                        if (!base->found_video_ts)
 
678
                                brasero_mkisofs_base_create_video_empty (base, parent);
 
679
 
 
680
                        g_free (parent);
 
681
                        return brasero_mkisofs_base_process_video_graft (base, graft, error);
 
682
                }
 
683
                g_free (parent);
623
684
        }
624
685
 
625
686
        /* add the graft point */