[PyKDE] KMimeType.findByPath return value

Daniel Naber daniel.naber at t-online.de
Tue Dec 31 00:38:01 GMT 2002


Hi,

the documentaton says that KMimeType.findByURL() returns an instance of a 
KService, I assume the same is true for KMimeType.findByPath(). However, 
how can I simply get the service's name? I can print it like this:

self.mimetype = KMimeType.findByPath(url).name()
print "mimetype=%s" % self.mimetype

Output is something like "mimetype=application/x-shellscript", but this is 
still of type 'instance' and thus cannot be used for 
KServiceTypeProfile.preferredService(). How can I make the name a string? 
str() around the right side of the self.mimetype=... leads to a crash 
where the KDE crash handler pops up (backtrace below).

I'm using the 20021122 snapshot RPMs for Suse 8.1

Regards
 Daniel

(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...[New Thread 1024 (LWP 5208)]
(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...0x400fd8c9 in wait4 () from /lib/libc.so.6
#0  0x400fd8c9 in wait4 () from /lib/libc.so.6
#1  0x40178c90 in __DTOR_END__ () from /lib/libc.so.6
#2  0x40030a93 in waitpid () from /lib/libpthread.so.0
#3  0x41366555 in KCrash::defaultCrashHandler(int) ()
   from /opt/kde3/lib/libkdecore.so.4
#4  0x4002e12b in pthread_sighandler () from /lib/libpthread.so.0
#5  <signal handler called>
#6  0x4002c0cd in pthread_mutex_lock () from /lib/libpthread.so.0
#7  0x400ce628 in free () from /lib/libc.so.6
#8  0x4035e657 in free () from /usr/lib/qt3//lib/libqt-mt.so.3
#9  0x409413e3 in operator delete(void*) () from /usr/lib/libstdc++.so.5
#10 0x4094143f in operator delete[](void*) () from /usr/lib/libstdc++.so.5
#11 0x4062a9a8 in QStringData::deleteSelf() ()
   from /usr/lib/qt3//lib/libqt-mt.so.3
#12 0x40df8451 in sipDealloc_QString(_sipThisType*) ()
   from /usr/lib/python2.2/site-packages/libqtcmodule.so
#13 0x4001aab3 in sipDtor () from 
/usr/lib/python2.2/site-packages/libsip.so
#14 0x080c6e33 in PyCFunction_Call ()
#15 0x080aa857 in PyObject_Call ()
#16 0x080b146b in PyMethod_New ()
#17 0x080aa857 in PyObject_Call ()
#18 0x08079e19 in PyEval_CallObjectWithKeywords ()
#19 0x080ad5e0 in PyInstance_New ()
#20 0x0805e93e in PyTuple_SetItem ()
#21 0x0807a499 in PyEval_GetFuncDesc ()
#22 0x08078134 in PyEval_EvalCode ()
#23 0x08078c4e in PyEval_EvalCodeEx ()
#24 0x080baf3c in PyFunction_SetClosure ()
#25 0x080aa857 in PyObject_Call ()
#26 0x080b146b in PyMethod_New ()
#27 0x080aa857 in PyObject_Call ()
#28 0x08079e19 in PyEval_CallObjectWithKeywords ()
#29 0x080ad3ed in PyInstance_New ()
#30 0x080aa857 in PyObject_Call ()
#31 0x0807a455 in PyEval_GetFuncDesc ()
#32 0x08078134 in PyEval_EvalCode ()
#33 0x08078c4e in PyEval_EvalCodeEx ()
#34 0x08075c35 in PyEval_EvalCode ()
#35 0x080942c9 in PyRun_FileExFlags ()
#36 0x08093253 in PyRun_SimpleFileExFlags ()
#37 0x08092b9a in PyRun_AnyFileExFlags ()
#38 0x080536ca in Py_Main ()
#39 0x08053119 in main ()
#40 0x400784a2 in __libc_start_main () from /lib/libc.so.6

-- 
http://www.danielnaber.de




More information about the PyQt mailing list