![]() |
Trouble with my qt app's .desktop file
So I made a weather application that pulls weather from the National Weather Service using Qt and managed to package it as a deb using scratchbox and install it on the device.
The problem I have now is, I can run it from the command line by executing /usr/bin/weather, but it doesn't seem to work from the .desktop file UNLESS I run it as sudo. weather.desktop: Code:
[Desktop Entry] Any idea why this is? Did I leave out any important information? EDIT: Also, I can compile the project and install it on my x86 emulator target in scratchbox and it works fine from the .desktop file... |
Re: Trouble with my qt app's .desktop file
Don't know if this is causing your problem, but you should not have the "run-standalone.sh" in the Exec row. It's used in scratchbox only.
Hope this helps.. |
Re: Trouble with my qt app's .desktop file
Well I tried that but it didn't fix the problem with needing sudo. I actually do need to use it in the exec line if I'm using sudo or the app shows up looking very weird.
I've tried most combinations too, some of which include Exec=/usr/bin/weather Exec=sudo /usr/bin/weather Exec=sudo weather Exec=weather Exec=run-standalone.sh weather and none of them work.... no idea where to even look for help |
Re: Trouble with my qt app's .desktop file
Quote:
That said, I have two remarks 1. I'll leave some very nasty comments on the package page and thumb down if I see someone sudo-ing things just because it's too hard to debug a crash :) 2. Optify |
Re: Trouble with my qt app's .desktop file
Quote:
Do other qt applications need to do this aswell? |
Re: Trouble with my qt app's .desktop file
The proper solution is to set the target to maemo, the build to debug and press the debug button and get a nice stack trace which tells you where's that dangling pointer you missed :) I'm pretty sure you're not using anything that really requires sudo - it's just a coincidence that on your machine with sudo it fails in a way that makes it survive. Applications in general (regardless if they are Qt or not) do not need to put into sudo unless they really deal with system stuff.
|
Re: Trouble with my qt app's .desktop file
Quote:
Is it relevant that it compiles and runs flawlessly on desktop without sudo aswell? |
Re: Trouble with my qt app's .desktop file
UPDATE: I've narrowed the code down to one line that breaks it...
Code:
The hilo list is constructed here : Code:
/*merge temps into one day period ordered list*/ This is such a weird problem and I've got no idea where to look. There are no dangling pointers... The worst part is, it works fine if I compile and install in the x86 target emulator in scratchbox... Remember, it DOES work if I execute Code:
/usr/bin/weather |
Re: Trouble with my qt app's .desktop file
Is there any chance that your index is out of bounds ? Also, try to run it in debug mode on-device, you might catch an ASSERT or similar.
|
Re: Trouble with my qt app's .desktop file
Quote:
But yea, there was an index out of bounds, but that was a symptom of the real problem. I was creating a temporary file "tmp.xml" in the current working directory, which apparently you don't have permission for when starting the app with a .desktop file. So I changed it to /tmp/tmp.xml and it worked fine! Thanks to nicolai in this thread: http://talk.maemo.org/showthread.php?t=70158&page=2 |
All times are GMT. The time now is 12:17. |
vBulletin® Version 3.8.8