~ubuntu-branches/ubuntu/wily/gnomad2/wily

« back to all changes in this revision

Viewing changes to src/filesystem.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2009-07-14 14:34:33 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714143433-emhbpl3an6jqccdj
Tags: 2.9.4-0ubuntu1
* New upstream release (LP: #358944)
* debian/control: Add build-depends on intltool (>= 0.35.0).
* debian/watch: Update to handle Sourceforge location.
* Drop patch in src/jukebox.c, src/tagfile.c, and gnomad2.desktop.in.
  There are merged upstream.
* Include inline patch in src/filesystem.c and src/jukebox.c to fix a 100% 
  CPU use. Thanks Chris Vine for the patch (LP: #360442)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "mp3file.h"
26
26
#include "id3read.h"
27
27
#include "wmaread.h"
28
 
#include "wavfile.h"
 
28
#include "riffile.h"
29
29
#include "xfer.h"
30
30
#ifdef HAVE_TAGLIB
31
31
#include "tagfile.h"
74
74
  GList *metalist;
75
75
} metadata_set_args_t;
76
76
 
 
77
static gboolean call_gtk_widget_destroy(gpointer w) {
 
78
  gtk_widget_destroy(w);
 
79
  return FALSE;
 
80
}
 
81
 
77
82
static gboolean draw_label(gpointer p) {
78
83
  draw_label_args_t *args = (draw_label_args_t *) p;
79
84
  
341
346
          /* Only display valid files */
342
347
          if (g_ascii_strcasecmp(tmp+1,"mp3") &&
343
348
              g_ascii_strcasecmp(tmp+1,"wav") &&
 
349
              g_ascii_strcasecmp(tmp+1,"avi") &&
 
350
              g_ascii_strcasecmp(tmp+1,"wmv") &&
344
351
              g_ascii_strcasecmp(tmp+1,"wma")
345
352
#ifdef HAVE_LIBMTP
346
353
              // Additional music codecs supported by libmtp
514
521
           get_tag_for_file(meta);
515
522
#endif
516
523
        }
 
524
        if (!strcmp(meta->codec,"AVI")) {
 
525
           get_tag_for_avifile(meta);
 
526
        }
517
527
        // Implement getting track metadata for the other libmtp
518
528
        // supported filetypes here...
519
529
        if (!strcmp(meta->codec,"MP2")) {
648
658
  metarg->metalist = metalist;
649
659
  g_idle_add(update_metadata,metarg);
650
660
 
651
 
  g_idle_add((GSourceFunc) gtk_widget_destroy, args->dialog);
 
661
  g_idle_add(call_gtk_widget_destroy, args->dialog);
652
662
  g_free(args->path);
653
663
  g_free(args);
654
664
  return NULL;
822
832
    /* g_print("Deleting: %s\n", meta->path); */
823
833
    tmp = filename_fromutf8(meta->path);
824
834
 
825
 
    /* Skip past current and parent directory if selected */
826
 
    if (!strcmp(tmp, ".") || !strcmp(tmp, "..")) {
 
835
    /*
 
836
     * Skip past current and parent directory if selected.
 
837
     * Be sure to avoid also /foo/bar/.. and /foo/bar/.
 
838
     */
 
839
    if (
 
840
        (strlen(tmp) >= 1 && !strcmp(tmp+strlen(tmp)-1, "."))
 
841
        ||
 
842
        (strlen(tmp) >= 2 && !strcmp(tmp+strlen(tmp)-2, ".."))
 
843
        ) {
 
844
      g_print("Skipping deletion of: %s\n", meta->path);
 
845
      g_free(tmp);
 
846
      tmplist = tmplist->next;
827
847
      continue;
828
848
    }
829
849