.hg and .ccg files shall not belong to Glade



This message might be of interest to you if you have pulled a copy of the gtkmm source code from the git repository.

After I upgraded to Ubuntu 12.04 the file manager Nautilus presents .ccg and .hg files (input to gmmproc) as "Glade project" files. When I double-click one of those files, Glade is started (used to be Gedit).

It's because of this entry in /usr/share/mime/packages/freedesktop.org.xml:

<mime-type type="application/x-glade">
<comment>Glade project</comment>
-----
<sub-class-of type="application/xml"/>
<generic-icon name="x-office-document"/>
<glob pattern="*.glade"/>
<glob pattern="*.ui"/>
<magic priority="50">
<match value="&lt;glade-interface" type="string" offset="0:256"/>
<match value="gtk" type="string" offset="0:256"/>
</magic>
</mime-type>

Files that contain "gtk" in the first 256 (257?) bytes are classified as application/x-glade files, unless overridden by another mime-type declaration.

The easiest way to override this annoying mime-declaration is to specify what *.hg and *.ccg files are. It can be done with the attached file or something similar. Store it in ~/.local/share/mime/packages or /usr/share/mime/packages and run command

   update-mime-database ~/.local/share/mime
or
   update-mime-database /usr/share/mime

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info";>
  <mime-type type="text/x-gmmproc-c++src">
    <comment>gmmproc C++ source code</comment>
    <comment xml:lang="sv">gmmproc C++-källkod</comment>
    <sub-class-of type="text/x-c++src"/>
    <glob pattern="*.ccg"/>
  </mime-type>
  <mime-type type="text/x-gmmproc-c++hdr">
    <comment>gmmproc C++ header</comment>
    <comment xml:lang="sv">gmmproc C++-huvud</comment>
    <sub-class-of type="text/x-c++hdr"/>
    <glob pattern="*.hg"/>
  </mime-type>
</mime-info>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]