From 7776caf451bc69219c1455234378c919710595b4 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Thu, 8 Oct 2015 17:53:57 +0200 Subject: Only store proxy config if it is really set --- .../gui/workflow/config/ConfigProviderImpl.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java index 886ec793..c43f3293 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java @@ -297,11 +297,20 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, props.clear(); props.setProperty(Constants.CFG_BKU, getDefaultBKUPersistent().toString()); - props.setProperty(Constants.CFG_PROXY_HOST, getProxyHostPersistent()); - props.setProperty(Constants.CFG_PROXY_PORT, - Integer.toString(getProxyPortPersistent())); - props.setProperty(Constants.CFG_PROXY_USER, getProxyUserPersistent()); - props.setProperty(Constants.CFG_PROXY_PASS, getProxyPassPersistent()); + + String proxyHost = getProxyHostPersistent(); + if (proxyHost != STRING_EMPTY) + props.setProperty(Constants.CFG_PROXY_HOST, proxyHost); + int proxyPort = getProxyPortPersistent(); + if (proxyPort != -1) + props.setProperty(Constants.CFG_PROXY_PORT,Integer.toString(proxyPort)); + String proxyUser = getProxyUserPersistent(); + if (proxyUser != STRING_EMPTY) + props.setProperty(Constants.CFG_PROXY_USER, proxyUser); + String proxyPass = getProxyPassPersistent(); + if (proxyPass != STRING_EMPTY) + props.setProperty(Constants.CFG_PROXY_PASS, proxyPass); + props.setProperty(Constants.CFG_EMBLEM, getDefaultEmblemPersistent()); props.setProperty(Constants.CFG_SIGNATURE_NOTE, getSignatureNote()); props.setProperty(Constants.CFG_MOBILE_NUMBER, getDefaultMobileNumberPersistent()); -- cgit v1.2.3