[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/context/applets
From:       Leo Franchi <lfranchi () kde ! org>
Date:       2009-02-02 21:28:18
Message-ID: 1233610098.388573.2906.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 920414 by lfranchi:

fix crash in wiki and service applets
needs a proper framework to implement my long-term goals, but this will work for now

 M  +8 -15     serviceinfo/ServiceInfo.cpp  
 M  +7 -9      wikipedia/WikipediaApplet.cpp  


--- trunk/extragear/multimedia/amarok/src/context/applets/serviceinfo/ServiceInfo.cpp \
#920413:920414 @@ -37,8 +37,6 @@
     , m_currentPlaylist( 0 )
 
 {
-    DEBUG_BLOCK
-
     setHasConfigurationInterface( false );
     setBackgroundHints( Plasma::Applet::NoBackground );
 
@@ -101,7 +99,6 @@
 
 void ServiceInfo::constraintsEvent( Plasma::Constraints constraints )
 {
-    DEBUG_BLOCK
     if( !m_header )
         return;
 
@@ -133,7 +130,6 @@
 
 void ServiceInfo::dataUpdated( const QString& name, const Plasma::DataEngine::Data& \
data )  {
-    DEBUG_BLOCK
     Q_UNUSED( name );
 
     if( data.size() == 0 ) return;
@@ -153,9 +149,7 @@
 }
 
 void ServiceInfo::paintInterface( QPainter *p, const QStyleOptionGraphicsItem \
                *option, const QRect &contentsRect )
-{
-    DEBUG_BLOCK
-    
+{    
     Q_UNUSED( option );
 
     //bail out if there is no room to paint. Prevents crashes and really there is no \
sense in painting if the @@ -224,14 +218,13 @@
 QSizeF 
 ServiceInfo::sizeHint( Qt::SizeHint which, const QSizeF & constraint) const
 {
-    Q_UNUSED( which )
-
-    if( constraint.height() == -1 && constraint.width() > 0 ) // asking height for \
                given width basically
-    {
-        return QSizeF( constraint.width(), m_aspectRatio * constraint.width() );
-    }
-        
-    return constraint;
+    // TODO hardcoding for now.
+    // i want to have a system where an applet can ask
+    // for a full "CV pane" of size, but for now this will stop the crash
+    QSizeF size;
+    size.setWidth( QGraphicsWidget::sizeHint( which, constraint ).width() );
+    size.setHeight( 450 );
+    return size;
 }
 
 void ServiceInfo::linkClicked( const QUrl & url )
--- trunk/extragear/multimedia/amarok/src/context/applets/wikipedia/WikipediaApplet.cpp \
#920413:920414 @@ -107,7 +107,6 @@
 void
 WikipediaApplet::linkClicked( const QUrl &url )
 {
-    DEBUG_BLOCK
     debug() << "URL: " << url;
 
     Amarok::invokeBrowser( url.toString() );
@@ -189,14 +188,13 @@
 
 QSizeF WikipediaApplet::sizeHint( Qt::SizeHint which, const QSizeF & constraint ) \
const  {
-    Q_UNUSED( which )
-
-    if( constraint.height() == -1 && constraint.width() > 0 ) // asking height for \
                given width basically
-    {
-        return QSizeF( constraint.width(), m_aspectRatio * constraint.width() );
-    }
-        
-    return constraint;
+    // TODO hardcoding for now.
+    // i want to have a system where an applet can ask
+    // for a full "CV pane" of size, but for now this will stop the crash
+    QSizeF size;
+    size.setWidth( QGraphicsWidget::sizeHint( which, constraint ).width() );
+    size.setHeight( 450 );
+    return size;
 }
 
 #include "WikipediaApplet.moc"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic