aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTolriq <tolriq@tolriq.com>2016-01-11 17:06:46 +0100
committerTolriq <tolriq@tolriq.com>2016-01-12 12:05:37 +0100
commit28a6dcb7742d440c1651244a244e4b3c2cfa5df0 (patch)
treed851ebfd14b3d3261e2804b645bf5f311c5434b6
parent9d9a153feaf459a61cfc2c07aafe21b97ad6ef4c (diff)
Fix Http server default port on all platforms
Use 8080 from default settings.xml Keep previous default value if webserver is activated
-rw-r--r--system/settings/settings.xml3
-rw-r--r--xbmc/network/NetworkServices.cpp7
-rw-r--r--xbmc/settings/Settings.cpp5
3 files changed, 10 insertions, 5 deletions
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index da1b8e7c1a..b9c0500cab 100644
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -2114,6 +2114,9 @@
<step>1</step>
<maximum>65535</maximum>
</constraints>
+ <updates>
+ <update type="change" />
+ </updates>
<control type="edit" format="integer" />
</setting>
<setting id="services.webserverusername" type="string" parent="services.webserver" label="1048" help="36330">
diff --git a/xbmc/network/NetworkServices.cpp b/xbmc/network/NetworkServices.cpp
index 601251b833..3dc2c7f5bc 100644
--- a/xbmc/network/NetworkServices.cpp
+++ b/xbmc/network/NetworkServices.cpp
@@ -455,6 +455,13 @@ bool CNetworkServices::OnSettingUpdate(CSetting* &setting, const char *oldSettin
!CSettings::GetInstance().GetString(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD).empty())
return true;
}
+ if (settingId == CSettings::SETTING_SERVICES_WEBSERVERPORT)
+ {
+ // if webserverport is default but webserver is activated then treat it as altered
+ // and don't change the port to new value
+ if (CSettings::GetInstance().GetBool(CSettings::SETTING_SERVICES_WEBSERVER))
+ return true;
+ }
return false;
}
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
index ecd155d965..f50355bd10 100644
--- a/xbmc/settings/Settings.cpp
+++ b/xbmc/settings/Settings.cpp
@@ -903,11 +903,6 @@ void CSettings::InitializeDefaults()
if (g_application.IsStandAlone())
((CSettingInt*)m_settingsManager->GetSetting(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))->SetDefault(POWERSTATE_SHUTDOWN);
-
-#if defined(HAS_WEB_SERVER)
- if (CUtil::CanBindPrivileged())
- ((CSettingInt*)m_settingsManager->GetSetting(CSettings::SETTING_SERVICES_WEBSERVERPORT))->SetDefault(80);
-#endif
}
void CSettings::InitializeOptionFillers()