diff options
Diffstat (limited to 'kde-unstable/kdebase-runtime')
-rw-r--r-- | kde-unstable/kdebase-runtime/PKGBUILD | 18 | ||||
-rw-r--r-- | kde-unstable/kdebase-runtime/fix-nepomuk-cpu-usage.patch | 133 |
2 files changed, 144 insertions, 7 deletions
diff --git a/kde-unstable/kdebase-runtime/PKGBUILD b/kde-unstable/kdebase-runtime/PKGBUILD index c49aa3d99..2ea26c20d 100644 --- a/kde-unstable/kdebase-runtime/PKGBUILD +++ b/kde-unstable/kdebase-runtime/PKGBUILD @@ -1,11 +1,10 @@ -# $Id: PKGBUILD 129338 2011-06-26 20:22:13Z andrea $ +# $Id: PKGBUILD 131357 2011-07-12 20:18:53Z andrea $ # Maintainer: Andrea Scarpino <andrea@archlinux.org> # Contributor: Pierre Schmitz <pierre@archlinux.de> pkgname=kdebase-runtime -_pkgname=kde-runtime -pkgver=4.6.90 -pkgrel=2 +pkgver=4.6.95 +pkgrel=1 pkgdesc="KDE Base Runtime Environment" arch=('i686' 'x86_64') url='http://www.kde.org' @@ -17,14 +16,19 @@ optdepends=('htdig: to build the search index in khelpcenter' 'rarian: needed by khelpcenter' 'gdb: drkonq crash handler') install="${pkgname}.install" -source=("http://download.kde.org/unstable/${pkgver}/src/${_pkgname}-${pkgver}.tar.bz2") -sha1sums=('9bc01f0e829b355f110246f28daed6496d96f335') +source=("http://download.kde.org/unstable/${pkgver}/src/kde-runtime-${pkgver}.tar.bz2" + 'fix-nepomuk-cpu-usage.patch') +sha1sums=('8782bca0ca5afae9c600cc29346968669b940251' + 'dcddfd7b3191597edaaab93d358e6ff87c53a627') build() { + cd "${srcdir}"/kde-runtime-${pkgver} + patch -p1 -i "${srcdir}"/fix-nepomuk-cpu-usage.patch + cd "${srcdir}" mkdir build cd build - cmake ../${_pkgname}-${pkgver} \ + cmake ../kde-runtime-${pkgver} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_INSTALL_PREFIX=/usr diff --git a/kde-unstable/kdebase-runtime/fix-nepomuk-cpu-usage.patch b/kde-unstable/kdebase-runtime/fix-nepomuk-cpu-usage.patch new file mode 100644 index 000000000..545072807 --- /dev/null +++ b/kde-unstable/kdebase-runtime/fix-nepomuk-cpu-usage.patch @@ -0,0 +1,133 @@ +commit 327ec9a67af653467b670115ebb3e26b00183c1d +Author: Sebastian Trueg <trueg@kde.org> +Date: Thu Jul 7 17:33:23 2011 +0200 + + Throttle the IndexCleaner the same way we do with the IndexScheduler. + + BUG: 276593 + +diff --git a/nepomuk/services/strigi/indexcleaner.cpp b/nepomuk/services/strigi/indexcleaner.cpp +index 5c604ab..9198d0b 100644 +--- a/nepomuk/services/strigi/indexcleaner.cpp ++++ b/nepomuk/services/strigi/indexcleaner.cpp +@@ -47,7 +47,8 @@ using namespace Soprano::Vocabulary; + + + Nepomuk::IndexCleaner::IndexCleaner(QObject* parent) +- : KJob(parent) ++ : KJob(parent), ++ m_delay(0) + { + setCapabilities( Suspendable ); + } +@@ -268,7 +269,7 @@ void Nepomuk::IndexCleaner::slotRemoveResourcesDone(KJob* job) + + QMutexLocker lock(&m_stateMutex); + if( !m_suspended ) { +- clearNextBatch(); ++ QTimer::singleShot(m_delay, this, SLOT(clearNextBatch())); + } + } + +@@ -313,4 +314,9 @@ bool Nepomuk::IndexCleaner::doResume() + return true; + } + ++void Nepomuk::IndexCleaner::setDelay(int msecs) ++{ ++ m_delay = msecs; ++} ++ + #include "indexcleaner.moc" +diff --git a/nepomuk/services/strigi/indexcleaner.h b/nepomuk/services/strigi/indexcleaner.h +index e1c38ca..bf0713e 100644 +--- a/nepomuk/services/strigi/indexcleaner.h ++++ b/nepomuk/services/strigi/indexcleaner.h +@@ -41,6 +41,16 @@ namespace Nepomuk { + virtual bool doSuspend(); + virtual bool doResume(); + ++ public slots: ++ /** ++ * Set the delay between the cleanup queries. ++ * Used for throtteling the cleaner to not grab too ++ * many resources. Default is 0. ++ * ++ * \sa IndexScheduler::setIndexingSpeed() ++ */ ++ void setDelay(int msecs); ++ + private slots: + void clearNextBatch(); + void slotRemoveResourcesDone(KJob* job); +@@ -52,6 +62,7 @@ namespace Nepomuk { + + QMutex m_stateMutex; + bool m_suspended; ++ int m_delay; + }; + } + +diff --git a/nepomuk/services/strigi/indexscheduler.cpp b/nepomuk/services/strigi/indexscheduler.cpp +index 3c92657..f3c6c36 100644 +--- a/nepomuk/services/strigi/indexscheduler.cpp ++++ b/nepomuk/services/strigi/indexscheduler.cpp +@@ -208,7 +208,7 @@ Nepomuk::IndexScheduler::IndexScheduler( QObject* parent ) + : QObject( parent ), + m_suspended( false ), + m_indexing( false ), +- m_speed( FullSpeed ) ++ m_indexingDelay( 0 ) + { + m_cleaner = new IndexCleaner(this); + connect( m_cleaner, SIGNAL(finished(KJob*)), this, SLOT(slotCleaningDone()) ); +@@ -266,7 +266,13 @@ void Nepomuk::IndexScheduler::setSuspended( bool suspended ) + void Nepomuk::IndexScheduler::setIndexingSpeed( IndexingSpeed speed ) + { + kDebug() << speed; +- m_speed = speed; ++ m_indexingDelay = 0; ++ if ( speed != FullSpeed ) { ++ m_indexingDelay = (speed == ReducedSpeed) ? s_reducedSpeedDelay : s_snailPaceDelay; ++ } ++ if( m_cleaner ) { ++ m_cleaner->setDelay(m_indexingDelay); ++ } + } + + +@@ -481,11 +487,7 @@ bool Nepomuk::IndexScheduler::analyzeDir( const QString& dir_, Nepomuk::IndexSch + void Nepomuk::IndexScheduler::callDoIndexing() + { + if( !m_suspended ) { +- uint delay = 0; +- if ( m_speed != FullSpeed ) { +- delay = (m_speed == ReducedSpeed) ? s_reducedSpeedDelay : s_snailPaceDelay; +- } +- QTimer::singleShot( delay, this, SLOT(doIndexing()) ); ++ QTimer::singleShot( m_indexingDelay, this, SLOT(doIndexing()) ); + } + } + +diff --git a/nepomuk/services/strigi/indexscheduler.h b/nepomuk/services/strigi/indexscheduler.h +index 9ae1f18..8756206 100644 +--- a/nepomuk/services/strigi/indexscheduler.h ++++ b/nepomuk/services/strigi/indexscheduler.h +@@ -121,8 +121,6 @@ namespace Nepomuk { + SnailPace + }; + +- IndexingSpeed currentSpeed() const { return m_speed; } +- + public Q_SLOTS: + void suspend(); + void resume(); +@@ -226,7 +224,7 @@ namespace Nepomuk { + QString m_currentFolder; + KUrl m_currentUrl; + +- IndexingSpeed m_speed; ++ int m_indexingDelay; + IndexCleaner* m_cleaner; + }; + |