diff options
| author | 2016-11-11 23:19:46 -0500 | |
|---|---|---|
| committer | 2016-11-11 23:19:46 -0500 | |
| commit | 60501807b361ced9f594ba9c58331857e2011834 (patch) | |
| tree | 412fb3e1619cb8e8937677d8f967c8017d2a4702 /src/modules/options/OptionsWidget_proxy.cpp | |
| parent | Input History: Added skipping of input lines if consecutive lines are the same (diff) | |
| download | KVIrc-60501807b361ced9f594ba9c58331857e2011834.tar.gz KVIrc-60501807b361ced9f594ba9c58331857e2011834.tar.bz2 KVIrc-60501807b361ced9f594ba9c58331857e2011834.zip | |
KviIpEditor: Change to a QLineEdit and update code.
* Changes from a multi-QLineEdit box for each part of the IP address
to a single QLineEdit which allows pasting of IP addresses rather
than having to hand type them in.
* Uses Qt5's QHostAddress to proccess the input and validate the IPs
* Fixes the OptionsWidget_servers to enable/disable the KviIpEditor
depending on if the Cache IP checkbox is checked or not.
Diffstat (limited to 'src/modules/options/OptionsWidget_proxy.cpp')
| -rw-r--r-- | src/modules/options/OptionsWidget_proxy.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/modules/options/OptionsWidget_proxy.cpp b/src/modules/options/OptionsWidget_proxy.cpp index ad3d29c11..f05012f33 100644 --- a/src/modules/options/OptionsWidget_proxy.cpp +++ b/src/modules/options/OptionsWidget_proxy.cpp @@ -268,25 +268,20 @@ void OptionsWidget_proxy::saveLastItem() #endif m_pLastEditedItem->m_pProxyData->m_szIp = ""; - QString tmpAddr = m_pIpEditor->address(); - - if(!m_pIpEditor->hasEmptyFields()) + if(m_pIpEditor->isValid()) { + QString tmpAddr = m_pIpEditor->address(); #ifdef COMPILE_IPV6_SUPPORT if(m_pIPv6Check->isChecked()) { - if((!KviQString::equalCI(tmpAddr, "0:0:0:0:0:0:0:0")) && KviNetUtils::isValidStringIPv6(tmpAddr)) - { + if(tmpAddr != "::" && KviNetUtils::isValidStringIPv6(tmpAddr)) m_pLastEditedItem->m_pProxyData->m_szIp = tmpAddr; - } } else { #endif - if((!KviQString::equalCI(tmpAddr, "0.0.0.0")) && KviNetUtils::isValidStringIp(tmpAddr)) - { + if(tmpAddr != "0.0.0.0" && KviNetUtils::isValidStringIp(tmpAddr)) m_pLastEditedItem->m_pProxyData->m_szIp = tmpAddr; - } #ifdef COMPILE_IPV6_SUPPORT } #endif |
