From d343a2b6393aec2eba0d25d7f4f390f12d1515f6 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 16 Nov 2023 12:55:48 +0100 Subject: tdf#146386 deprecate, remove usage of Inet::Settings::ooInetFTPProxyName * officecfg: deprecate Inet::Settings::ooInetFTPProxyName/Port * ucbhelper: stop handling these settings * sfx2: remove SID_INET_FTP_PROXY_NAME and SID_INET_FTP_PROXY_PORT and usage from SfxApplication::GetOptions() * shell: remove proxy config code from backends * stoc: the JavaVM would have its "ftp.proxyHost" properties set based on officecfg values; remove that * sysui,vcl: remove protocol from KDE desktop files and file picker Change-Id: Iba02676cf6e519e2fa60ba925209436d38e75f49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159500 Tested-by: Jenkins Reviewed-by: Michael Stahl --- shell/source/backends/desktopbe/desktopbackend.cxx | 2 - shell/source/backends/kf5be/kf5access.cxx | 54 ---------------------- shell/source/backends/kf5be/kf5backend.cxx | 12 ++--- shell/source/backends/macbe/macbackend.mm | 41 +--------------- shell/source/backends/wininetbe/wininetbackend.cxx | 27 +---------- 5 files changed, 7 insertions(+), 129 deletions(-) (limited to 'shell/source') diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index 8d001499bad0..c9a9d8dafcd2 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -237,8 +237,6 @@ css::uno::Any Default::getPropertyValue(OUString const & PropertyName) PropertyName == "ExternalMailer" || PropertyName == "SourceViewFontHeight" || PropertyName == "SourceViewFontName" || - PropertyName == "ooInetFTPProxyName" || - PropertyName == "ooInetFTPProxyPort" || PropertyName == "ooInetHTTPProxyName" || PropertyName == "ooInetHTTPProxyPort" || PropertyName == "ooInetHTTPSProxyName" || diff --git a/shell/source/backends/kf5be/kf5access.cxx b/shell/source/backends/kf5be/kf5access.cxx index bfb669cf2cbe..d266f147d68a 100644 --- a/shell/source/backends/kf5be/kf5access.cxx +++ b/shell/source/backends/kf5be/kf5access.cxx @@ -103,60 +103,6 @@ css::beans::Optional getValue(std::u16string_view id) osl_getFileURLFromSystemPath(sDocumentsDir.pData, &sDocumentsURL.pData); return css::beans::Optional(true, uno::Any(sDocumentsURL)); } - else if (id == u"ooInetFTPProxyName") - { - QString aFTPProxy; - switch (KProtocolManager::proxyType()) - { - case KProtocolManager::ManualProxy: // Proxies are manually configured - aFTPProxy = KProtocolManager::proxyFor(QStringLiteral("FTP")); - break; - case KProtocolManager::PACProxy: // A proxy configuration URL has been given - case KProtocolManager::WPADProxy: // A proxy should be automatically discovered - case KProtocolManager::EnvVarProxy: // Proxy values set through environment variables - // In such cases, the proxy address is not stored in KDE, but determined dynamically. - // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... - // The best we can do here is to ask the current value for a given address. - aFTPProxy = KProtocolManager::proxyForUrl( - QUrl(QStringLiteral("ftp://ftp.libreoffice.org"))); - break; - default: // No proxy is used - break; - } - if (!aFTPProxy.isEmpty()) - { - QUrl aProxy(aFTPProxy); - OUString sProxy = fromQStringToOUString(aProxy.host()); - return css::beans::Optional(true, uno::Any(sProxy)); - } - } - else if (id == u"ooInetFTPProxyPort") - { - QString aFTPProxy; - switch (KProtocolManager::proxyType()) - { - case KProtocolManager::ManualProxy: // Proxies are manually configured - aFTPProxy = KProtocolManager::proxyFor(QStringLiteral("FTP")); - break; - case KProtocolManager::PACProxy: // A proxy configuration URL has been given - case KProtocolManager::WPADProxy: // A proxy should be automatically discovered - case KProtocolManager::EnvVarProxy: // Proxy values set through environment variables - // In such cases, the proxy address is not stored in KDE, but determined dynamically. - // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... - // The best we can do here is to ask the current value for a given address. - aFTPProxy = KProtocolManager::proxyForUrl( - QUrl(QStringLiteral("ftp://ftp.libreoffice.org"))); - break; - default: // No proxy is used - break; - } - if (!aFTPProxy.isEmpty()) - { - QUrl aProxy(aFTPProxy); - sal_Int32 nPort = aProxy.port(); - return css::beans::Optional(true, uno::Any(nPort)); - } - } else if (id == u"ooInetHTTPProxyName") { QString aHTTPProxy; diff --git a/shell/source/backends/kf5be/kf5backend.cxx b/shell/source/backends/kf5be/kf5backend.cxx index b811300a8e6e..9802d0796a9b 100644 --- a/shell/source/backends/kf5be/kf5backend.cxx +++ b/shell/source/backends/kf5be/kf5backend.cxx @@ -137,11 +137,10 @@ OString getExecutable() void readKDESettings(std::map>& rSettings) { const std::vector aKeys - = { "EnableATToolSupport", "ExternalMailer", "SourceViewFontHeight", - "SourceViewFontName", "WorkPathVariable", "ooInetFTPProxyName", - "ooInetFTPProxyPort", "ooInetHTTPProxyName", "ooInetHTTPProxyPort", - "ooInetHTTPSProxyName", "ooInetHTTPSProxyPort", "ooInetNoProxy", - "ooInetProxyType" }; + = { "EnableATToolSupport", "ExternalMailer", "SourceViewFontHeight", + "SourceViewFontName", "WorkPathVariable", "ooInetHTTPProxyName", + "ooInetHTTPProxyPort", "ooInetHTTPSProxyName", "ooInetHTTPSProxyPort", + "ooInetNoProxy", "ooInetProxyType" }; for (const OUString& aKey : aKeys) { @@ -227,8 +226,7 @@ css::uno::Any Service::getPropertyValue(OUString const& PropertyName) { if (PropertyName == "EnableATToolSupport" || PropertyName == "ExternalMailer" || PropertyName == "SourceViewFontHeight" || PropertyName == "SourceViewFontName" - || PropertyName == "WorkPathVariable" || PropertyName == "ooInetFTPProxyName" - || PropertyName == "ooInetFTPProxyPort" || PropertyName == "ooInetHTTPProxyName" + || PropertyName == "WorkPathVariable" || PropertyName == "ooInetHTTPProxyName" || PropertyName == "ooInetHTTPProxyPort" || PropertyName == "ooInetHTTPSProxyName" || PropertyName == "ooInetHTTPSProxyPort" || PropertyName == "ooInetNoProxy" || PropertyName == "ooInetProxyType") diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm index 7733bf95da6c..51a11a7a85fb 100644 --- a/shell/source/backends/macbe/macbackend.mm +++ b/shell/source/backends/macbe/macbackend.mm @@ -48,12 +48,11 @@ namespace typedef enum { sHTTP, sHTTPS, - sFTP } ServiceType; /* * Returns current proxy settings for selected service type (HTTP or - * FTP) as a C string (in the buffer specified by host and hostSize) + * HTTPS) as a C string (in the buffer specified by host and hostSize) * and a port number. */ @@ -86,10 +85,6 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por proxiesProxy = kSCPropNetProxiesHTTPSProxy; proxiesPort = kSCPropNetProxiesHTTPSPort; break; - default: proxiesEnable = kSCPropNetProxiesFTPEnable; - proxiesProxy = kSCPropNetProxiesFTPProxy; - proxiesPort = kSCPropNetProxiesFTPPort; - break; } // Proxy enabled? enableNum = static_cast(CFDictionaryGetValue( proxyDict, @@ -221,40 +216,6 @@ css::uno::Any MacOSXBackend::getPropertyValue( SAL_WARN("shell", "Got nil or empty list of user document directories" ); } return css::uno::Any(css::beans::Optional< css::uno::Any >()); - } else if ( PropertyName == "ooInetFTPProxyName" ) - { - char host[MAXHOSTNAMELEN]; - UInt16 port; - bool retVal; - - retVal = GetProxySetting(sFTP, host, 100, &port); - - if (retVal) - { - auto const Server = OUString::createFromAscii( host ); - if( Server.getLength() > 0 ) - { - return css::uno::Any( - css::beans::Optional< css::uno::Any >( - true, uno::Any( Server ) ) ); - } - } - return css::uno::Any(css::beans::Optional< css::uno::Any >()); - } else if ( PropertyName == "ooInetFTPProxyPort" ) - { - char host[MAXHOSTNAMELEN]; - UInt16 port; - bool retVal; - - retVal = GetProxySetting(sFTP, host, 100, &port); - - if (retVal && port > 0) - { - return css::uno::Any( - css::beans::Optional< css::uno::Any >( - true, uno::Any( sal_Int32(port) ) ) ); - } - return css::uno::Any(css::beans::Optional< css::uno::Any >()); } else if ( PropertyName == "ooInetHTTPProxyName" ) { char host[MAXHOSTNAMELEN]; diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index 109ef7fa6519..35303bd695e9 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -225,23 +225,18 @@ WinInetBackend::WinInetBackend() ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, u"http" ); ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, u"https" ); - ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, u"ftp" ); - if( aTypeIndepProxy.Server.getLength() ) { aHttpProxy.Server = aTypeIndepProxy.Server; aHttpsProxy.Server = aTypeIndepProxy.Server; - aFtpProxy.Server = aTypeIndepProxy.Server; if( aTypeIndepProxy.Port.getLength() ) { aHttpProxy.Port = aTypeIndepProxy.Port; aHttpsProxy.Port = aTypeIndepProxy.Port; - aFtpProxy.Port = aTypeIndepProxy.Port; } else { - aFtpProxy.Port = aHttpProxy.Port; aHttpsProxy.Port = aHttpProxy.Port; } } @@ -273,20 +268,6 @@ WinInetBackend::WinInetBackend() valueHttpsProxyPort_.IsPresent = true; valueHttpsProxyPort_.Value <<= aHttpsProxy.Port.toInt32(); } - - // ftp proxy name - if( aFtpProxy.Server.getLength() > 0 ) - { - valueFtpProxyName_.IsPresent = true; - valueFtpProxyName_.Value <<= aFtpProxy.Server; - } - - // ftp proxy port - if( aFtpProxy.Port.getLength() > 0 ) - { - valueFtpProxyPort_.IsPresent = true; - valueFtpProxyPort_.Value <<= aFtpProxy.Port.toInt32(); - } } } } @@ -307,13 +288,7 @@ void WinInetBackend::setPropertyValue( css::uno::Any WinInetBackend::getPropertyValue( OUString const & PropertyName) { - if ( PropertyName == "ooInetFTPProxyName" ) - { - return css::uno::Any(valueFtpProxyName_); - } else if ( PropertyName == "ooInetFTPProxyPort" ) - { - return css::uno::Any(valueFtpProxyPort_); - } else if ( PropertyName == "ooInetHTTPProxyName" ) + if (PropertyName == "ooInetHTTPProxyName") { return css::uno::Any(valueHttpProxyName_); } else if ( PropertyName == "ooInetHTTPProxyPort" ) -- cgit