diff --git a/Common/IRCDDBGatewayConfig.cpp b/Common/IRCDDBGatewayConfig.cpp index a84b4ce..e796555 100644 --- a/Common/IRCDDBGatewayConfig.cpp +++ b/Common/IRCDDBGatewayConfig.cpp @@ -760,7 +760,7 @@ m_y(DEFAULT_WINDOW_Y) m_config->Read(m_name + KEY_XLX_ENABLED, &m_xlxEnabled, DEFAULT_XLX_ENABLED); m_config->Read(m_name + KEY_XLX_HOSTS_FILE_URL, &m_xlxHostsFileUrl, DEFAULT_XLX_HOSTS_FILE_URL); - if(m_xlxEnabled && m_xlxHostsFileUrl.IsEmpty())//To avoid support nightmare, fill the url with the default one when xlx is enabled and the url is left empty + if(m_xlxEnabled && m_xlxHostsFileUrl.Trim().IsEmpty())//To avoid support nightmare, fill the url with the default one when xlx is enabled and the url is left empty m_xlxHostsFileUrl = DEFAULT_XLX_HOSTS_FILE_URL; m_config->Read(m_name + KEY_STARNET_BAND1, &m_starNet1Band, DEFAULT_STARNET_BAND); @@ -1434,7 +1434,7 @@ m_y(DEFAULT_WINDOW_Y) } else if (key.IsSameAs(KEY_XLX_ENABLED)) { val.ToLong(&temp1); m_xlxEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL) && !val.IsEmpty()) { //always load default url if the value in the config file is empty + } else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL) && !val.Trim().IsEmpty()) { //always load default url if the value in the config file is empty m_xlxHostsFileUrl = val; } else if (key.IsSameAs(KEY_STARNET_BAND1)) { m_starNet1Band = val; diff --git a/Common/XLXHostsFileDownloader.cpp b/Common/XLXHostsFileDownloader.cpp index 438e770..869ddd0 100644 --- a/Common/XLXHostsFileDownloader.cpp +++ b/Common/XLXHostsFileDownloader.cpp @@ -66,8 +66,8 @@ wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL) return wxEmptyString; } - wxInputStream* in = NULL; - if((in = http.GetInputStream(path)) && in->IsOk()) { + wxInputStream* in = http.GetInputStream(path); + if(in != NULL && in->IsOk()) { wxFile file; wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_"), &file); wxLogMessage(_T("Created temporary file %s"), xlxHostsFileName); diff --git a/GUICommon/XLXSet.cpp b/GUICommon/XLXSet.cpp index d1497e1..7d04f98 100644 --- a/GUICommon/XLXSet.cpp +++ b/GUICommon/XLXSet.cpp @@ -20,6 +20,8 @@ #include "XLXSet.h" #include "Defs.h" +#include + // TODO F4FXL try to figure out why below symbols are not found under ubuntu //#include @@ -79,13 +81,19 @@ bool CXLXSet::Validate() if (n == wxNOT_FOUND) return false; +#if defined(__WINDOWS__) // TODO F4FXL try to figure out why below symbols are not found under ubuntu - /*wxString value = m_xlxHostsFileUrl->GetValue(); + wxString value = m_xlxHostsFileUrl->GetValue(); wxURL url(value); - if (url.GetError() != wxURL_NOERR) - return false;*/ + if (url.GetError() == wxURL_NOERR) + return true; + wxMessageDialog dialog(this, _("The XLX host file URL is not valid"), m_title + _(" Error"), wxICON_ERROR); + dialog.ShowModal(); + return false; +#else return true; +#endif } @@ -102,13 +110,16 @@ wxString CXLXSet::getXLXHostsFileUrl() const { wxString value = m_xlxHostsFileUrl->GetValue(); - +#if defined(__WINDOWS__) // TODO F4FXL try to figure out why below symbols are not found under ubuntu - //wxURL url(value); - //if (url.GetError() == wxURL_NOERR) - // return value; - + wxURL url(value); + if (url.GetError() == wxURL_NOERR) + return value; + return wxEmptyString; +#else + return value; +#endif } void CXLXSet::onEnabled(wxCommandEvent &event) diff --git a/ircDDBGateway/IRCDDBGatewayApp.cpp b/ircDDBGateway/IRCDDBGatewayApp.cpp index 3b03695..1101563 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.cpp +++ b/ircDDBGateway/IRCDDBGatewayApp.cpp @@ -171,8 +171,10 @@ int CIRCDDBGatewayApp::OnExit() wxLogInfo(APPLICATION_NAME + wxT(" is exiting")); - //m_thread->kill(); - wxGetApp().GetTopWindow()->Close(); + m_thread->kill(); + wxWindow * topWin = wxGetApp().GetTopWindow(); + if (topWin != NULL) + topWin->Close(); delete m_config;