From a0b010bb00fe10f2b3e927ff0c465839d6993b84 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 28 Feb 2010 21:03:58 +0000 Subject: Only access the data of the thread that has been created most recently. Data of older threads will just get ignored. svn path=/trunk/KDE/kdebase/apps/; revision=1097289 --- src/panels/information/kloadmetadatathread.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/panels/information/kloadmetadatathread.cpp') diff --git a/src/panels/information/kloadmetadatathread.cpp b/src/panels/information/kloadmetadatathread.cpp index e95aca404..fc353c493 100644 --- a/src/panels/information/kloadmetadatathread.cpp +++ b/src/panels/information/kloadmetadatathread.cpp @@ -53,6 +53,13 @@ void KLoadMetaDataThread::load(const KUrl::List& urls) start(); } +void KLoadMetaDataThread::cancel() +{ + // Setting m_canceled to true will cancel KLoadMetaDataThread::run() + // as soon as run() gets the chance to check m_cancel. + m_canceled = true; +} + void KLoadMetaDataThread::cancelAndDelete() { if (isFinished()) { @@ -60,9 +67,10 @@ void KLoadMetaDataThread::cancelAndDelete() deleteLater(); } else { connect(this, SIGNAL(finished()), this, SLOT(slotFinished())); - m_canceled = true; // Setting m_canceled to true will cancel KLoadMetaDataThread::run() - // as soon as possible. Afterwards the thread will delete itself + // as soon as run() gets the chance to check m_cancel. + m_canceled = true; + // Afterwards the thread will delete itself // asynchronously inside slotFinished(). } } -- cgit v1.3