/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to diff.py

  • Committer: Rene Huber
  • Date: 2009-07-03 21:46:25 UTC
  • mto: This revision was merged to the branch mainline in revision 657.
  • Revision ID: rhuber@ubuntu-20090703214625-hdi83fta48zwq88t
Workaround of gtksourceview2 guess_language() for Hardy

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        if have_gtksourceview:
67
67
            self.buffer = gtksourceview2.Buffer()
68
68
            slm = gtksourceview2.LanguageManager()
69
 
            gsl = slm.guess_language(content_type="text/x-patch")
 
69
            gsl = None
 
70
            for lang_id in slm.get_language_ids():
 
71
                lang = slm.get_language(lang_id)
 
72
                if "text/x-patch" in lang.get_mime_types():
 
73
                    gsl = lang
 
74
                    break
70
75
            if have_gconf:
71
76
                self.apply_gedit_colors(self.buffer)
72
77
            self.apply_colordiff_colors(self.buffer)