┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/kloadmetadatathread.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-02-28 21:03:58 +0000
committerPeter Penz <[email protected]>2010-02-28 21:03:58 +0000
commita0b010bb00fe10f2b3e927ff0c465839d6993b84 (patch)
tree09973a2b529582e0b603e3a37bf44b104a682edf /src/panels/information/kloadmetadatathread.cpp
parent072dacbb552cd743d99eb811aa4a2ddf4844090a (diff)
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
Diffstat (limited to 'src/panels/information/kloadmetadatathread.cpp')
-rw-r--r--src/panels/information/kloadmetadatathread.cpp12
1 files changed, 10 insertions, 2 deletions
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().
}
}