Active Topics

 


Reply
Thread Tools
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#1
Today I finaly suceeded to get the icon to work when installing the .deb file. But when having the program open for ~5min without doing anything it closes itself without giving any errors. When I run the same code though qt creator it doesn't close at all, making it very hard to understand what the problem is. Anyone have ideas on how to fix this or what is making this?



Yours,
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#2
Wasn't this covered in some other thread here recently?

Don't mark your application as a service. If you do, the desktop will try to talk to it using DBUS and when it fails, it kills your application.

Supply your .desktop file here and people will help you.
 
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#3
I'm sorry if it have, I searched but I got to many results when searching on "app closing itself". I guess you mean I have to remove install += services in the .pro file?
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#4
Having a services file is not enough: Your program must register a service.

Maemo comes with the libosso library which'll do this in GLib applications, but http://wiki.forum.nokia.com/index.ph...h_DBus_support should do the same for a Qt app.
 
bzbnd's Avatar
Posts: 209 | Thanked: 76 times | Joined on Mar 2010
#5
same problem here
 
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#6
I got it working by removing the service file + remove in the .pro file. Thanks

Since this thread got to be about dbus I have a question about sending a method to lock the screen

my code is:
lock = QDBusMessage::createMethodCall("com.nokia.mce",
"/com/nokia/mce/request",
"com.nokia.mce.request",
"req_tklock_mode_change");
QList<QVariant> args;
args.append("locked");
lock.setArguments(args);
QDBusConnection::sessionBus().send(lock);

and nothing happends.

In wiki I found this but it is for the terminal
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"locked"

Thanks again!
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#7
Originally Posted by Lullen View Post
I got it working by removing the service file + remove in the .pro file. Thanks

Since this thread got to be about dbus I have a question about sending a method to lock the screen

my code is:
lock = QDBusMessage::createMethodCall("com.nokia.mce",
"/com/nokia/mce/request",
"com.nokia.mce.request",
"req_tklock_mode_change");
QList<QVariant> args;
args.append("locked");
lock.setArguments(args);
QDBusConnection::sessionBus().send(lock);

and nothing happends.

In wiki I found this but it is for the terminal
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"locked"

Thanks again!
I know absolutely zilch about QDBus (I do D-Bus GLib in C and Vala), but that dbus-send command is calling the MCE service on the System bus whilst your QDBus code is asking on the Session bus, where MCE does not register itself.

P.S. The mce-dev package provides headers defining the service name et al. if you don't want to hardcode anything: maemo.org/api_refs/5.0/5.0-final/mce-dev/
 

The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 5 | Thanked: 1 time | Joined on Jun 2010 @ UK
#8
I recently had the same problem and posted my question in this thread: http://talk.maemo.org/showthread.php?t=55844

I was referred to this tutorial: http://wiki.forum.nokia.com/index.ph...h_DBus_support

It seemed to solve my problem, but I had to make a couple of small changes to the instructions in the tutorial. My changes are:
  1. The tutorial seems to suggest the use of two separate .pro files, I only used a single (i.e. no “src/src.pro” file).
  2. I didn't bother dealing with close events. Maybe I'll regret it later.
  3. I had to include <QtDBus/QtDBus>, not <QtDBus>


Everything seems to work fine now, except that I still have to reboot my phone before the correct app icon is displayed. I'm sure there are instructions on how to fix that somewhere, but rebooting just seems like the easier option for me at the moment

I hope all the messing about with DBus will be hidden from the developer in future releases of Qt-creator/madde.
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:20.