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

List:       kopete-devel
Subject:    [Kopete-devel] [Bug 62669] KDE frequently hangs due to high disk
From:       Martijn Klingens <klingens () kde ! org>
Date:       2004-01-01 20:02:36
Message-ID: 20040101200236.17407.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=62669     
klingens@kde.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From klingens@kde.org  2004-01-01 21:02 -------
Subject: kdenetwork/kopete/kopete

CVS commit by mklingens: 

Workaround for the pixmap leakage in QMovie: pause the movie while not
being shown. This avoids the initial leaking, although eventually there
might still be a leak up to the size of Qt's pixmap cache. The leak is not
infinite, but this should improve performance a bit and makes sure that
attempts to measure Kopete's resource usage aren't massively skewed. Also
note that closing the chat window frees the pixmaps, so the memory isn't
permanently lost either in a Kopete session.

If there are any other leaks that are properly reproducable (data from
valgrind running in leak-check mode is also welcome, as long as it's a
leak check on a running Kopete and not on exit, and with proper details
on when the check was run) please report in a separate bug report.

CCMAIL: 62669-fixed@bugs.kde.org
CCMAIL: 71611-fixed@bugs.kde.org


  M +19 -35    systemtray.cpp   1.34
  M +3 -0      chatwindow/kopeteemailwindow.cpp   1.30


--- kdenetwork/kopete/kopete/systemtray.cpp  #1.33:1.34
@@ -139,8 +139,9 @@ void KopeteSystemTray::startBlink( const
 }
 
-void KopeteSystemTray::startBlink( const QMovie &icon )
+void KopeteSystemTray::startBlink( const QMovie &movie )
 {
         kdDebug( 14010 ) << k_funcinfo << "starting movie." << endl;
-        setMovie( icon );
+        const_cast<QMovie &>( movie ).unpause();
+        setMovie( movie );
         mIsBlinking = true;
 }
@@ -148,5 +149,6 @@ void KopeteSystemTray::startBlink( const
 void KopeteSystemTray::startBlink()
 {
-        if( mMovie.isNull() )
+        if ( mMovie.isNull() )
+        {
 #if KDE_IS_VERSION(3, 1, 90)
                 mMovie = KGlobal::iconLoader()->loadMovie( QString::fromLatin1( \
"newmessage" ), KIcon::Panel ); @@ -154,4 +156,6 @@ void \
                KopeteSystemTray::startBlink()
                 mMovie = KopeteCompat::loadMovie( QString::fromLatin1( "newmessage" \
), KIcon::Panel );  #endif
+        }
+
         startBlink( mMovie );
 }
@@ -159,41 +163,22 @@ void KopeteSystemTray::startBlink()
 void KopeteSystemTray::stopBlink()
 {
-        if(movie())
-        {
-                kdDebug(14010) << k_funcinfo << "stopping movie." << endl;
-                setPixmap(mKopeteIcon);
-                mIsBlinkIcon = false;
-                mIsBlinking=false;
-                return;
-        }
-
-        if (mBlinkTimer->isActive() == true)
-        {
+        if ( movie() )
+                kdDebug( 14010 ) << k_funcinfo << "stopping movie." << endl;
+        else if ( mBlinkTimer->isActive() )
                 mBlinkTimer->stop();
-                setPixmap(mKopeteIcon);
-                mIsBlinkIcon = false;
-                mIsBlinking = false;
 
-        }
-        else
-        {
-                setPixmap(mKopeteIcon);
+        if ( !mMovie.isNull() )
+                mMovie.pause();
+
                 mIsBlinkIcon = false;
                 mIsBlinking = false;
-        }
+        setPixmap( mKopeteIcon );
 }
 
 void KopeteSystemTray::slotBlink()
 {
-        if (mIsBlinkIcon == true)
-        {
-                setPixmap(mKopeteIcon);
-                mIsBlinkIcon = false;
-        }
-        else
-        {
-                setPixmap(mBlinkIcon);
-                mIsBlinkIcon = true;
-        }
+        setPixmap( mIsBlinkIcon ? mKopeteIcon : mBlinkIcon );
+
+        mIsBlinkIcon = !mIsBlinkIcon;
 }
 

--- kdenetwork/kopete/kopete/chatwindow/kopeteemailwindow.cpp  #1.29:1.30
@@ -282,4 +282,5 @@ void KopeteEmailWindow::initActions(void
         d->animIcon = KopeteCompat::loadMovie( QString::fromLatin1( "newmessage" ), \
KIcon::Toolbar);  #endif
+        d->animIcon.pause();
 
         d->anim = new QLabel( this, "kde toolbar widget" );
@@ -519,4 +520,5 @@ void KopeteEmailWindow::sendMessage()
         d->sendInProgress = true;
         d->anim->setMovie( d->animIcon );
+        d->animIcon.unpause();
         d->btnReplySend->setEnabled( false );
         d->txtEntry->setEnabled( false );
@@ -529,4 +531,5 @@ void KopeteEmailWindow::messageSentSucce
         d->sendInProgress = false;
         d->anim->setPixmap( d->normalIcon );
+        d->animIcon.pause();
         closeView();
 }
_______________________________________________
Kopete-devel mailing list
Kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel


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

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