[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [muon] libmuon/DetailsTabs: When switching between multiple
From:       Jonathan Thomas <echidnaman () kubuntu ! org>
Date:       2011-08-31 23:38:28
Message-ID: 20110831233828.3DFA4A6078 () git ! kde ! org
[Download RAW message or body]

Git commit 8803e4a0f9c182eaf41e34f20857bdadadcff9ed by Jonathan Thomas.
Committed on 01/09/2011 at 01:38.
Pushed by jmthomas into branch 'master'.

When switching between multiple packages before their changelogs download, stop the download
of the changelog. Otherwise, when they all finally do download they all flash before our
eyes before settling on the correct changelog.

M  +8    -0    libmuon/DetailsTabs/ChangelogTab.cpp

http://commits.kde.org/muon/8803e4a0f9c182eaf41e34f20857bdadadcff9ed

diff --git a/libmuon/DetailsTabs/ChangelogTab.cpp b/libmuon/DetailsTabs/ChangelogTab.cpp
index 1d39d31..0602bec 100644
--- a/libmuon/DetailsTabs/ChangelogTab.cpp
+++ b/libmuon/DetailsTabs/ChangelogTab.cpp
@@ -55,6 +55,14 @@ ChangelogTab::~ChangelogTab()
 
 void ChangelogTab::setPackage(QApt::Package *package)
 {
+    // Clean up old jobs
+    QHash<KJob *, QString>::const_iterator i = m_jobFilenames.constBegin();
+    while (i != m_jobFilenames.constEnd()) {
+        i.key()->kill();
+        ++i;
+    }
+    m_jobFilenames.clear(); // We don't delete the KJob pointers, they delete themselves
+
     m_package = package;
     fetchChangelog();
 }

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic