Hello community, here is the log from the commit of package plasma-addons for openSUSE:Factory checked in at Thu Apr 21 13:42:03 CEST 2011.
-------- --- plasma-addons/plasma-addons.changes 2011-04-01 20:36:17.000000000 +0200 +++ /mounts/work_src_done/STABLE/plasma-addons/plasma-addons.changes 2011-04-11 17:47:56.000000000 +0200 @@ -1,0 +2,5 @@ +Mon Apr 11 15:46:37 UTC 2011 - wstephen...@novell.com + +- Add patch for memory leak in comic applet + +------------------------------------------------------------------- @@ -8 +12,0 @@ - @@ -15 +18,0 @@ - calling whatdependson for head-i586 New: ---- 4ab9e40e-comic-memleak.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ plasma-addons.spec ++++++ --- /var/tmp/diff_new_pack.Sd6IGu/_old 2011-04-21 13:41:05.000000000 +0200 +++ /var/tmp/diff_new_pack.Sd6IGu/_new 2011-04-21 13:41:05.000000000 +0200 @@ -39,11 +39,12 @@ Summary: Additional Plasma Widgets Url: http://www.kde.org/ Version: 4.6.2 -Release: 1 +Release: 3 Source0: kdeplasma-addons-%{version}.tar.bz2 Patch0: 4_6_BRANCH.diff Patch1: krunner-akonadi-dont-cause-start.diff Patch2: lancelot-suse.diff +Patch3: 4ab9e40e-comic-memleak.diff Provides: extragear-plasma = 4.0.80 Obsoletes: extragear-plasma <= 4.0.80 Provides: kdebase4-workspace-plasmoids = 4.0.4 @@ -111,6 +112,7 @@ %patch0 %patch1 %patch2 +%patch3 -p1 %build %cmake_kde4 -d build ++++++ 4ab9e40e-comic-memleak.diff ++++++ commit 4ab9e40e1e3484a4adf059164c91e06d1f5b6b76 Author: Matthias Fuchs <ma...@gmx.net> Date: Thu Apr 7 15:32:26 2011 +0200 Fixes prefetching. Now constant useage of the comic applet does not lead to high memory usage. REVIEW:101046 diff --git a/applets/comic/comic.cpp b/applets/comic/comic.cpp index 72edadd..d9bd496 100644 --- a/applets/comic/comic.cpp +++ b/applets/comic/comic.cpp @@ -329,16 +329,26 @@ void ComicApplet::setTabBarVisible( bool isVisible ) } } -void ComicApplet::dataUpdated( const QString&, const Plasma::DataEngine::Data &data ) +void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::Data &data ) { + //disconnect prefetched comic strips + if ( source != mOldSource ) { + mEngine->disconnectSource( source, this ); + return; + } + setBusy( false ); setConfigurationRequired( false ); slotStartTimer(); //there was an error, display information as image - if ( data[ "Error" ].toBool() ) { - if ( !mShowErrorPicture && !data[ "Previous identifier suffix" ].toString().isEmpty() ) { - updateComic( data[ "Previous identifier suffix" ].toString() ); + const bool hasError = data[ "Error" ].toBool(); + const bool errorAutoFixable = data[ "Error automatically fixable" ].toBool(); + if ( hasError ) { + const QString previousIdentifierSuffix = data[ "Previous identifier suffix" ].toString(); + if ( !mShowErrorPicture && !previousIdentifierSuffix.isEmpty() ) { + mEngine->disconnectSource( source, this ); + updateComic( previousIdentifierSuffix ); return; } QPixmap errorPic( 500, 400 ); @@ -425,6 +435,11 @@ void ComicApplet::dataUpdated( const QString&, const Plasma::DataEngine::Data &d mLabelUrl->setText( mWebsiteUrl.host() ); mImageWidget->setScaled( !mScaleComic ); + //disconnect if there is either no error, or an error that can not be fixed automatically + if ( !errorAutoFixable ) { + mEngine->disconnectSource( source, this ); + } + setTabBarVisible( mShowTabBar && mUseTabs ); mLabelTop->setVisible( ( mShowComicAuthor || mShowComicTitle ) && !mLabelTop->text().isEmpty() ); mLabelId->setVisible( mShowComicIdentifier && !mLabelId->text().isEmpty() ); @@ -454,11 +469,14 @@ void ComicApplet::dataUpdated( const QString&, const Plasma::DataEngine::Data &d //prefetch the previous and following comic for faster navigation if ( !mNextIdentifierSuffix.isEmpty() ) { - mEngine->query( mComicIdentifier + ':' + mNextIdentifierSuffix ); + const QString prefetch = mComicIdentifier + ':' + mNextIdentifierSuffix; + mEngine->connectSource( prefetch, this ); + mEngine->query( prefetch ); } - if ( !mPreviousIdentifierSuffix.isEmpty() ) { - mEngine->query( mComicIdentifier + ':' + mPreviousIdentifierSuffix ); + const QString prefetch = mComicIdentifier + ':' + mPreviousIdentifierSuffix; + mEngine->connectSource( prefetch, this ); + mEngine->query( prefetch ); } } @@ -838,6 +856,7 @@ void ComicApplet::updateComic( const QString &identifierSuffix ) setConfigurationRequired( mComicIdentifier.isEmpty() ); if ( !mComicIdentifier.isEmpty() && mEngine && mEngine->isValid() ) { + setBusy( true ); const QString identifier = mComicIdentifier + ':' + identifierSuffix; diff --git a/dataengines/comic/comic.cpp b/dataengines/comic/comic.cpp index d226530..565b529 100644 --- a/dataengines/comic/comic.cpp +++ b/dataengines/comic/comic.cpp @@ -121,6 +121,7 @@ bool ComicEngine::updateSourceEvent( const QString &identifier ) if ( status != Solid::Networking::Connected && status != Solid::Networking::Unknown ) { mIdentifierError = identifier; setData( identifier, QLatin1String( "Error" ), true ); + setData( identifier, QLatin1String( "Error automatically fixable" ), true ); setData( identifier, QLatin1String( "Identifier" ), identifier ); setData( identifier, QLatin1String( "Previous identifier suffix" ), lastCachedIdentifier( identifier ) ); kWarning() << "No connection."; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org