diff options
| author | 2010-12-29 01:18:21 +0000 | |
|---|---|---|
| committer | 2010-12-29 01:18:21 +0000 | |
| commit | e3bc98dd160b190ec41cf97d4104b0d695613767 (patch) | |
| tree | ce9c7a55c4035f8afe9523ff2bf495b752aeb002 | |
| parent | splitted some classes in their own files (diff) | |
| download | KVIrc-e3bc98dd160b190ec41cf97d4104b0d695613767.tar.gz KVIrc-e3bc98dd160b190ec41cf97d4104b0d695613767.tar.bz2 KVIrc-e3bc98dd160b190ec41cf97d4104b0d695613767.zip | |
yet more splitting
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5251 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rw-r--r-- | doc/TODO-hu-notation | 5 | ||||
| -rw-r--r-- | src/kvilib/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/kvilib/ext/KviOggIrcText.h | 3 | ||||
| -rw-r--r-- | src/kvilib/ext/KviProxy.cpp | 84 | ||||
| -rw-r--r-- | src/kvilib/ext/KviProxy.h | 80 | ||||
| -rw-r--r-- | src/kvilib/ext/KviProxyDataBase.cpp | 58 | ||||
| -rw-r--r-- | src/kvilib/ext/KviProxyDataBase.h | 47 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviIrcConnectionTarget.cpp | 1 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviIrcConnectionTargetResolver.cpp | 1 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviIrcLink.cpp | 1 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviIrcSocket.cpp | 1 | ||||
| -rw-r--r-- | src/modules/options/optw_proxy.cpp | 1 | ||||
| -rw-r--r-- | src/modules/options/optw_servers.cpp | 1 | ||||
| -rw-r--r-- | src/modules/proxydb/libkviproxydb.cpp | 1 |
14 files changed, 180 insertions, 105 deletions
diff --git a/doc/TODO-hu-notation b/doc/TODO-hu-notation index fd2375064..de9d7645b 100644 --- a/doc/TODO-hu-notation +++ b/doc/TODO-hu-notation @@ -64,7 +64,8 @@ KviDebugContext.h KviOggIrcText.h KviOsInfo.cpp KviOsInfo.h -KviMediaType.cpp +KviMediaManager.cpp +KviMediaManager.h KviMediaType.h KviMessageTypeSettings.cpp KviMessageTypeSettings.h @@ -76,6 +77,8 @@ KviParameterList.cpp KviParameterList.h KviPixmap.cpp KviPixmap.h +KviPixmapUtils.cpp +KviPixmapUtils.h KviProxyDataBase.cpp KviProxyDataBase.h KviRegisteredChannel.cpp diff --git a/src/kvilib/CMakeLists.txt b/src/kvilib/CMakeLists.txt index 8d4b42e4f..908dd7a8c 100644 --- a/src/kvilib/CMakeLists.txt +++ b/src/kvilib/CMakeLists.txt @@ -76,6 +76,7 @@ SET(kvilib_SRCS ext/KviAnimatedPixmap.cpp ext/KviAnimatedPixmapCache.cpp ext/KviNickColors.cpp + ext/KviProxy.cpp ext/KviProxyDataBase.cpp ext/KviRegisteredChannel.cpp ext/KviRegisteredUserDataBase.cpp diff --git a/src/kvilib/ext/KviOggIrcText.h b/src/kvilib/ext/KviOggIrcText.h index b7de19668..b618de500 100644 --- a/src/kvilib/ext/KviOggIrcText.h +++ b/src/kvilib/ext/KviOggIrcText.h @@ -31,10 +31,9 @@ */ /** -* \class KviOggIrcText +* \namespace KviOggIrcText * \brief A namespace implementing our tricky codec to send and receive text multiplexed inside an ogg stream */ - namespace KviOggIrcText { /** diff --git a/src/kvilib/ext/KviProxy.cpp b/src/kvilib/ext/KviProxy.cpp new file mode 100644 index 000000000..92f71325d --- /dev/null +++ b/src/kvilib/ext/KviProxy.cpp @@ -0,0 +1,84 @@ +//============================================================================= +// +// File : KviProxy.h +// Creation date : Wed Dec 29 2010 01:58:01 by Elvio Basello +// +// This file is part of the KVirc irc client distribution +// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com) +// +// This program is FREE software. You can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your opinion) any later version. +// +// This program is distributed in the HOPE that it will be USEFUL, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, write to the Free Software Foundation, +// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +//============================================================================= + +#include "KviProxy.h" +#include "KviQString.h" +#include "KviCString.h" + +#include <QStringList> + +KviProxy::KviProxy() +{ + m_szHostname = "proxy.example.net"; + m_uPort = 1080; + m_protocol = Socks4; + m_bIsIPv6 = false; +} + +KviProxy::KviProxy(const KviProxy &prx) +{ + m_szHostname = prx.m_szHostname; + m_szIp = prx.m_szIp; + m_szUser = prx.m_szUser; + m_szPass = prx.m_szPass; + m_uPort = prx.m_uPort; + m_protocol = prx.m_protocol; + m_bIsIPv6 = prx.m_bIsIPv6; +} + +KviProxy::~KviProxy() +{ +} + +static const QString proxy_protocols_table[3]= { "SOCKSv4", "SOCKSv5", "HTTP" }; + +const QString KviProxy::protocolName() const +{ + switch(m_protocol) + { + case Socks5: return proxy_protocols_table[1]; break; + case Http: return proxy_protocols_table[2]; break; + default: return proxy_protocols_table[0]; break; + } + + return proxy_protocols_table[0]; +} + +void KviProxy::setNamedProtocol(const char * proto) +{ + if(kvi_strEqualCI(proto,"SOCKSv5"))m_protocol = KviProxy::Socks5; + else if(kvi_strEqualCI(proto,"HTTP"))m_protocol = KviProxy::Http; + else m_protocol = KviProxy::Socks4; +} + +void KviProxy::getSupportedProtocolNames(QStringList & buf) +{ + for(int i=0;i<3;i++)buf.append(QString(proxy_protocols_table[i])); +} + +void KviProxy::normalizeUserAndPass() +{ + m_szUser.trimmed(); + m_szPass.trimmed(); +} diff --git a/src/kvilib/ext/KviProxy.h b/src/kvilib/ext/KviProxy.h new file mode 100644 index 000000000..6d6915c93 --- /dev/null +++ b/src/kvilib/ext/KviProxy.h @@ -0,0 +1,80 @@ +#ifndef _KVIPROXY_H_ +#define _KVIPROXY_H_ + +//============================================================================= +// +// File : KviProxy.h +// Creation date : Wed Dec 29 2010 01:58:01 by Elvio Basello +// +// This file is part of the KVirc irc client distribution +// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com) +// +// This program is FREE software. You can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your opinion) any later version. +// +// This program is distributed in the HOPE that it will be USEFUL, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, write to the Free Software Foundation, +// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +//============================================================================= + +// this file was originally part of KviProxyDataBase.h + + +#include "kvi_settings.h" +#include "kvi_inttypes.h" + +#include <QString> + +class QStringList; + + +class KVILIB_API KviProxy +{ +public: + enum Protocol { Socks4, Socks5, Http }; + KviProxy(); + KviProxy(const KviProxy &prx); + ~KviProxy(); +public: + QString m_szHostname; + QString m_szIp; + QString m_szPass; + QString m_szUser; + kvi_u32_t m_uPort; + Protocol m_protocol; + bool m_bIsIPv6; +public: + bool isIPv6() const { return m_bIsIPv6; }; + Protocol protocol() const { return m_protocol; }; + const QString protocolName() const; + void setNamedProtocol(const char * proto); + kvi_u32_t port() const { return m_uPort; }; + const QString & user() const { return m_szUser; }; + const QString & pass() const { return m_szPass; }; + const QString & ip() const { return m_szIp; }; + const QString & hostname() const { return m_szHostname; }; + void normalizeUserAndPass(); + bool hasPass() const { return !m_szPass.isEmpty(); }; + bool hasUser() const { return !m_szUser.isEmpty(); }; + unsigned int passLen() const { return (unsigned int)m_szPass.length(); }; + unsigned int userLen() const { return (unsigned int)m_szUser.length(); }; + static void getSupportedProtocolNames(QStringList & buf); + + void setProtocol(Protocol p){ m_protocol = p; }; + void setIPv6(bool b){ if(b) m_bIsIPv6 = true; else m_bIsIPv6 = false; }; + void setPort(kvi_u32_t &p){ m_uPort = p; }; + void setUser(const QString &u){ m_szUser = u; }; + void setPass(const QString &p){ m_szPass = p; }; + void setIp(const QString &i){ m_szIp = i; }; + void setHostname(const QString &h){ m_szHostname = h; }; +}; + +#endif // _KVIPROXY_H_ diff --git a/src/kvilib/ext/KviProxyDataBase.cpp b/src/kvilib/ext/KviProxyDataBase.cpp index a4cfa7fc8..1b075e2e4 100644 --- a/src/kvilib/ext/KviProxyDataBase.cpp +++ b/src/kvilib/ext/KviProxyDataBase.cpp @@ -25,63 +25,7 @@ #include "KviProxyDataBase.h" #include "KviConfigurationFile.h" -#include "KviQString.h" - - -KviProxy::KviProxy() -{ - m_szHostname = "proxy.example.net"; - m_uPort = 1080; - m_protocol = Socks4; - m_bIsIPv6 = false; -} - -KviProxy::KviProxy(const KviProxy &prx) -{ - m_szHostname = prx.m_szHostname; - m_szIp = prx.m_szIp; - m_szUser = prx.m_szUser; - m_szPass = prx.m_szPass; - m_uPort = prx.m_uPort; - m_protocol = prx.m_protocol; - m_bIsIPv6 = prx.m_bIsIPv6; -} - -KviProxy::~KviProxy() -{ -} - -static const QString proxy_protocols_table[3]= { "SOCKSv4", "SOCKSv5", "HTTP" }; - -const QString KviProxy::protocolName() const -{ - switch(m_protocol) - { - case Socks5: return proxy_protocols_table[1]; break; - case Http: return proxy_protocols_table[2]; break; - default: return proxy_protocols_table[0]; break; - } - - return proxy_protocols_table[0]; -} - -void KviProxy::setNamedProtocol(const char * proto) -{ - if(kvi_strEqualCI(proto,"SOCKSv5"))m_protocol = KviProxy::Socks5; - else if(kvi_strEqualCI(proto,"HTTP"))m_protocol = KviProxy::Http; - else m_protocol = KviProxy::Socks4; -} - -void KviProxy::getSupportedProtocolNames(QStringList & buf) -{ - for(int i=0;i<3;i++)buf.append(QString(proxy_protocols_table[i])); -} - -void KviProxy::normalizeUserAndPass() -{ - m_szUser.trimmed(); - m_szPass.trimmed(); -} +#include "KviProxy.h" KviProxyDataBase::KviProxyDataBase() { diff --git a/src/kvilib/ext/KviProxyDataBase.h b/src/kvilib/ext/KviProxyDataBase.h index 02a8e4b59..dcc918860 100644 --- a/src/kvilib/ext/KviProxyDataBase.h +++ b/src/kvilib/ext/KviProxyDataBase.h @@ -1,5 +1,6 @@ #ifndef _KVI_PROXYDB_H_ #define _KVI_PROXYDB_H_ + //============================================================================= // // File : KviProxyDataBase.h @@ -25,53 +26,9 @@ //============================================================================= #include "kvi_settings.h" -#include "KviCString.h" -#include "kvi_inttypes.h" #include "KviPointerList.h" -#include <QStringList> - -class KVILIB_API KviProxy -{ -public: - enum Protocol { Socks4, Socks5, Http }; - KviProxy(); - KviProxy(const KviProxy &prx); - ~KviProxy(); -public: - QString m_szHostname; - QString m_szIp; - QString m_szPass; - QString m_szUser; - kvi_u32_t m_uPort; - Protocol m_protocol; - bool m_bIsIPv6; -public: - bool isIPv6() const { return m_bIsIPv6; }; - Protocol protocol() const { return m_protocol; }; - const QString protocolName() const; - void setNamedProtocol(const char * proto); - kvi_u32_t port() const { return m_uPort; }; - const QString & user() const { return m_szUser; }; - const QString & pass() const { return m_szPass; }; - const QString & ip() const { return m_szIp; }; - const QString & hostname() const { return m_szHostname; }; - void normalizeUserAndPass(); - bool hasPass() const { return !m_szPass.isEmpty(); }; - bool hasUser() const { return !m_szUser.isEmpty(); }; - unsigned int passLen() const { return (unsigned int)m_szPass.length(); }; - unsigned int userLen() const { return (unsigned int)m_szUser.length(); }; - static void getSupportedProtocolNames(QStringList & buf); - - void setProtocol(Protocol p){ m_protocol = p; }; - void setIPv6(bool b){ if(b) m_bIsIPv6 = true; else m_bIsIPv6 = false; }; - void setPort(kvi_u32_t &p){ m_uPort = p; }; - void setUser(const QString &u){ m_szUser = u; }; - void setPass(const QString &p){ m_szPass = p; }; - void setIp(const QString &i){ m_szIp = i; }; - void setHostname(const QString &h){ m_szHostname = h; }; -}; - +class KviProxy; class KVILIB_API KviProxyDataBase { diff --git a/src/kvirc/kernel/KviIrcConnectionTarget.cpp b/src/kvirc/kernel/KviIrcConnectionTarget.cpp index ccdc7783e..3f0a314de 100644 --- a/src/kvirc/kernel/KviIrcConnectionTarget.cpp +++ b/src/kvirc/kernel/KviIrcConnectionTarget.cpp @@ -27,6 +27,7 @@ #include "KviIrcConnectionTarget.h" #include "KviIrcServer.h" #include "KviIrcNetwork.h" +#include "KviProxy.h" #include "KviProxyDataBase.h" KviIrcConnectionTarget::KviIrcConnectionTarget( diff --git a/src/kvirc/kernel/KviIrcConnectionTargetResolver.cpp b/src/kvirc/kernel/KviIrcConnectionTargetResolver.cpp index 27b36e365..6f08342c7 100644 --- a/src/kvirc/kernel/KviIrcConnectionTargetResolver.cpp +++ b/src/kvirc/kernel/KviIrcConnectionTargetResolver.cpp @@ -28,6 +28,7 @@ #include "KviDnsResolver.h" #include "KviLocale.h" #include "KviIrcServerDataBase.h" +#include "KviProxy.h" #include "KviProxyDataBase.h" #include "KviError.h" #include "kvi_out.h" diff --git a/src/kvirc/kernel/KviIrcLink.cpp b/src/kvirc/kernel/KviIrcLink.cpp index 163d46f25..3e17fb0f5 100644 --- a/src/kvirc/kernel/KviIrcLink.cpp +++ b/src/kvirc/kernel/KviIrcLink.cpp @@ -27,6 +27,7 @@ #include "KviDnsResolver.h" #include "KviLocale.h" #include "KviIrcServerDataBase.h" +#include "KviProxy.h" #include "KviProxyDataBase.h" #include "KviError.h" #include "kvi_out.h" diff --git a/src/kvirc/kernel/KviIrcSocket.cpp b/src/kvirc/kernel/KviIrcSocket.cpp index 9f8689b1f..0a78d8004 100644 --- a/src/kvirc/kernel/KviIrcSocket.cpp +++ b/src/kvirc/kernel/KviIrcSocket.cpp @@ -25,6 +25,7 @@ #include "KviIrcSocket.h" #include "KviIrcServer.h" +#include "KviProxy.h" #include "KviProxyDataBase.h" #include "KviNetUtils.h" #include "kvi_settings.h" diff --git a/src/modules/options/optw_proxy.cpp b/src/modules/options/optw_proxy.cpp index f5b49d89d..27853dc38 100644 --- a/src/modules/options/optw_proxy.cpp +++ b/src/modules/options/optw_proxy.cpp @@ -26,6 +26,7 @@ #include "KviLocale.h" #include "KviIconManager.h" +#include "KviProxy.h" #include "KviProxyDataBase.h" #include "KviIpEditor.h" #include "KviNetUtils.h" diff --git a/src/modules/options/optw_servers.cpp b/src/modules/options/optw_servers.cpp index 3132fde32..ea7242c72 100644 --- a/src/modules/options/optw_servers.cpp +++ b/src/modules/options/optw_servers.cpp @@ -49,6 +49,7 @@ #include "KviMessageBox.h" #include "KviMexServerImport.h" #include "KviNickServRuleSet.h" +#include "KviProxy.h" #include "KviProxyDataBase.h" #include "KviKvsScript.h" #include "KviPointerHashTable.h" diff --git a/src/modules/proxydb/libkviproxydb.cpp b/src/modules/proxydb/libkviproxydb.cpp index 344bf37d9..4f2d550ec 100644 --- a/src/modules/proxydb/libkviproxydb.cpp +++ b/src/modules/proxydb/libkviproxydb.cpp @@ -25,6 +25,7 @@ #include "KviModule.h" #include "KviApplication.h" #include "KviLocale.h" +#include "KviProxy.h" #include "KviProxyDataBase.h" #include <QString> |
