[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Sun Oct 11 17:43:20 CEST 2009
SVN commit 1033924 by jmhoffmann:
HttpDownloadManager API cleanup: obsolete methods setServerUrl and addJob removed, also corresponding member variable and constructor parameter.
M +1 -2 AbstractDataPluginModel.cpp
M +4 -20 HttpDownloadManager.cpp
M +1 -11 HttpDownloadManager.h
M +1 -1 MarbleModel.cpp
--- trunk/KDE/kdeedu/marble/src/lib/AbstractDataPluginModel.cpp #1033923:1033924
@@ -108,8 +108,7 @@
// Initializing file and download System
CacheStoragePolicy *storagePolicy = new CacheStoragePolicy( MarbleDirs::localPath()
+ "/cache/" + d->m_name + '/' );
- d->m_downloadManager = new HttpDownloadManager( QUrl(),
- storagePolicy );
+ d->m_downloadManager = new HttpDownloadManager( storagePolicy );
connect( d->m_downloadManager, SIGNAL( downloadComplete( QString, QString ) ),
this, SLOT( processFinishedJob( QString , QString ) ) );
--- trunk/KDE/kdeedu/marble/src/lib/HttpDownloadManager.cpp #1033923:1033924
@@ -32,7 +32,7 @@
class HttpDownloadManager::Private
{
public:
- Private( const QUrl& serverUrl, StoragePolicy *policy );
+ explicit Private( StoragePolicy *policy );
~Private();
bool m_downloadEnabled;
@@ -44,16 +44,14 @@
* - a queue for retries of failed downloads */
QMap<DownloadPolicyKey, DownloadQueueSet *> m_queueSets;
int m_jobQueueLimit;
- QUrl m_serverUrl;
StoragePolicy *m_storagePolicy;
NetworkPlugin *m_networkPlugin;
};
-HttpDownloadManager::Private::Private( const QUrl& serverUrl, StoragePolicy *policy )
+HttpDownloadManager::Private::Private( StoragePolicy *policy )
: m_downloadEnabled( true ), //enabled for now
m_requeueTimer( 0 ),
m_jobQueueLimit( 1000 ),
- m_serverUrl( serverUrl ),
m_storagePolicy( policy ),
m_networkPlugin( 0 )
{
@@ -66,9 +64,8 @@
}
-HttpDownloadManager::HttpDownloadManager( const QUrl& serverUrl,
- StoragePolicy *policy )
- : d( new Private( serverUrl, policy ))
+HttpDownloadManager::HttpDownloadManager( StoragePolicy *policy )
+ : d( new Private( policy ))
{
d->m_requeueTimer = new QTimer( this );
d->m_requeueTimer->setInterval( requeueTime );
@@ -87,11 +84,6 @@
delete d;
}
-void HttpDownloadManager::setServerUrl( const QUrl& serverUrl )
-{
- d->m_serverUrl = serverUrl;
-}
-
void HttpDownloadManager::setJobQueueLimit( int jobQueueLimit )
{
d->m_jobQueueLimit = jobQueueLimit;
@@ -126,14 +118,6 @@
return d->m_storagePolicy;
}
-void HttpDownloadManager::addJob( const QString& relativeUrlString, const QString &id )
-{
- QUrl sourceUrl( d->m_serverUrl );
- QString path = sourceUrl.path();
- sourceUrl.setPath( path + relativeUrlString );
- addJob( sourceUrl, relativeUrlString, id );
-}
-
void HttpDownloadManager::addJob( const QUrl& sourceUrl, const QString& destFileName,
const QString &id )
{
--- trunk/KDE/kdeedu/marble/src/lib/HttpDownloadManager.h #1033923:1033924
@@ -55,10 +55,9 @@
/**
* Creates a new http download manager.
*
- * @param serverUrl The url of the server to download from.
* @param policy The storage policy for this manager.
*/
- HttpDownloadManager( const QUrl& serverUrl, StoragePolicy *policy );
+ explicit HttpDownloadManager( StoragePolicy *policy );
/**
* Destroys the http download manager.
@@ -66,11 +65,6 @@
virtual ~HttpDownloadManager();
/**
- * Sets the url of the server to download from.
- */
- void setServerUrl( const QUrl& serverUrl );
-
- /**
* Sets the limit of jobs to be queued.
*/
void setJobQueueLimit( int jobQueueLimit );
@@ -89,10 +83,6 @@
StoragePolicy* storagePolicy() const;
public Q_SLOTS:
- /**
- * Adds a new job with the relative url and the given id.
- */
- void addJob( const QString& relativeUrlString, const QString &id );
/**
* Adds a new job with a sourceUrl, destination file name and given id.
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1033923:1033924
@@ -86,7 +86,7 @@
m_dataFacade( 0 ),
m_mapTheme( 0 ),
m_layerManager( 0 ),
- m_downloadManager( new HttpDownloadManager( QUrl(), new FileStoragePolicy(
+ m_downloadManager( new HttpDownloadManager( new FileStoragePolicy(
MarbleDirs::localPath() ))),
m_fileManager( 0 ),
m_placemarkmanager( 0 )
More information about the Marble-commits
mailing list