Blob Blame History Raw
From a62fed8c667a076daa21fdf8360708813f1bf9e0 Mon Sep 17 00:00:00 2001
From: Nikolaj Hald Nielsen <nhn@kde.org>
Date: Mon, 22 Mar 2010 09:46:32 +0100
Subject: [PATCH] Work around crash in the Info applet caused by a bug in certain versions of Qt.

BUG: 229756
BUG: 227639
---
 src/context/applets/info/InfoApplet.cpp |   19 +++++++++++++------
 src/context/applets/info/InfoApplet.h   |    2 ++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/context/applets/info/InfoApplet.cpp b/src/context/applets/info/InfoApplet.cpp
index 166da4c..e415e98 100644
--- a/src/context/applets/info/InfoApplet.cpp
+++ b/src/context/applets/info/InfoApplet.cpp
@@ -40,18 +40,30 @@ QString InfoApplet::s_defaultHtml = "<html>"
 
 InfoApplet::InfoApplet( QObject* parent, const QVariantList& args )
     : Context::Applet( parent, args )
+    , m_webView( 0 )
     , m_initialized( false )
     , m_currentPlaylist( 0 )
+   
 {
     setHasConfigurationInterface( false );
     setBackgroundHints( Plasma::Applet::NoBackground );
+}
+
+InfoApplet::~InfoApplet()
+{
+    delete m_webView;
+}
+
+
+void  InfoApplet::init()
+{
 
     dataEngine( "amarok-info" )->connectSource( "info", this );
 
     m_webView = new AmarokWebView( this );
 
     resize( 500, -1 );
-    
+
     QPalette p = m_webView->palette();
     p.setColor( QPalette::Dark, QColor( 255, 255, 255, 0)  );
     p.setColor( QPalette::Window, QColor( 255, 255, 255, 0)  );
@@ -62,11 +74,6 @@ InfoApplet::InfoApplet( QObject* parent, const QVariantList& args )
     constraintsEvent();
 }
 
-InfoApplet::~InfoApplet()
-{
-    delete m_webView;
-}
-
 void InfoApplet::constraintsEvent( Plasma::Constraints constraints )
 {
     Q_UNUSED( constraints )
diff --git a/src/context/applets/info/InfoApplet.h b/src/context/applets/info/InfoApplet.h
index 4be28fc..775ea7c 100644
--- a/src/context/applets/info/InfoApplet.h
+++ b/src/context/applets/info/InfoApplet.h
@@ -48,6 +48,8 @@ public:
     InfoApplet( QObject* parent, const QVariantList& args );
     virtual ~InfoApplet();
 
+    void init();
+
     void paintInterface( QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect );
     void constraintsEvent( Plasma::Constraints constraints = Plasma::AllConstraints );
 
-- 
1.6.1