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

List:       kde-commits
Subject:    kdenonbeta/kopete/libkopete/ui
From:       Martijn Klingens <klingens () kde ! org>
Date:       2002-12-11 22:29:54
[Download RAW message or body]

CVS commit by mklingens: 

Also add support for mng movies besides pixmaps.

Or rather, try to add support for that, because it doesn't seem to work
yet :( It's beyond me why it doesn't work though, I'd say that


 KIconLoader *loader = KGlobal::instance()->iconLoader();
 QString path = loader->moviePath( "msn_connecting", KIcon::User, 0 );

should be able to find $KDEDIR/share/apps/kopete/pics/msn_connecting.mng,
but it does not.


  M +28 -2     kopetewindow.cpp   1.54


--- kdenonbeta/kopete/libkopete/ui/kopetewindow.cpp  #1.53:1.54
@@ -371,6 +371,7 @@ void KopeteWindow::slotPluginLoaded( Kop
                 const QPoint & ) ) );
 
-        i->setPixmap( SmallIcon( proto->statusIcon() ) );
         m_statusBarIcons.insert( proto, i );
+
+        slotProtocolStatusIconChanged( proto, proto->statusIcon() );
 }
 
@@ -396,5 +397,30 @@ void KopeteWindow::slotProtocolStatusIco
                 return;
 
-        i->setPixmap( SmallIcon( icon ) );
+        // Because we want null pixmaps to detect the need for a loadMovie
+        // we can't use the SmallIcon() method directly
+        KIconLoader *loader = KGlobal::instance()->iconLoader();
+        QPixmap pm = loader->loadIcon( icon, KIcon::User, 0, KIcon::DefaultState, 0L,
+                true );
+        if( pm.isNull() )
+        {
+                QString path = loader->moviePath( icon, KIcon::User, 0 );
+                if( path.isEmpty() )
+                {
+                        kdDebug() << "KopeteWindow::slotProtocolStatusIconChanged(): "
+                                << "Using unknown pixmap for status icon '" << icon << "'."
+                                << endl;
+                        i->setPixmap( KIconLoader::unknown() );
+                }
+                else
+                {
+                        kdDebug() << "KopeteWindow::slotProtocolStatusIconChanged(): "
+                                << "Using movie: " << path << endl;
+                        i->setMovie( QMovie( path ) );
+                }
+        }
+        else
+        {
+                i->setPixmap( pm );
+        }
 }
 


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

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