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

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/context/containments
From:       Maximilian Kossick <maximilian.kossick () googlemail ! com>
Date:       2008-02-15 17:18:35
Message-ID: 1203095915.348516.29378.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 775381 by mkossick:

don't leak temp files


 M  +6 -7      ColumnApplet.cpp  
 M  +4 -0      ColumnApplet.h  


--- trunk/extragear/multimedia/amarok/src/context/containments/ColumnApplet.cpp \
#775380:775381 @@ -56,21 +56,19 @@
 
 
     
-    KTemporaryFile tintedSvg;
-    tintedSvg.setSuffix( ".svg" );
-    tintedSvg.setAutoRemove( false );  //TODO
-    tintedSvg.open();
+    m_tintedSvg.setSuffix( ".svg" );
+    m_tintedSvg.open();
     
-    QFile file( tintedSvg.fileName() );
+    QFile file( m_tintedSvg.fileName() );
     file.open( QIODevice::WriteOnly | QIODevice::Text );
 
     QTextStream out( &file );
     out << svg_source;
     file.close();
 
-    debug() << "temp filename: " << tintedSvg.fileName();
+    debug() << "temp filename: " << m_tintedSvg.fileName();
     
-    m_background = new Svg( tintedSvg.fileName(), this );
+    m_background = new Svg( m_tintedSvg.fileName(), this );
     m_logo = new Svg( "widgets/amarok-logo", this );
     m_logo->resize();
     m_width = 300; // TODO hardcoding for now, do we want this configurable?
@@ -146,6 +144,7 @@
 
 void ColumnApplet::paintInterface(QPainter *painter, const QStyleOptionGraphicsItem \
*option, const QRect& rect)  {
+    DEBUG_BLOCK
     Q_UNUSED( option );
     painter->save();
     m_background->paint( painter, rect );
--- trunk/extragear/multimedia/amarok/src/context/containments/ColumnApplet.h \
#775380:775381 @@ -26,6 +26,8 @@
 #include <QGraphicsView>
 #include <QList>
 
+#include <KTemporaryFile>
+
 namespace Context
 {
 
@@ -83,6 +85,8 @@
     Plasma::Svg* m_logo;
     qreal m_width;
     qreal m_aspectRatio;
+
+    KTemporaryFile m_tintedSvg;
 };
 
 K_EXPORT_AMAROK_APPLET( context, ColumnApplet )


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

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