[PyKDE] session handling
Marcos Dione
mdione at grulic.org.ar
Mon Feb 12 22:43:08 GMT 2007
I'm trying to add session saving support to my app to no avail. all I've got
to, was to simulate it at window close. the code I have is this:
def saveState (self, *more):
print 'saveState()'
super (Kress, self).saveState (more)
def restore (self, n, show, config):
super (Kress, self).restore (n, show)
config.setGroup ('%d' % n)
# this doesn't work anymore, so we just [f]make it.
self.restoreProperties (config)
def saveProperties (self, config):
print 'saving properties'
urls= []
for i in range (1, self.tabMaster.count ()):
tab= self.tabMaster.page (i)
part= self.partForTab[tab]
urls.append (str (part.url ().url ()))
config.writeEntry ('urls', urls)
config.sync ()
the kde documentation about it[1] is very limited and only to restoring, not
about saving. qt's doc[2] suggest to use xsm to debug it, so I did. if I try to
shut it down, I get a SIGSEGV whith this backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209940288 (LWP 589)]
0xb700d104 in QVariant::QVariant () from /usr/lib/libqt-mt.so.3
(gdb) bt
#0 0xb700d104 in QVariant::QVariant () from /usr/lib/libqt-mt.so.3
#1 0xb68a68c4 in sipVH_kdecore_21 ()
from /usr/lib/python2.5/site-packages/kdecore.so
#2 0xb5e267a8 in sipKMainWindow::saveProperties ()
from /usr/lib/python2.5/site-packages/kdeui.so
#3 0xb56edf0c in KMainWindow::savePropertiesInternal ()
from /usr/lib/libkdeui.so.4
#4 0xb5762c61 in KMWSessionManaged::saveState () from /usr/lib/libkdeui.so.4
#5 0xb65d249d in KApplication::saveState () from /usr/lib/libkdecore.so.4
#6 0xb67c67f2 in sipKApplication::saveState ()
from /usr/lib/python2.5/site-packages/kdecore.so
#7 0xb6ee1f58 in ?? () from /usr/lib/libqt-mt.so.3
#8 0x08754400 in ?? ()
#9 0x0878f920 in ?? ()
#10 0x0878a010 in ?? ()
#11 0x00000000 in ?? ()
any hints?
--
[1] http://developer.kde.org/documentation/library/3.5-api/kdelibs-apidocs/kdeui/html/classKMainWindow.html#e0
[2] http://doc.trolltech.com/3.3/session.html
--
(Not so) Random fortune:
Nunca pierdas la oportunidad de hacer bien las cosas.
More information about the PyQt
mailing list