[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.1/kdeedu/marble
From: Jens-Michael Hoffmann <jensmh () gmx ! de>
Date: 2008-08-06 19:27:06
Message-ID: 1218050826.656341.12473.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 843235 by jmhoffmann:
Change container type of m_jobQueue from QQueue to QStack which
has the advantage that tiles of the current visited area are
loaded first.
This is noticable if you scroll and zoom a lot or if the internet
connection is slower than DSL like GPRS/EDGE or even 3G GSM.
Backported from trunk.
M +12 -0 ChangeLog
M +11 -8 src/lib/HttpDownloadManager.cpp
M +2 -1 src/lib/HttpDownloadManager.h
--- branches/KDE/4.1/kdeedu/marble/ChangeLog #843234:843235
@@ -1,3 +1,15 @@
+2008-08-06 Jens-Michael Hoffmann <jensmh@gmx.de>
+
+ * src/lib/HttpDownloadManager.cpp:
+ * src/lib/HttpDownloadManager.h:
+
+ Change container type of m_jobQueue from QQueue to QStack which
+ has the advantage that tiles of the current visited area are
+ loaded first.
+ This is noticable if you scroll and zoom a lot or if the internet
+ connection is slower than DSL like GPRS/EDGE or even 3G GSM.
+ Backported from trunk.
+
2008-08-01 Patrick Spendrin <ps_ml@gmx.de>
* src/lib/CMakeLists.txt
--- branches/KDE/4.1/kdeedu/marble/src/lib/HttpDownloadManager.cpp #843234:843235
@@ -44,6 +44,8 @@
qDeleteAll ( m_jobQueue );
m_jobQueue.clear();
+ // activated jobs have to be deleted using deleteLater()
+ // because they may be connected to signals
QList<HttpJob*>::const_iterator pos = m_activatedJobList.begin();
QList<HttpJob*>::const_iterator const end = m_activatedJobList.end();
for (; pos != end; ++pos ) {
@@ -89,7 +91,7 @@
HttpJob *job = new HttpJob ( sourceUrl, relativeUrlString, id );
if ( acceptJob ( job ) )
{
- m_jobQueue.enqueue ( job );
+ m_jobQueue.push ( job );
job->setStatus ( Pending );
activateJobs();
}
@@ -107,7 +109,7 @@
HttpJob *job = new HttpJob ( sourceUrl, destFileName, id );
if ( acceptJob ( job ) )
{
- m_jobQueue.enqueue ( job );
+ m_jobQueue.push ( job );
job->setStatus ( Pending );
activateJobs();
}
@@ -119,20 +121,21 @@
bool HttpDownloadManager::acceptJob ( HttpJob *job )
{
- QList<HttpJob*>::iterator i;
-
// We update the initiatorId as the previous initiator
// likely doesn't exist anymore
- for ( i = m_jobQueue.begin(); i != m_jobQueue.end(); ++i )
+ QStack<HttpJob*>::iterator j;
+ for ( j = m_jobQueue.begin(); j != m_jobQueue.end(); ++j )
{
- if ( job->originalDestinationFileName() == ( *i \
)->originalDestinationFileName() ) + if ( job->originalDestinationFileName() \
== ( *j )->originalDestinationFileName() ) {
qDebug() << "Download rejected: It's in the queue already.";
- ( *i )->setInitiatorId ( job->initiatorId() );
+ ( *j )->setInitiatorId ( job->initiatorId() );
return false;
}
}
+
+ QList<HttpJob*>::iterator i;
for ( i = m_activatedJobList.begin(); i != m_activatedJobList.end(); ++i )
{
if ( job->originalDestinationFileName() == ( *i \
)->originalDestinationFileName() ) @@ -175,7 +178,7 @@
while ( m_jobQueue.count() > 0
&& m_activatedJobList.count() < m_activatedJobsLimit )
{
- HttpJob *job = m_jobQueue.dequeue();
+ HttpJob *job = m_jobQueue.pop();
// qDebug() << "On activatedJobList: " << job->sourceUrl().toString() << \
job->destinationFileName(); m_activatedJobList.push_back ( job );
--- branches/KDE/4.1/kdeedu/marble/src/lib/HttpDownloadManager.h #843234:843235
@@ -24,6 +24,7 @@
#include <QtCore/QQueue>
#include <QtCore/QList>
#include <QtCore/QDebug>
+#include <QtCore/QStack>
#include "marble_export.h"
@@ -108,7 +109,7 @@
bool acceptJob( HttpJob *job );
bool m_downloadEnabled;
- QQueue<HttpJob*> m_jobQueue;
+ QStack<HttpJob*> m_jobQueue;
QList<HttpJob*> m_activatedJobList;
QList<HttpJob*> m_jobBlackList;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic