Summary: | Wrong formatting in Wikipedia applet | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Jan-Willem van de Meent <janwillem> |
Component: | Context View | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | lfranchi, rubberglove, simon.esneault, stuffcorpse |
Priority: | NOR | ||
Version: | 2.3-GIT | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.3.1 | |
Sentry Crash Report: | |||
Attachments: | Amarok window showing wikipedia applet rendering error |
Description
Jan-Willem van de Meent
2010-01-15 18:07:42 UTC
Created attachment 39916 [details]
Amarok window showing wikipedia applet rendering error
Confirmed on GIT. Just wanted to mention that I've noticed the same issue with amarok 2.2.2 and KDE 4.4 (both RC2 and now RC3) under fedora 12 (x86_64). Still present on KDE SC 4.4.0 with Amarok 2.2.2.90 the code hasn't changed but it seems to be working again for me, using amarok trunk and kde trunk. Yep, I've tried to debug that one, it appears that the plasma::WebPage is not loading the css for some reason. We should inform the plasma dev of that regression, but they're probably aware of that if Leo says it's fixed in kde trunk. Mabe we can find a workaround, but I couldn't come out with one :/ -Simon I've noticed that in 2.2.2.90 right-clicking the widget and selecting 'reload' causes the page the reappear with the default wikipedia formatting. Don't know if this is of help at all... commit 598055946efd27922249bf318c8d3d5c325a01ff Author: Simon Esneault <simon.esneault@gmail.com> Date: Fri Apr 9 12:41:01 2010 +0200 Fix bug 222875. Wikipedia applet was not loading the css due to a QtWebkit regression Now we give the css encoded on a base64 to hte QWebPage, and the css is loaded on kde 4.4 Please test this on other version (4.3 or 4.5) Simon BUG: 222875 diff --git a/src/context/applets/wikipedia/WikipediaApplet.cpp b/src/context/applets/wikipedia/WikipediaApplet.cpp index dd996f2..20c1b8e 100644 --- a/src/context/applets/wikipedia/WikipediaApplet.cpp +++ b/src/context/applets/wikipedia/WikipediaApplet.cpp @@ -43,6 +43,7 @@ #include <QMenu> #include <QWebHistory> #include <QWebPage> +#include <QWebFrame> WikipediaApplet::WikipediaApplet( QObject* parent, const QVariantList& args ) @@ -473,10 +474,16 @@ WikipediaApplet::paletteChanged( const QPalette & palette ) { m_css->write( contents.toLatin1() ); - QString filename = m_css->fileName(); + // NOTE shall we keep this commented out, and bring it back later or the base64 is just what we need ? + // QString filename = m_css->fileName(); m_css->close(); // flush buffer to disk - debug() << "set user stylesheet to:" << "file://" + filename; - m_webView->page()->settings()->setUserStyleSheetUrl( "file://" + filename ); + // debug() << "set user stylesheet to:" << "file://" + filename; + // m_webView->page()->settings()->setUserStyleSheetUrl( "file://" + filename ); + + + //NOTE We give it encoded on a base64 + // as it is currently broken on QtWebkit (see https://bugs.webkit.org/show_bug.cgi?id=34884 ) + m_webView->mainFrame()->page()->settings()->setUserStyleSheetUrl( QUrl( QString( "data:text/css;charset=utf-8;base64," + QString( QByteArray( contents.toLatin1() ).toBase64().data() ) ) ) ); } } } |