Skip to content
Permalink
Browse files

fix saving/restoring proxy excluded URLs (fix #20933)

(cherry picked from commit fc9796f)
  • Loading branch information
alexbruy authored and nyalldawson committed Jan 29, 2019
1 parent 6780874 commit b16dd5f138a64b5c0503b8c63f18ae79d0754292
Showing with 5 additions and 9 deletions.
  1. +3 −7 src/app/qgsoptions.cpp
  2. +1 −1 src/core/qgsnetworkaccessmanager.cpp
  3. +1 −1 src/providers/ogr/qgsogrprovider.cpp
@@ -1381,16 +1381,12 @@ void QgsOptions::saveOptions()
mSettings->setValue( QStringLiteral( "cache/size" ), QVariant::fromValue( mCacheSize->value() * 1024L ) );

//url to exclude from proxys
QString proxyExcludeString;
QStringList excludedUrls;
for ( int i = 0; i < mExcludeUrlListWidget->count(); ++i )
{
if ( i != 0 )
{
proxyExcludeString += '|';
}
proxyExcludeString += mExcludeUrlListWidget->item( i )->text();
excludedUrls << mExcludeUrlListWidget->item( i )->text();
}
mSettings->setValue( QStringLiteral( "proxy/proxyExcludedUrls" ), proxyExcludeString );
mSettings->setValue( QStringLiteral( "proxy/proxyExcludedUrls" ), excludedUrls );

QgisApp::instance()->namUpdate();

@@ -316,7 +316,7 @@ void QgsNetworkAccessManager::setupDefaultProxyAndCache( Qt::ConnectionType conn
bool proxyEnabled = settings.value( QStringLiteral( "proxy/proxyEnabled" ), false ).toBool();
if ( proxyEnabled )
{
excludes = settings.value( QStringLiteral( "proxy/proxyExcludedUrls" ), "" ).toString().split( '|', QString::SkipEmptyParts );
excludes = settings.value( QStringLiteral( "proxy/proxyExcludedUrls" ), "" ).toStringList();

//read type, host, port, user, passw from settings
QString proxyHost = settings.value( QStringLiteral( "proxy/proxyHost" ), "" ).toString();
@@ -2335,7 +2335,7 @@ void QgsOgrProvider::setupProxy()
QNetworkProxy proxy( proxyes.first() );
// TODO/FIXME: check excludes (the GDAL config options are global, we need a per-connection config option)
//QStringList excludes;
//excludes = settings.value( QStringLiteral( "proxy/proxyExcludedUrls" ), "" ).toString().split( '|', QString::SkipEmptyParts );
//excludes = settings.value( QStringLiteral( "proxy/proxyExcludedUrls" ), "" ).toStringList();

QString proxyHost( proxy.hostName() );
qint16 proxyPort( proxy.port() );

0 comments on commit b16dd5f

Please sign in to comment.
You can’t perform that action at this time.