- Timestamp:
- Sep 24, 2018 12:43:12 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
r74431 r74440 387 387 /* If the specific proxy settings are enabled, we'll use them 388 388 * unless user disabled that functionality manually. */ 389 CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties();390 KProxyMode enmProxyMode = properties.GetProxyMode();391 AssertReturn( properties.isOk(), VERR_INTERNAL_ERROR_3);389 const CSystemProperties comProperties = vboxGlobal().virtualBox().GetSystemProperties(); 390 const KProxyMode enmProxyMode = comProperties.GetProxyMode(); 391 AssertReturn(comProperties.isOk(), VERR_INTERNAL_ERROR_3); 392 392 switch (enmProxyMode) 393 393 { 394 394 case KProxyMode_Manual: 395 { 396 QString strProxyURL = properties.GetProxyURL(); 397 return RTHttpSetProxyByUrl(m_hHttp, strProxyURL.toUtf8().constData()); 398 } 395 return RTHttpSetProxyByUrl(m_hHttp, comProperties.GetProxyURL().toUtf8().constData()); 399 396 case KProxyMode_NoProxy: 400 397 return VINF_SUCCESS; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp
r74431 r74440 29 29 # include "UIExtraDataManager.h" 30 30 # include "UIMessageCenter.h" 31 # include "VBoxGlobal.h" 31 32 # include "VBoxUtils.h" 32 # include "VBoxGlobal.h" 33 34 /* COM includes: */ 33 35 # include "CSystemProperties.h" 34 36 … … 62 64 63 65 /** Holds the proxy mode. */ 64 KProxyMode m_enmProxyMode;66 KProxyMode m_enmProxyMode; 65 67 /** Holds the proxy host. */ 66 QString m_strProxyHost;68 QString m_strProxyHost; 67 69 /** Holds the proxy port. */ 68 QString m_strProxyPort;70 QString m_strProxyPort; 69 71 }; 70 72 … … 95 97 96 98 /* Gather old proxy data: */ 97 CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties(); 98 if (properties.isNotNull()) 99 { 100 oldProxyData.m_enmProxyMode = properties.GetProxyMode(); 101 oldProxyData.m_strProxyHost = properties.GetProxyURL(); 102 oldProxyData.m_strProxyPort = ""; 103 if (!oldProxyData.m_strProxyHost.isEmpty()) 104 { 105 QUrl url(oldProxyData.m_strProxyHost); 106 if (url.port() != -1) 107 { 108 oldProxyData.m_strProxyPort = QString::number(url.port()); 109 url.setPort(-1); 110 oldProxyData.m_strProxyHost = url.url(); 111 } 99 oldProxyData.m_enmProxyMode = m_properties.GetProxyMode(); 100 oldProxyData.m_strProxyHost = m_properties.GetProxyURL(); 101 oldProxyData.m_strProxyPort = ""; 102 if (!oldProxyData.m_strProxyHost.isEmpty()) 103 { 104 QUrl url(oldProxyData.m_strProxyHost); 105 if (url.port() != -1) 106 { 107 oldProxyData.m_strProxyPort = QString::number(url.port()); 108 url.setPort(-1); 109 oldProxyData.m_strProxyHost = url.url(); 112 110 } 113 111 } … … 131 129 case KProxyMode_NoProxy: m_pRadioProxyDisabled->setChecked(true); break; 132 130 case KProxyMode_Manual: m_pRadioProxyEnabled->setChecked(true); break; 133 case KProxyMode_Max: break; /* (compiler warnings) */131 case KProxyMode_Max: break; /* (compiler warnings) */ 134 132 } 135 133 m_pHostEditor->setText(oldProxyData.m_strProxyHost); … … 188 186 189 187 /* Check for port value: */ 190 if (m_pPortEditor->text().trimmed().isEmpty()) 188 if ( m_pPortEditor->text().trimmed().isEmpty() 189 && QUrl(m_pHostEditor->text()).port() == -1) 191 190 { 192 191 message.second << tr("No proxy port is currently specified."); … … 281 280 282 281 /* Save new proxy data from the cache: */ 283 CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties(); 284 if (properties.isNull()) 285 fSuccess = false; 282 m_properties.SetProxyMode(newProxyData.m_enmProxyMode); 283 fSuccess &= m_properties.isOk(); 284 if (newProxyData.m_strProxyPort.isEmpty()) 285 m_properties.SetProxyURL(newProxyData.m_strProxyHost); 286 286 else 287 287 { 288 properties.SetProxyMode(newProxyData.m_enmProxyMode); 289 fSuccess &= properties.isOk(); 290 291 if (newProxyData.m_strProxyPort.isEmpty()) 292 properties.SetProxyURL(newProxyData.m_strProxyHost); 293 else 294 { 295 QUrl url(newProxyData.m_strProxyHost); 296 if (url.port() == -1) 297 url.setPort(newProxyData.m_strProxyPort.toUInt()); 298 properties.SetProxyURL(url.url()); 299 } 300 fSuccess &= properties.isOk(); 301 302 /* Drop the old extra data setting if still around: */ 303 if (fSuccess && !gEDataManager->proxySettings().isEmpty()) 304 gEDataManager->setProxySettings(QString()); 305 } 288 QUrl url(newProxyData.m_strProxyHost); 289 if (url.port() == -1) 290 url.setPort(newProxyData.m_strProxyPort.toUInt()); 291 m_properties.SetProxyURL(url.url()); 292 } 293 fSuccess &= m_properties.isOk(); 294 295 /* Drop the old extra data setting if still around: */ 296 if (fSuccess && !gEDataManager->proxySettings().isEmpty()) 297 gEDataManager->setProxySettings(QString()); 306 298 } 307 299 /* Return result: */
Note:
See TracChangeset
for help on using the changeset viewer.