Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Single instance applications on N950
QtWS25 Last Chance

[SOLVED] Single instance applications on N950

Scheduled Pinned Locked Moved Mobile and Embedded
50 Posts 9 Posters 22.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AlicemirrorA Offline
    AlicemirrorA Offline
    Alicemirror
    wrote on last edited by
    #3

    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:
    @
    [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:
    @
    [TAB]$(MAKE[SPACE])[SPACE]INSTALL_ROOT="$(CURDIR)"/debian/qtcomplexharmattan install
    @
    and
    @
    [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

    Enrico Miglino (aka Alicemirror)
    Balearic Dynamics
    Islas Baleares, Ibiza (Spain)
    www.balearicdynamics.com

    1 Reply Last reply
    0
    • M Offline
      M Offline
      matrixx
      wrote on last edited by
      #4

      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/64x64/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 64x64). You just have to change it "back" to /usr/share/icons/hicolor/64x64/apps/<yourappname>.png and the icons starts to work again.

      Nokia Certified Qt Specialist

      1 Reply Last reply
      0
      • AlicemirrorA Offline
        AlicemirrorA Offline
        Alicemirror
        wrote on last edited by
        #5

        I enjoy really a lot to read this!!!

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

        Enrico Miglino (aka Alicemirror)
        Balearic Dynamics
        Islas Baleares, Ibiza (Spain)
        www.balearicdynamics.com

        1 Reply Last reply
        0
        • M Offline
          M Offline
          matrixx
          wrote on last edited by
          #6

          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.

          Nokia Certified Qt Specialist

          1 Reply Last reply
          0
          • AlicemirrorA Offline
            AlicemirrorA Offline
            Alicemirror
            wrote on last edited by
            #7

            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

            Enrico Miglino (aka Alicemirror)
            Balearic Dynamics
            Islas Baleares, Ibiza (Spain)
            www.balearicdynamics.com

            1 Reply Last reply
            0
            • AlicemirrorA Offline
              AlicemirrorA Offline
              Alicemirror
              wrote on last edited by
              #8

              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
              @
              [Desktop Entry]
              Encoding=UTF-8
              Version=1.0
              Type=Application
              Terminal=false
              Name=QtComplexHarmattan
              Exec=invoker --single-instance --type=d /opt/QtComplexHarmattan/bin/QtComplexHarmattan
              Icon=/usr/share/icons/hicolor/64×64/apps/QtComplexHarmattan.png
              X-Window-Icon=
              X-HildonDesk-ShowInToolbar=true
              X-Osso-Type=application/x-executable
              @
              and all seems correct.

              Enrico Miglino (aka Alicemirror)
              Balearic Dynamics
              Islas Baleares, Ibiza (Spain)
              www.balearicdynamics.com

              1 Reply Last reply
              0
              • AlicemirrorA Offline
                AlicemirrorA Offline
                Alicemirror
                wrote on last edited by
                #9

                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 ???

                Enrico Miglino (aka Alicemirror)
                Balearic Dynamics
                Islas Baleares, Ibiza (Spain)
                www.balearicdynamics.com

                1 Reply Last reply
                0
                • AlicemirrorA Offline
                  AlicemirrorA Offline
                  Alicemirror
                  wrote on last edited by
                  #10

                  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...

                  Enrico Miglino (aka Alicemirror)
                  Balearic Dynamics
                  Islas Baleares, Ibiza (Spain)
                  www.balearicdynamics.com

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    leon.anavi
                    wrote on last edited by
                    #11

                    [quote author="matrixx" date="1311683781"]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 :)[/quote]

                    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 :)

                    http://anavi.org/

                    1 Reply Last reply
                    0
                    • AlicemirrorA Offline
                      AlicemirrorA Offline
                      Alicemirror
                      wrote on last edited by
                      #12

                      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?

                      Enrico Miglino (aka Alicemirror)
                      Balearic Dynamics
                      Islas Baleares, Ibiza (Spain)
                      www.balearicdynamics.com

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kkrzewniak
                        wrote on last edited by
                        #13

                        Linux :P

                        Me, Grimlock, not "nice dino". ME BASH BRAINS!

                        1 Reply Last reply
                        0
                        • AlicemirrorA Offline
                          AlicemirrorA Offline
                          Alicemirror
                          wrote on last edited by
                          #14

                          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

                          Enrico Miglino (aka Alicemirror)
                          Balearic Dynamics
                          Islas Baleares, Ibiza (Spain)
                          www.balearicdynamics.com

                          1 Reply Last reply
                          0
                          • AlicemirrorA Offline
                            AlicemirrorA Offline
                            Alicemirror
                            wrote on last edited by
                            #15

                            Hi,

                            Tested the changes under windows. The application is created regularly and the icon works.

                            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.

                            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.

                            Enrico Miglino (aka Alicemirror)
                            Balearic Dynamics
                            Islas Baleares, Ibiza (Spain)
                            www.balearicdynamics.com

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              matrixx
                              wrote on last edited by
                              #16

                              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.

                              Nokia Certified Qt Specialist

                              1 Reply Last reply
                              0
                              • AlicemirrorA Offline
                                AlicemirrorA Offline
                                Alicemirror
                                wrote on last edited by
                                #17

                                Matrixx, the fact is that the icon or none is uninfluent.

                                If I put the changes manually, the icon is shown correctly in all cases. If I don't the icon is shown only in the multi-instance case.

                                I think that we can consider this .desktop file problema as a minotr bug or an undocumentated detail of the packager. Nothing more than to know what should be done.

                                Regardless of this question the program has the following behavior:

                                • Without any change the application works starting from the main page but the icon launch the application in multi-instance.
                                • With the changes to the rules file the program can be started only from the terminal or from the Qt-Creator environment. Ths means that with the single-instance correction (with of without the correction to the .desktop file) the program don't start from the graphic interface. The icon seems unreactive

                                Investigating on this aspect I have another detail to add to this strange behavior:

                                Compiling the application with the changes in the rules file so we expect that it runs in single-instance mode tapping on the icon with the icon nothing happens.
                                But in the meantime it seems that some taks is started because trying to restart the application from the Qt-Creator (that launch a ssh call to the device) I receive the error that due to a locked file the application can't be uninstalled This happens when the application is running.

                                At this point, if I stop the app as it was launched from the Qt-Creator environment the package can be uninstalled / reinstalled.

                                This means that somewhere a piece of the program is running on the device. Analizing the .desktop file again you see that the command that should launch the application is the following line:
                                @
                                invoker --single-instance --type=d /opt/QtComplexHarmattan/bin/QtComplexHarmattan
                                @

                                If whe thought to what happens foucsing the attention on this aspect it seems the following:

                                • When the program runs in multi-instance mode it is sure that for some reason the invoker is not called at all or is called in a manned different thant we se in the .desktop file and the application starts
                                • When the program is package with the workaround the invoker is really called as we see in the line of the .desktop file and the application don't start in a visibile way for some reasons but a task is launched.

                                Can be a problem of the invoker ?

                                Enrico Miglino (aka Alicemirror)
                                Balearic Dynamics
                                Islas Baleares, Ibiza (Spain)
                                www.balearicdynamics.com

                                1 Reply Last reply
                                0
                                • AlicemirrorA Offline
                                  AlicemirrorA Offline
                                  Alicemirror
                                  wrote on last edited by
                                  #18

                                  SOLUTION

                                  The solution can be focused in a problem of the invoker command. Then remains the detail that for some reason not yet clear the icon is not shown correctly - as we expect to be precise - when the workaround is applied.

                                  The workaround suggested by matrixx is correct. The problem that the compilation won't work correctly when the program is package by Qt-Creator so the application runs in multi-instance mode on the device can be solved by the workaround of the double space in the rules file. See in the previous posts of this thread for details.

                                  Then as supposed in the previous post when all is sure is correct the application can't start from the icon. as the .desktop file is very short I have analized the only element that is related to the application launch: the invoker

                                  The sympthoms are the following: The desktop icon launch something but the application don't start.

                                  The application launch in the .desktop file is in the following line:
                                  @
                                  invoker --single-instance --type=d /opt/QtComplexHarmattan/bin/QtComplexHarmattan
                                  @

                                  As you can read in the Harmattan Meego 1.2 documentation pages the option --type=d means that the invoked application is a QtDeclarative program. But from the terminal of the device if you launch the command help $>invoker --help you can read that the parameter <d> means QtDeclarative application but the parameter <e> means any kind of application (including the QtDeclarative applications)

                                  Take in account that when the application runs in a multi-instance mode as a matter of fact this parameter is ignored as the --single-instance option so the application starts and run.

                                  At this point when the single-instance application that we suppose should run correctly but don't start tapping the corresponding icon on the device we try to launch the invoker command exactly as it appear in the .desktop file. The result is the following:
                                  @
                                  $ invoker --single-instance --type=d /opt/QtComplexHarmattan/bin/QtComplexHarmattan
                                  invoker: Invoking execution: '/opt/QtComplexHarmattan/bin/QtComplexHarmattan'
                                  Booster: Loading symbol 'main' failed: '/opt/QtComplexHarmattan/bin/QtComplexHarmattan: undefined symbol: main'
                                  @
                                  Instead if we try to launch manually the command with the <e> option we obtain the following result and the application start:
                                  @
                                  $ invoker --single-instance --type=e /opt/QtComplexHarmattan/bin/QtComplexHarmattan
                                  invoker: Invoking execution: '/opt/QtComplexHarmattan/bin/QtComplexHarmattan'
                                  Using the meego graphics system
                                  Successfully resolved MeeGo graphics system: /usr/lib/qt4/plugins/graphicssystems/libqmeegographicssystem.so

                                  Found SGX/MBX driver, enabling FullClearOnEveryFrame
                                  Found v1.4 driver, enabling brokenTexSubImage
                                  MeegoGraphics: found EGL_NOK_image_shared
                                  MeegoGraphics: found EGL_KHR_lock_surface2
                                  MeegoGraphics: found EGL_KHR_fence_sync
                                  hijackWindow() context created for QDeclarativeView(0xae8189d4) 1
                                  Found SGX/MBX driver, enabling FullClearOnEveryFrame
                                  Found v1.4 driver, enabling brokenTexSubImage
                                  QGLWindowSurface: Using plain widget as window surface QGLWindowSurface(0x1fb89b08)
                                  Found EGL_KHR_image_pixmap & GL_OES_EGL_image extensions (preferred method)!
                                  Found texture_from_pixmap EGL extension!
                                  Meego graphics system destroyed
                                  @

                                  Enrico Miglino (aka Alicemirror)
                                  Balearic Dynamics
                                  Islas Baleares, Ibiza (Spain)
                                  www.balearicdynamics.com

                                  1 Reply Last reply
                                  0
                                  • AlicemirrorA Offline
                                    AlicemirrorA Offline
                                    Alicemirror
                                    wrote on last edited by
                                    #19

                                    APPENDIX

                                    In the post "Someone tried to publish N9 applications?":http://developer.qt.nokia.com/forums/viewthread/8248 kkrzewniak experienced the same problem that is related to the workaround that should be done in the roles file due to the Qt-Creator packager bug.
                                    Respect to the Booster error matrixx suggested the following:

                                    bq. @kkrzewniak If you get the error Booster: Loading symbol ‘main’ failed: ‘/opt/CoolApp/bin/CoolApp undefined symbol: main’
                                    (read the full post in the link above)

                                    This is the last test that will be done to complete this solution.

                                    Enrico Miglino (aka Alicemirror)
                                    Balearic Dynamics
                                    Islas Baleares, Ibiza (Spain)
                                    www.balearicdynamics.com

                                    1 Reply Last reply
                                    0
                                    • AlicemirrorA Offline
                                      AlicemirrorA Offline
                                      Alicemirror
                                      wrote on last edited by
                                      #20

                                      BOOSTER ERROR - SOLVED
                                      @
                                      Q_DECL_EXPORT int main(int argc, char *argv[])
                                      @

                                      Declaring the main function in the main.cpp program of the application the .desktop file works fine also with the --type=d option. Remain unclear what we can do to have the icon shown correctly on the desktop.

                                      Enrico Miglino (aka Alicemirror)
                                      Balearic Dynamics
                                      Islas Baleares, Ibiza (Spain)
                                      www.balearicdynamics.com

                                      1 Reply Last reply
                                      0
                                      • AlicemirrorA Offline
                                        AlicemirrorA Offline
                                        Alicemirror
                                        wrote on last edited by
                                        #21

                                        DESKTOP ICON - SOLVED

                                        The problem of the lost desktop icon depends on a strange behavior, probably a bug in Qt-Creator. When the icon is selected in the project window of Qt-Creator the file is encoded and set at the bottom of the control file in the folder qtc_packaging/debian_harmattan
                                        Managing the packagin files for some reason - else if the icon remain the same and the file too - the value in the control file don't match resulting in the green icon on the device instead of the correct icon file.

                                        The workaround is simple: it is sufficient to follow the instructions of the Qt-Creator documentation explained in packaging your applications section regarding how-to change the icon file.

                                        Opening the project window the icon file should be reloaded and after repackaging the application the icon is shown correctly. And obviously the application runs in single-instance mode.

                                        Many thansk to matrixx !!! :)

                                        Enrico Miglino (aka Alicemirror)
                                        Balearic Dynamics
                                        Islas Baleares, Ibiza (Spain)
                                        www.balearicdynamics.com

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          matrixx
                                          wrote on last edited by
                                          #22

                                          I'm glad I could help. I stumbled on all of these same problems when I ported my first application on N950, so I also have to thank many of my friends who helped me with these issues, so I can now help others :)

                                          Nokia Certified Qt Specialist

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved