You are not logged in.

vdboor

Beginner

  • "vdboor" started this thread

Posts: 30

Location: The Netherlands

Occupation: Software developer

  • Send private message

1

Friday, July 15th 2005, 4:36pm

KConfig: settings lost at kde logout?

I'm facing a weird problem with my application:
* settings are perfectly saved if I quit the application manually.
* settings are not saved if I logout from KDE directly 8o

Does anyone know why the settings are not saved at kde-logout?


From the debugging output, I notice that the KMainWindow methods queryClose(), queryExit(), saveProperties() are executed. All settings are written during the saveProperties() method, this is also visible in my debug output. I did notice that the destructor didn't run at kde-logout. It only runs when I quit the application.. ?(
Working on KMess, a MSN Messenger client for Linux/KDE.

This post has been edited 2 times, last edit by "vdboor" (Jul 15th 2005, 4:38pm)


anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Sunday, July 17th 2005, 6:04pm

Hmm, maybe the application is killed before it can finish, thus its destructors don't get called.

However if your saveProperties is called, check that you call sync() on your KConfig instance.

Cheers,
_
Qt/KDE Developer
Debian User

vdboor

Beginner

  • "vdboor" started this thread

Posts: 30

Location: The Netherlands

Occupation: Software developer

  • Send private message

3

Monday, July 18th 2005, 12:54pm

Quoted

Originally posted by anda_skoa
Hmm, maybe the application is killed before it can finish, thus its destructors don't get called.

However if your saveProperties is called, check that you call sync() on your KConfig instance.

Cheers,
_


I'm already doing that, and it does not seam to help.. :-(
Working on KMess, a MSN Messenger client for Linux/KDE.

4

Monday, July 18th 2005, 1:05pm

Maybe it's interesting to check out these two signals:

http://doc.trolltech.com/3.3/qapplication.html#aboutToQuit
http://doc.trolltech.com/3.3/qapplicatio…astWindowClosed

Create a slot to one of those signals and call saveProperties() from that slot.

vdboor

Beginner

  • "vdboor" started this thread

Posts: 30

Location: The Netherlands

Occupation: Software developer

  • Send private message

5

Monday, July 18th 2005, 2:59pm

I've managed to fix my problem, although the fix is quite weird.

In saveProperties(config), the argument 'config' != kapp->config(). I'm not sure why, or what causes this. By using kapp->config() instead of the 'config' argument, I managed to save the settings at KDE logout.
Working on KMess, a MSN Messenger client for Linux/KDE.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

6

Friday, July 22nd 2005, 1:38pm

That config is very likely the one from the session management.

Cheers,
_
Qt/KDE Developer
Debian User