~unity-team/unity-lens-video/raring

« back to all changes in this revision

Viewing changes to src/utils.vala

  • Committer: Pawel Stolowski
  • Date: 2012-11-09 15:11:21 UTC
  • mto: (101.4.2 video-vala)
  • mto: This revision was merged to the branch mainline in revision 106.
  • Revision ID: pawel.stolowski@canonical.com-20121109151121-bhlwp0mjzotkmbef
More cleanups. Created first unit test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
  public bool is_video (string path)
31
31
  {
 
32
//    warning ("path: %s\n", path);
32
33
    var file = GLib.File.new_for_path (path);
33
34
    if (file.query_exists (null))
34
35
    {
35
36
      if (file.query_file_type (GLib.FileQueryInfoFlags.NONE, null) == GLib.FileType.REGULAR)
36
37
      {
37
38
        var content_type = file.query_info ("standard::content-type", GLib.FileQueryInfoFlags.NONE, null).get_content_type ();
 
39
        //      warning ("C:%s\n", content_type);
38
40
        return content_type.contains ("video");
39
41
      }
40
42
    }