I would like to set Qt Creator (the one which is in the Nokia Qt SDK, not the one in Canonical PPAs) as the default program to open .pro Qt project files. But it appears that my Ubuntu install (12.04 while I am writing the question) recognizes .pro files as plain text files instead of Qt project files. I know that I could fix the problem by setting Qt Creator as the default program for opening plain text files but I want to keep on opening plain text files with the program I currently use for this (gedit).
So my question is : how can I do for making my Ubuntu install recognizing .pro files as Qt project files instead of plain text files ?
NB : I have already looked at Ubuntu Tweak to associate Qt project files with Qt Creator but I did not find anything relevant (perhaps I missed it too).
EDIT : the solution is in the Edit of Kalle Elmér's answer.
You can change the default application this way:
- Right click a .pro file.
- Click "Properties".
- Select the "Open With" tab.
- Click "Show other applications" if needed.
- Select the application you want from the list.
- Click "Set as default".
This should change the default application used for all .pro files.
Edit:
This won't work with .pro files, as they are associated with the "text/plain" type. The steps above are provided by air-dex in a comment.
- Write an XML file like the shinythings-shiny.xml file in the xdg-mime man page (http://linux.die.net/man/1/xdg-mime). The type can be called, for example, "text/qt-project-file". Set the pattern to "*.pro". Add a tag saying that the custom MIME type is a subtype of text/plain too.
- Execute the following command :
sudo xdg-mime install
. Sudo must be used. - Select the default program just like explained above.
These steps can be used for any file extension. Just replace .pro with the extension and choose a suitable name to replace "text/qt-project-file".
No comments:
Post a Comment