[vlc-devel] commit: qt4: Don't update art when it hasn't changed ( Rafaël Carré )

git version control git at videolan.org
Sun Jan 17 11:10:53 CET 2010


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Sun Jan 17 11:09:46 2010 +0100| [5c66bbbf5285dcc3fe57bf0f682deb37e001c766] | committer: Rafaël Carré 

qt4: Don't update art when it hasn't changed

This gives a use to the otherwise useless artUrl variable
This prevents qt4 interface from consuming 100% of CPU when art image
has to be scaled from a big source picture

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5c66bbbf5285dcc3fe57bf0f682deb37e001c766
---

 modules/gui/qt4/input_manager.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 1650d4e..b6af6b3 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -614,8 +614,13 @@ void InputManager::UpdateArt()
         url = url.replace( "attachment://", "" );
     }
 
+    /* the art hasn't changed, no need to update */
+    if(artUrl == url)
+        return;
+
     /* Update Art meta */
-    emit artChanged( url );
+    artUrl = url;
+    emit artChanged( artUrl );
 }
 
 inline void InputManager::UpdateStats()




More information about the vlc-devel mailing list