Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Multiple instances even after editing .desktop file



  • Hi
    I followed instruction from here -http://developer.qt.nokia.com/wiki/Single_Instance_Harmattan_Applications#57bd2611a5f660693bc0b0d96860058e
    and changed my desktop entry as follows

    @[Desktop Entry]
    Encoding=UTF-8
    Version=1.0
    Type=Application
    Terminal=false
    Name=insulincal
    Exec=Exec=invoker --single-instance --type=e /opt/insulincal/bin/insulincal
    Icon=/usr/share/icons/hicolor/64x64/apps/insulincal.png
    X-Window-Icon=
    X-HildonDesk-ShowInToolbar=true
    X-Osso-Type=application/x-executable@

    insulincal is my app name.
    I still get multiple app launches in N950 [on remote data access – I am still waiting for my device]
    Can you pl check what is wrong above ?Thanks

    Edit: clarified title a little bit; Andre



  • I noticed the 2 'Exec' and I removed one of the 'Exec' but still I get multiple instance.
    @Exec=Exec=invoker --single-instance --type=e /opt/insulincal/bin/insulincal@
    changed to
    @Exec=invoker --single-instance --type=e /opt/insulincal/bin/insulincal@


  • Moderators

    Did that solve the problem?



  • Unfortunately no. I am also trying to add space in rules file but I get packaging error. This is in discussion in the following thread-
    http://developer.qt.nokia.com/forums/viewthread/8132/P30/
    Thanks



  • Have a look at the created package, in my case it never actually used my desktop file and packaged a default one not using invoker at all/



  • Hi,
    So how can I add the modified desktop file in my deb file? I extracted my deb file with 'universal extractor' and found that the desktop file is different. I want to replace this file with the 'single instance' modified desktop file. What program do you use. Please note that if I replace the modified desktop file in 'Debian' folder and try tom compile the deb file, I again get a new desktop file in the deb pack so I need to replace the desktop file in the compiled deb file.
    Ok, I think that was way too confusing. All I want to know is how to replace desktop file in deb file (like is there a winrar for deb?). I use windows XP SP3 edition.



  • Try adding:

    @
    defineTest(qtcAddDeployment) {
    for(deploymentfolder, DEPLOYMENTFOLDERS) {
    item = item$${deploymentfolder}
    itemsources = $${item}.sources
    $$itemsources = $$eval($${deploymentfolder}.source)
    itempath = $${item}.path
    $$itempath= $$eval($${deploymentfolder}.target)
    export($$itemsources)
    export($$itempath)
    DEPLOYMENT += $$item
    }

    MAINPROFILEPWD = $$PWD

    unix {
    maemo5 {
    desktopfile.path = /usr/share/applications/hildon
    } else {
    desktopfile.path = /usr/share/applications
    copyCommand =
    for(deploymentfolder, DEPLOYMENTFOLDERS) {
    source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
    source = $$replace(source, \\, /)
    macx {
    target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
    } else {
    target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
    }
    target = $$replace(target, \\, /)
    sourcePathSegments = $$split(source, /)
    targetFullPath = $$target/$$last(sourcePathSegments)
    !isEqual(source,$$targetFullPath) {
    !isEmpty(copyCommand):copyCommand += &&
    copyCommand += $(MKDIR) "$$target"
    copyCommand += && $(COPY_DIR) "$$source" "$$target"
    }
    }
    !isEmpty(copyCommand) {
    copyCommand = @echo Copying application data... && $$copyCommand
    copydeploymentfolders.commands = $$copyCommand
    first.depends = $(first) copydeploymentfolders
    export(first.depends)
    export(copydeploymentfolders.commands)
    QMAKE_EXTRA_TARGETS += first copydeploymentfolders
    }
    }
    installPrefix = /opt/$${TARGET}
    for(deploymentfolder, DEPLOYMENTFOLDERS) {
    item = item$${deploymentfolder}
    itemfiles = $${item}.files
    $$itemfiles = $$eval($${deploymentfolder}.source)
    itempath = $${item}.path
    $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
    export($$itemfiles)
    export($$itempath)
    INSTALLS += $$item
    }
    icon.files = $${TARGET}.png
    icon.path = /usr/share/icons/hicolor/64x64/apps
    desktopfile.files = $${TARGET}.desktop
    target.path = $${installPrefix}/bin
    export(icon.files)
    export(icon.path)
    export(desktopfile.files)
    export(desktopfile.path)
    export(target.path)
    INSTALLS += desktopfile icon target
    }

    export (ICON)
    export (INSTALLS)
    export (DEPLOYMENT)
    export (TARGET.EPOCHEAPSIZE)
    export (TARGET.CAPABILITY)
    export (LIBS)
    export (QMAKE_EXTRA_TARGETS)
    }
    @

    to your pro file. This is just an extract for the deployment.pri file you'd normally find in a Qt for symbian project and I found it that this solved the problem of the desktop file not being used.


Log in to reply