conTEXT script

michael cohrs camico at users.sourceforge.net
Sun Aug 20 18:41:48 UTC 2006


hi there,
seb wrote:
> this is a very interesting script. could you please write a little on  
> how it works to update the context browser, because afaik we don't  
> provide a way to modify the contextbrowser!
> Can you also email this to amarok at kde.org ?

Sure, well, the only way (I know of) to modify the context browser is  
calling "dcop amarok html-widget1 evalJS". And the rest is pure Javsacript  
DOM tree manipulation pain (or call it fun :). Just clone one of the boxes  
(tables) and insert it.
The idea is originally taken from the Smart DJ script. I extended it a  
little (well it has grown to more than 600 lines of JS code) with some  
DHTML control features and by embedding an iframe and thus allowing to  
display external html fairly easily.

While we're at it, I think I need some help:
The script is causing an Amarok crash when Amarok is exiting (see the  
backtrace below), sometimes (more often since conTEXT version 2). I'm not  
currently using the latest Amarok svn version, but I'm afraid it should be  
easy to reproduce with any version. I don't know what exactly is causing  
it but it does NOT happen if:
- I remove a periodical evalJS call that is needed to remember the changes  
the user made to the conTEXT box AND
- I don't insert the iframe mentioned above (but still insert a table)
Could somebody with a little more Amarok and C++ experience take a look at  
this? I would be really happy if this could be fixed. Thanks a lot.

best regards
camico

--


1.4-SVN [NOTstripped][validity: 0.58][frames: 151][xine]

Amarok has crashed! We are terribly sorry about this :(

But, all is not lost! You could potentially help us fix the crash.  
Information describing the crash is below, so just click send, or if you  
have time, write a brief description of how the crash happened first.

Many thanks.


The information below is to help the developers identify the problem,  
please do not modify it.



======== DEBUG INFORMATION  =======
Version:    1.4-SVN
Engine:     xine-engine
Build date: Jul 23 2006
CC version: 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)
KDElibs:    3.5.3
Qt:         3.3.6
TagLib:     1.4.0

==== file `which amarokapp` =======
/usr/bin/amarokapp: ELF 32-bit LSB executable, Intel 80386, version 1  
(SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not  
stripped


==== (gdb) bt =====================
Using host libthread_db library "/lib/tls/libthread_db.so.1".
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1246357280 (LWP 20430)]
[New Thread -1259807824 (LWP 20965)]
[New Thread -1305269328 (LWP 20503)]
[New Thread -1296880720 (LWP 20502)]
[New Thread -1286603856 (LWP 20501)]
[New Thread -1277121616 (LWP 20500)]
[New Thread -1251062864 (LWP 20484)]
0xb5fe1221 in __waitpid_nocancel () from /lib/tls/libpthread.so.0
#0  0xb5fe1221 in __waitpid_nocancel () from /lib/tls/libpthread.so.0
#1  0x0804d9bd in amaroK::Crash::crashHandler () at  
/home/mc/src/amarok/amarok-svn/amarok/src/amarokcore/crashhandler.cpp:223
#2  <signal handler called>
#3  0xb7c5525e in QObject::parent (this=0x0) at qobject.h:154
#4  0xb7c55476 in QWidget::parentWidget (this=0x0, sameWindow=false) at  
qwidget.h:878
#5  0xb66b163f in QWidget::topLevelWidget () from /usr/lib/libqt-mt.so.3
#6  0xb75828b3 in KParts::StatusBarExtension::statusBar () from  
/usr/lib/libkparts.so.2
#7  0xb7583e8f in KParts::StatusBarExtension::removeStatusBarItem () from  
/usr/lib/libkparts.so.2
#8  0xb77eb537 in KHTMLPart::removeJSErrorExtension () from  
/usr/lib/libkhtml.so.4
#9  0xb7822f0e in KHTMLPart::~KHTMLPart () from /usr/lib/libkhtml.so.4
#10 0xb7d0ac7b in ~HTMLView (this=0x81e6148) at  
/home/mc/src/amarok/amarok-svn/amarok/src/htmlview.cpp:47
#11 0xb75843df in KParts::Part::slotWidgetDestroyed () from  
/usr/lib/libkparts.so.2
#12 0xb7584442 in KParts::Part::qt_invoke () from /usr/lib/libkparts.so.2
#13 0xb758d2f4 in KParts::ReadOnlyPart::qt_invoke () from  
/usr/lib/libkparts.so.2
#14 0xb7830d03 in KHTMLPart::qt_invoke () from /usr/lib/libkhtml.so.4
#15 0xb7d0da4b in HTMLView::qt_invoke (this=0x81e6148, _id=2,  
_o=0xbff8c2fc) at htmlview.moc:77
#16 0xb667e678 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#17 0xb667efdc in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#18 0xb6a0ecbc in QObject::destroyed () from /usr/lib/libqt-mt.so.3
#19 0xb667d147 in QObject::~QObject () from /usr/lib/libqt-mt.so.3
#20 0xb66b76df in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
#21 0xb7c6c0d7 in ~QFrame (this=0x8221368) at qframe.h:48
#22 0xb67b7d66 in QScrollView::~QScrollView () from /usr/lib/libqt-mt.so.3
#23 0xb77fc06b in KHTMLView::~KHTMLView () from /usr/lib/libkhtml.so.4
#24 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
#25 0xb7c6c0d7 in ~QFrame (this=0x81e4058) at qframe.h:48
#26 0xb7c6c135 in ~QHBox (this=0x81e4058) at qhbox.h:49
#27 0xb6a36655 in QVBox::~QVBox () from /usr/lib/libqt-mt.so.3
#28 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
#29 0xb7c6c0d7 in ~QFrame (this=0x81ffb30) at qframe.h:48
#30 0xb67e77d4 in QWidgetStack::~QWidgetStack () from  
/usr/lib/libqt-mt.so.3
#31 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
#32 0xb67cd9ec in QTabWidget::~QTabWidget () from /usr/lib/libqt-mt.so.3
#33 0xb70d9b36 in KTabWidget::~KTabWidget () from /usr/lib/libkdeui.so.4
#34 0xb7cc1da1 in ~ContextBrowser (this=0x81ff938) at  
/home/mc/src/amarok/amarok-svn/amarok/src/contextbrowser.cpp:323
#35 0xb66b6ffd in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
#36 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
#37 0xb7c53eed in ~BrowserBar (this=0x8182898) at  
/home/mc/src/amarok/amarok-svn/amarok/src/browserbar.cpp:100
#38 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
#39 0xb7ddff8f in ~PlaylistWindow (this=0x814b540) at  
/home/mc/src/amarok/amarok-svn/amarok/src/playlistwindow.cpp:218
#40 0xb7c48646 in ~App (this=0xbff8c7ac) at  
/home/mc/src/amarok/amarok-svn/amarok/src/app.cpp:223
#41 0x0804cc44 in main (argc=1, argv=0xbff8c914) at  
/home/mc/src/amarok/amarok-svn/amarok/src/main.cpp:107
#0  0xb5fe1221 in __waitpid_nocancel () from /lib/tls/libpthread.so.0
No symbol table info available.
#1  0x0804d9bd in amaroK::Crash::crashHandler () at  
/home/mc/src/amarok/amarok-svn/amarok/src/amarokcore/crashhandler.cpp:223
	pid = 22064
#2  <signal handler called>
No symbol table info available.
#3  0xb7c5525e in QObject::parent (this=0x0) at qobject.h:154
No locals.
#4  0xb7c55476 in QWidget::parentWidget (this=0x0, sameWindow=false) at  
qwidget.h:878
No locals.
#5  0xb66b163f in QWidget::topLevelWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#6  0xb75828b3 in KParts::StatusBarExtension::statusBar () from  
/usr/lib/libkparts.so.2
No symbol table info available.
#7  0xb7583e8f in KParts::StatusBarExtension::removeStatusBarItem () from  
/usr/lib/libkparts.so.2
No symbol table info available.
#8  0xb77eb537 in KHTMLPart::removeJSErrorExtension () from  
/usr/lib/libkhtml.so.4
No symbol table info available.
#9  0xb7822f0e in KHTMLPart::~KHTMLPart () from /usr/lib/libkhtml.so.4
No symbol table info available.
#10 0xb7d0ac7b in ~HTMLView (this=0x81e6148) at  
/home/mc/src/amarok/amarok-svn/amarok/src/htmlview.cpp:47
No locals.
#11 0xb75843df in KParts::Part::slotWidgetDestroyed () from  
/usr/lib/libkparts.so.2
No symbol table info available.
#12 0xb7584442 in KParts::Part::qt_invoke () from /usr/lib/libkparts.so.2
No symbol table info available.
#13 0xb758d2f4 in KParts::ReadOnlyPart::qt_invoke () from  
/usr/lib/libkparts.so.2
No symbol table info available.
#14 0xb7830d03 in KHTMLPart::qt_invoke () from /usr/lib/libkhtml.so.4
No symbol table info available.
#15 0xb7d0da4b in HTMLView::qt_invoke (this=0x81e6148, _id=2,  
_o=0xbff8c2fc) at htmlview.moc:77
No locals.
#16 0xb667e678 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#17 0xb667efdc in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#18 0xb6a0ecbc in QObject::destroyed () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#19 0xb667d147 in QObject::~QObject () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#20 0xb66b76df in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#21 0xb7c6c0d7 in ~QFrame (this=0x8221368) at qframe.h:48
No locals.
#22 0xb67b7d66 in QScrollView::~QScrollView () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#23 0xb77fc06b in KHTMLView::~KHTMLView () from /usr/lib/libkhtml.so.4
No symbol table info available.
#24 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#25 0xb7c6c0d7 in ~QFrame (this=0x81e4058) at qframe.h:48
No locals.
#26 0xb7c6c135 in ~QHBox (this=0x81e4058) at qhbox.h:49
No locals.
#27 0xb6a36655 in QVBox::~QVBox () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#28 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#29 0xb7c6c0d7 in ~QFrame (this=0x81ffb30) at qframe.h:48
No locals.
#30 0xb67e77d4 in QWidgetStack::~QWidgetStack () from  
/usr/lib/libqt-mt.so.3
No symbol table info available.
#31 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#32 0xb67cd9ec in QTabWidget::~QTabWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#33 0xb70d9b36 in KTabWidget::~KTabWidget () from /usr/lib/libkdeui.so.4
No symbol table info available.
#34 0xb7cc1da1 in ~ContextBrowser (this=0x81ff938) at  
/home/mc/src/amarok/amarok-svn/amarok/src/contextbrowser.cpp:323
No locals.
#35 0xb66b6ffd in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#36 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#37 0xb7c53eed in ~BrowserBar (this=0x8182898) at  
/home/mc/src/amarok/amarok-svn/amarok/src/browserbar.cpp:100
No locals.
#38 0xb66b761d in QWidget::~QWidget () from /usr/lib/libqt-mt.so.3
No symbol table info available.
#39 0xb7ddff8f in ~PlaylistWindow (this=0x814b540) at  
/home/mc/src/amarok/amarok-svn/amarok/src/playlistwindow.cpp:218
No locals.
#40 0xb7c48646 in ~App (this=0xbff8c7ac) at  
/home/mc/src/amarok/amarok-svn/amarok/src/app.cpp:223
	uniquelyNamedStackAllocatedStandardBlock = {m_start = {tv_sec =  
1156078019, tv_usec = 212508},
   m_label = 0xb7f042d0 "virtual App::~App()"}
	engine = (EngineBase * const) 0x84c26e8
#41 0x0804cc44 in main (argc=1, argv=0xbff8c914) at  
/home/mc/src/amarok/amarok-svn/amarok/src/main.cpp:107
	app = {<> = {<No data fields>}, <EngineObserver> = {_vptr.EngineObserver  
= 0xb7f53368, m_subject = 0x0}, static metaObj = 0x813e6b0,
   static mainThreadId = 0, m_pGlobalAccel = 0x814c170, m_pPlayerWindow =  
0x0, m_pPlaylistWindow = 0x814b540, m_pTray = 0x80eb0d8,
   m_pDeviceManager = 0xb7f6c840}
==== (gdb) thread apply all bt ====
Thread 7 (Thread -1251062864 (LWP 20484)):
#0  0xb5fddde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from  
/lib/tls/libpthread.so.0
#1  0xb45fa6ff in xine_open () from /usr/lib/libxine.so.1
Thread 6 (Thread -1277121616 (LWP 20500)):
#0  0xb5c31819 in poll () from /lib/tls/libc.so.6
#1  0xb40803ec in ?? () from  
/usr/lib/xine/plugins/1.1.1/xineplug_ao_out_alsa.so
#2  0xb3e0a3b0 in ?? ()
#3  0x00000001 in ?? ()
#4  0x0000014d in ?? ()
#5  0x00000000 in ?? ()
#6  0x080e8e48 in ?? ()
#7  0xb3e0a3b0 in ?? ()
#8  0x00000000 in ?? ()
#9  0x00000000 in ?? ()
#10 0x00000011 in ?? ()
#11 0x00000029 in ?? ()
#12 0x00000000 in ?? ()
#13 0x00000000 in ?? ()
#14 0x00000000 in ?? ()
#15 0x00000000 in ?? ()
#16 0x00000000 in ?? ()
#17 0x00000000 in ?? ()
#18 0x00000000 in ?? ()
#19 0x00000000 in ?? ()
#20 0x00000000 in ?? ()
#21 0x00000000 in ?? ()
#22 0x00000000 in ?? ()
#23 0x00000000 in ?? ()
#24 0x00000000 in ?? ()
#25 0x00000000 in ?? ()
#26 0x00000000 in ?? ()
#27 0x00000000 in ?? ()
#28 0x00000000 in ?? ()
#29 0x00000000 in ?? ()
#30 0x00000000 in ?? ()
#31 0x00000000 in ?? ()
#32 0x00000000 in ?? ()
#33 0x00000000 in ?? ()
#34 0x00000000 in ?? ()
#35 0x00000000 in ?? ()
#36 0x00000000 in ?? ()
#37 0x00000000 in ?? ()
#38 0x00000000 in ?? ()
#39 0x00000000 in ?? ()
#40 0x00000000 in ?? ()
#41 0x00000000 in ?? ()
#42 0x00000000 in ?? ()
#43 0x00000000 in ?? ()
#44 0x00000000 in ?? ()
#45 0x0000001a in ?? ()
#46 0x0000001a in ?? ()
#47 0x00000001 in ?? ()
#48 0x00000001 in ?? ()
#49 0xb5fe4ff4 in ?? () from /lib/tls/libpthread.so.0
#50 0x00000000 in ?? ()
#51 0x007d0f00 in ?? ()
#52 0xb3e0a4c8 in ?? ()
#53 0xb5fdbced in start_thread () from /lib/tls/libpthread.so.0
#54 0xb3f099bc in ?? ()
#55 0xb3f08120 in ?? ()
#56 0xb3f08120 in ?? ()
#57 0xb3f0a69c in ?? ()
#58 0xb3f101d4 in ?? ()
#59 0xb3f0c278 in ?? ()
#60 0x00000016 in ?? ()
#61 0x00000020 in ?? ()
#62 0x00000001 in ?? ()
#63 0x00000000 in ?? ()
#64 0x00000000 in ?? ()
#65 0xb44b5a50 in snd_mixer_free () from /usr/lib/libasound.so.2
#0  0xb5fe1221 in __waitpid_nocancel () from /lib/tls/libpthread.so.0


==== kdBacktrace() ================
[
0: /usr/lib/libkdecore.so.4(_Z11kdBacktracei+0x45) [0xb6d34525]
1: /usr/lib/libkdecore.so.4(_Z11kdBacktracev+0x2b) [0xb6d348ab]
2: amarokapp(_ZN6amaroK5Crash12crashHandlerEi+0xad2) [0x804d806]
3: [0xffffe420]
4: /usr/lib/libamarok.so.0(_ZNK7QWidget12parentWidgetEb+0x60) [0xb7c55476]
5: /usr/lib/libqt-mt.so.3(_ZNK7QWidget14topLevelWidgetEv+0x2b) [0xb66b163f]
6:  
/usr/lib/libkparts.so.2(_ZNK6KParts18StatusBarExtension9statusBarEv+0x43)  
[0xb75828b3]
7:  
/usr/lib/libkparts.so.2(_ZN6KParts18StatusBarExtension19removeStatusBarItemEP7QWidget+0x1f)  
[0xb7583e8f]
8: /usr/lib/libkhtml.so.4(_ZN9KHTMLPart22removeJSErrorExtensionEv+0x47)  
[0xb77eb537]
9: /usr/lib/libkhtml.so.4(_ZN9KHTMLPartD2Ev+0x2be) [0xb7822f0e]
10: /usr/lib/libamarok.so.0(_ZN8HTMLViewD0Ev+0x10b) [0xb7d0ac7b]
11: /usr/lib/libkparts.so.2(_ZN6KParts4Part19slotWidgetDestroyedEv+0x6f)  
[0xb75843df]
12: /usr/lib/libkparts.so.2(_ZN6KParts4Part9qt_invokeEiP8QUObject+0x32)  
[0xb7584442]
13:  
/usr/lib/libkparts.so.2(_ZN6KParts12ReadOnlyPart9qt_invokeEiP8QUObject+0x44)  
[0xb758d2f4]
14: /usr/lib/libkhtml.so.4(_ZN9KHTMLPart9qt_invokeEiP8QUObject+0x53)  
[0xb7830d03]
15: /usr/lib/libamarok.so.0(_ZN8HTMLView9qt_invokeEiP8QUObject+0x25)  
[0xb7d0da4b]
16:  
/usr/lib/libqt-mt.so.3(_ZN7QObject15activate_signalEP15QConnectionListP8QUObject+0x25c)  
[0xb667e678]
17: /usr/lib/libqt-mt.so.3(_ZN7QObject15activate_signalEi+0x15e)  
[0xb667efdc]
18: /usr/lib/libqt-mt.so.3(_ZN7QObject9destroyedEv+0x2e) [0xb6a0ecbc]
19: /usr/lib/libqt-mt.so.3(_ZN7QObjectD2Ev+0x6b) [0xb667d147]
20: /usr/lib/libqt-mt.so.3(_ZN7QWidgetD2Ev+0x2f5) [0xb66b76df]
21: /usr/lib/libamarok.so.0(_ZN6QFrameD2Ev+0x3f) [0xb7c6c0d7]
22: /usr/lib/libqt-mt.so.3(_ZN11QScrollViewD2Ev+0x182) [0xb67b7d66]
23: /usr/lib/libkhtml.so.4(_ZN9KHTMLViewD0Ev+0x20b) [0xb77fc06b]
24: /usr/lib/libqt-mt.so.3(_ZN7QWidgetD2Ev+0x233) [0xb66b761d]
25: /usr/lib/libamarok.so.0(_ZN6QFrameD2Ev+0x3f) [0xb7c6c0d7]
26: /usr/lib/libamarok.so.0(_ZN5QHBoxD2Ev+0x3f) [0xb7c6c135]
27: /usr/lib/libqt-mt.so.3(_ZN5QVBoxD0Ev+0x3d) [0xb6a36655]
28: /usr/lib/libqt-mt.so.3(_ZN7QWidgetD2Ev+0x233) [0xb66b761d]
29: /usr/lib/libamarok.so.0(_ZN6QFrameD2Ev+0x3f) [0xb7c6c0d7]
30: /usr/lib/libqt-mt.so.3(_ZN12QWidgetStackD0Ev+0xa4) [0xb67e77d4]
31: /usr/lib/libqt-mt.so.3(_ZN7QWidgetD2Ev+0x233) [0xb66b761d]
32: /usr/lib/libqt-mt.so.3(_ZN10QTabWidgetD2Ev+0x62) [0xb67cd9ec]
33: /usr/lib/libkdeui.so.4(_ZN10KTabWidgetD2Ev+0x56) [0xb70d9b36]
34: /usr/lib/libamarok.so.0(_ZN14ContextBrowserD0Ev+0x1e5) [0xb7cc1da1]
35: /usr/lib/libqt-mt.so.3(_ZN7QWidgetD0Ev+0x233) [0xb66b6ffd]
36: /usr/lib/libqt-mt.so.3(_ZN7QWidgetD2Ev+0x233) [0xb66b761d]
37: /usr/lib/libamarok.so.0(_ZN10BrowserBarD0Ev+0x13b) [0xb7c53eed]
38: /usr/lib/libqt-mt.so.3(_ZN7QWidgetD2Ev+0x233) [0xb66b761d]
39: /usr/lib/libamarok.so.0(_ZN14PlaylistWindowD0Ev+0x145) [0xb7ddff8f]
40: /usr/lib/libamarok.so.0(_ZN3AppD1Ev+0x246) [0xb7c48646]
41: amarokapp [0x804cc44]
42: /lib/tls/libc.so.6(__libc_start_main+0xd0) [0xb5b7eeb0]
43: amarokapp [0x804c4f1]
]





More information about the Amarok mailing list