1

I have two versions of qtcreator: first is installed by apt and binary is located in /usr/bin/. Second is installed in a custom location (I used a bundle from qt website). I run second version from terminal and then I choose option Lock to Launcher for qt icon. When I close qtcreator and launch again using that icon I get qtcreator from /usr/bin. Why ? How to fix it ?

Irbis
  • 507
  • 3
  • 7
  • 16

1 Answers1

1

To force the qtcreator launcher to point to the right location you can copy the .desktop file of the version installed by apt-get in your $XDG_DATA_HOME folder (default is ~/.local/share)

  1. Open a terminal and copy the /usr/share/applications/qtcreator.desktop file to ~/.local/share/applications :

    cp /usr/share/applications/qtcreator.desktop ~/.local/share/applications
    
  2. Edit the Exec= command to use your custom location:

    [Desktop Entry]
    Exec=<path_to_your_custom_location>/qtcreator %F
    Icon=QtProject-qtcreator
    Type=Application
    Terminal=false
    Name=Qt Creator
    GenericName=Integrated Development Environment
    MimeType=text/x-c++src;text/x-c++hdr;text/x-xsrc;application/x-designer;application/vnd.nokia.qt.qmakeprofile;application/vnd.nokia.xml.qt.resource;
    Categories=Qt;Development;IDE;
    InitialPreference=9
    
  3. Now if you lock this new .desktop file in your Unity Launcher it should start the right version.

Reference: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

  • It works only if I modify a file which is located in /usr/share/applications – Irbis Oct 23 '14 at 08:33
  • 1
    @Irbis: you have to unlock qtcreator from the launcher and start the custom .dekstop one from nautilus. Ensure that the custom one has the +x permission. Lock it to the launcher and it should always use the custom location – Sylvain Pineau Oct 23 '14 at 08:54
  • 1
    @Irbis: Or simpler, open it with the Dash. it should use the right version – Sylvain Pineau Oct 23 '14 at 08:56