July 26, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

[SOLVED] Single instance applications on N950

Page  
1

Hi to all,

I have a problem creating a Harmattan N950 application.

  1. [Desktop Entry]
  2. Encoding=UTF-8
  3. Version=1.0
  4. Type=Application
  5. Terminal=false
  6. Name=Qt-Complex-Harmattan
  7. Exec=invoker --single-instance --type=d /opt/Qt-Complex-Harmattan/bin/Qt-Complex-Harmattan
  8. Icon=/usr/share/icons/hicolor/scalable/apps/Qt-Complex-Harmattan.svg
  9. X-Window-Icon=
  10. X-HildonDesk-ShowInToolbar=true
  11. X-Osso-Type=application/x-executable

This problem happens also on other applications built in the same way: Qt creator included in Qt SDK 4.7.3 with Qt Quick components 1.2 for Symbian and Meego 1.2.
As you can see in the .desktop file above the application should be installed as single instance
Regardles of these settings installing the package on the device the application can be started more than once. Does anyone knows if there is a workaround to avoid this problem? As a matter of fact it should not be possible to manage multi-instance applications on meego, as I know.

Many thanks.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

49 replies

July 26, 2011

matrixx matrixx
Lab Rat
50 posts

Check from terminal if the installed .desktop file is exactly looking same on device than it’s on QtCreator. If not, this trick will install the file correctly: edit rules file adding a space after MAKE, but remember to preserve the tab between MAKE and the following word, otherwise the rules file will break. Then clean and rebuild everything. It’s a bug in QtCreator which will be fixed for next version. This lifesaver tip was provided by my friend, Attila Chipa :)

 Signature 

Nokia Certified Qt Specialist

July 26, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Hi,

many thanks for the advice. I have opened the file with an external editor showing the hidden characters. The original file is as follows:

  1. [TAB]$(MAKE)[SPACE]INSTALL_ROOT="$(CURDIR)"/debian/qtcomplexharmattan install

So the Tab character in my rules file is before the MAKE clause only. I have tried the following two options:
  1. [TAB]$(MAKE[SPACE])[SPACE]INSTALL_ROOT="$(CURDIR)"/debian/qtcomplexharmattan install

and
  1. [TAB]$(MAKE)[SPACE][SPACE]INSTALL_ROOT="$(CURDIR)"/debian/qtcomplexharmattan install

The rules works and the program is packaged. It is launched by the pc connected to the device but the application icon is never shown in the main screen. It is only shown in the installed application list. Then clicking on the empty green icon on the main screen on the device the program never starts…

Any idea? Something set wrong ?

Thank again, matrixx

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 26, 2011

matrixx matrixx
Lab Rat
50 posts

You managed to run into another bug :) The .desktop file which was missing the single instance invoker command uses the correct installation dir for your app icon (/usr/share/icons/hicolor/64×64/apps/<yourappname>.png) and the icon shows up perfectly fine, until the rules hack has been done. After the hack, QtCreator starts to use the same desktop file you are editing, and by default, it has a wrong path for icon (scalable instead of 64×64). You just have to change it “back” to /usr/share/icons/hicolor/64×64/apps/<yourappname>.png and the icons starts to work again.

 Signature 

Nokia Certified Qt Specialist

July 26, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

I enjoy really a lot to read this!!!

Please matrixx, can you explain me a bit clear ? I am confuesd :)

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 26, 2011

matrixx matrixx
Lab Rat
50 posts

Sorry for writing it a bit unclear, it’s a simple thing, I just made it sound horrible.
Just change this line from your .desktop file:

Icon=/usr/share/icons/hicolor/scalable/apps/Qt-Complex-Harmattan.svg

to

Icon=/usr/share/icons/hicolor/64×64/apps/Qt-Complex-Harmattan.png

and everything should work like a charm again :)
If the icon doesn’t show up yet, it should show up latest after a reboot.

 Signature 

Nokia Certified Qt Specialist

July 26, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Hi matrixx,

you are great!!! Really it was not so unclear, is that the first was a known problem while this was totally unexpected. I am seeing the canges, now I am sure what it should be. I test and tell you what’s happen.

Many thanks. Enrico

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 26, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Hi I changed as you suggested. The program works, and in the installed application list I see the application and the correct icon. In the main page I don’t see any icon at all. If I launch from the terminal the program starts correctly.

Icon is (checked on the terminal) in /usr/share/icons/hicolor/64×64/apps/QtComplexHarmattan.png

while the progam is in /opt/QtComplexHarmattan/bin/QtComplexHarmattan

The QtComplexHarmattan.desktop file is

  1. [Desktop Entry]
  2. Encoding=UTF-8
  3. Version=1.0
  4. Type=Application
  5. Terminal=false
  6. Name=QtComplexHarmattan
  7. Exec=invoker --single-instance --type=d /opt/QtComplexHarmattan/bin/QtComplexHarmattan
  8. Icon=/usr/share/icons/hicolor/64×64/apps/QtComplexHarmattan.png
  9. X-Window-Icon=
  10. X-HildonDesk-ShowInToolbar=true
  11. X-Osso-Type=application/x-executable

and all seems correct.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 26, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

I am rechecking this post from the top. I have set QtComplexHarmattan without – characters because they don ‘t exist in the files wen the program is installed. But I see that in my original file (when it was working as multi-instance with the correct icon) the names was having the – I put them againg to test (bit it is strange). Then, the real strange thing is that in the first file (multi instance and correct icon on the main device page) was with the “wrong” icon name as you can see.

Is there a logic ???

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 26, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Last test

  • Created a new project at all
  • Added all the sources
  • Changed the .desktop file
  • Added the double space in rules file

… Program is launched by the Qt-Creator and the correct icon is shown on the installed application list. The green empty icon is shown on the device main page. The green icon don’t start, the applicaiton starts only from the terminal.

  • Removed the double space in the rule file: now the rule file is as original.
  • Left the desktop file with the changes to the icon path and name.

… Program icon is shown correctly and the program, as usual, can start multiple instances.

Conclusion: sure the double space after the $(MAKE) instruction in the rule files changes the behaviour of the package but not as we want.

Note: The icon is correct, the name is correct and the file on the device is where we expect it is. The same for the application binary.

No more ideas…

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 31, 2011

leon.anavi leon.anavi
Mad Scientist
1045 posts
matrixx wrote:
Check from terminal if the installed .desktop file is exactly looking same on device than it’s on QtCreator. If not, this trick will install the file correctly: edit rules file adding a space after MAKE, but remember to preserve the tab between MAKE and the following word, otherwise the rules file will break. Then clean and rebuild everything. It’s a bug in QtCreator which will be fixed for next version. This lifesaver tip was provided by my friend, Attila Chipa :)

Hi matrixx, Alicemirror,

I had the same problem and this thread helped me a lot to solved it so I want to say Thank you :)

 Signature 

http://anavi.org/

July 31, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Hi leon,

I am happy that at least we are useful for somone :)

Later I will try with different operating systems than Mac, What platform do you used ? Mac or Win?

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 31, 2011

kkrzewniak kkrzewniak
Lab Rat
218 posts

Linux :P

 Signature 

Me, Grimlock, not “nice dino”. ME BASH BRAINS!

July 31, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Ok, thank you.

I am using all the three main platforms. Mac, Linux (Ubuntu lucid 10.4) and Windows7. Matrixx wrote that she is using windows and all works, now I should try with windows and linux then I will update the post.

Cheers. Enrico

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 31, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Hi,

  1. Tested the changes under windows. The application is created regularly and the icon works.
  2. Edited the .desktop file so it point to the right place for the application, for the icon and saw that changing the Application name the value changes on the icon text in the device.
  3. Checked that the .desktop file is the same on my Windwos development project and on the device too.

If I add the “space” character after the $(MAKE) command in the rules the application never starts from the icon: only starts from the Qt-Creator environment and the terminal

If I remove the “space” added from the rules file all works but – as usual – the application run only in multiinstance mode. Also leaving intact the .desktop file with the changes.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

July 31, 2011

matrixx matrixx
Lab Rat
50 posts

I don’t actually know from where QtCreator grabs the default .desktop file which doesn’t have the invoker line on exec. It might be created by a script, haven’t checked it more closely yet. If you have to choose either 1) single instance, 2) working icon, I would choose #1. After you’ve done the “rules hack”, you are the one who’s controlling the contents of the .dekstop file which is going to be installed on the device. If there’s still bugs left, they can be sorted out.

 Signature 

Nokia Certified Qt Specialist

Page  
1

  ‹‹ [Workaround]Background image of one form carried over the next !!!      Windows without title bar but with border ››

You must log in to post a reply. Not a member yet? Register here!