mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Merge pull request #30077 from m-kuhn/cache_location
Use system cache location instead of profile folder for network cache
This commit is contained in:
commit
4bca6a8c6c
@ -374,12 +374,12 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
|
||||
|
||||
// cache settings
|
||||
mCacheDirectory->setText( mSettings->value( QStringLiteral( "cache/directory" ) ).toString() );
|
||||
mCacheDirectory->setPlaceholderText( QDir( QgsApplication::qgisSettingsDirPath() ).canonicalPath() + QDir::separator() + QStringLiteral( "cache" ) );
|
||||
mCacheDirectory->setPlaceholderText( QStandardPaths::writableLocation( QStandardPaths::CacheLocation ) );
|
||||
mCacheSize->setMinimum( 0 );
|
||||
mCacheSize->setMaximum( std::numeric_limits<int>::max() );
|
||||
mCacheSize->setSingleStep( 1024 );
|
||||
qint64 cacheSize = mSettings->value( QStringLiteral( "cache/size" ), 50 * 1024 * 1024 ).toULongLong();
|
||||
mCacheSize->setValue( ( int )( cacheSize / 1024 ) );
|
||||
qint64 cacheSize = mSettings->value( QStringLiteral( "cache/size" ), 50 * 1024 * 1024 ).toLongLong();
|
||||
mCacheSize->setValue( static_cast<int>( cacheSize / 1024 ) );
|
||||
connect( mBrowseCacheDirectory, &QAbstractButton::clicked, this, &QgsOptions::browseCacheDirectory );
|
||||
connect( mClearCache, &QAbstractButton::clicked, this, &QgsOptions::clearCache );
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QThreadStorage>
|
||||
#include <QAuthenticator>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslConfiguration>
|
||||
@ -601,8 +602,8 @@ void QgsNetworkAccessManager::setupDefaultProxyAndCache( Qt::ConnectionType conn
|
||||
|
||||
QString cacheDirectory = settings.value( QStringLiteral( "cache/directory" ) ).toString();
|
||||
if ( cacheDirectory.isEmpty() )
|
||||
cacheDirectory = QgsApplication::qgisSettingsDirPath() + "cache";
|
||||
qint64 cacheSize = settings.value( QStringLiteral( "cache/size" ), 50 * 1024 * 1024 ).toULongLong();
|
||||
cacheDirectory = QStandardPaths::writableLocation( QStandardPaths::CacheLocation );
|
||||
qint64 cacheSize = settings.value( QStringLiteral( "cache/size" ), 50 * 1024 * 1024 ).toLongLong();
|
||||
newcache->setCacheDirectory( cacheDirectory );
|
||||
newcache->setMaximumCacheSize( cacheSize );
|
||||
QgsDebugMsgLevel( QStringLiteral( "cacheDirectory: %1" ).arg( newcache->cacheDirectory() ), 4 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user