aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/dcc/chat.cpp2
-rw-r--r--src/modules/dcc/marshal.cpp16
-rw-r--r--src/modules/dcc/requests.cpp7
-rw-r--r--src/modules/dcc/utils.cpp4
-rw-r--r--src/modules/dcc/voice.cpp10
-rw-r--r--src/modules/http/httpfiletransfer.cpp6
-rw-r--r--src/modules/mediaplayer/mp_amarokinterface.cpp384
-rw-r--r--src/modules/mediaplayer/mp_amarokinterface.h152
-rw-r--r--src/modules/objects/class_socket.cpp14
-rw-r--r--src/modules/options/optw_proxy.cpp16
-rw-r--r--src/modules/options/optw_servers.cpp10
-rw-r--r--src/modules/reguser/dialog.cpp6
-rw-r--r--src/modules/rijndael/CMakeLists.txt2
-rw-r--r--src/modules/rijndael/ablowfish.h2
-rw-r--r--src/modules/rijndael/libkvirijndael.cpp2
-rw-r--r--src/modules/rijndael/rijndael.h2
16 files changed, 323 insertions, 312 deletions
diff --git a/src/modules/dcc/chat.cpp b/src/modules/dcc/chat.cpp
index 533a3456f..d68a69eb9 100644
--- a/src/modules/dcc/chat.cpp
+++ b/src/modules/dcc/chat.cpp
@@ -216,7 +216,7 @@ void KviDccChat::connectionInProgress()
//FIXME: #warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned number)"
struct in_addr a;
- if(kvi_stringIpToBinaryIp(ip.ptr(),&a))ip.setNum(htonl(a.s_addr));
+ if(KviNetUtils::stringIpToBinaryIp(ip.ptr(),&a))ip.setNum(htonl(a.s_addr));
QString szReq = QString("PRIVMSG %1 :%2DCC %3 chat %4 %5").arg(m_pDescriptor->szNick).arg((char)0x01).arg(m_pDescriptor->szType).arg(ip.ptr()).arg(port);
diff --git a/src/modules/dcc/marshal.cpp b/src/modules/dcc/marshal.cpp
index 628889e45..693c77434 100644
--- a/src/modules/dcc/marshal.cpp
+++ b/src/modules/dcc/marshal.cpp
@@ -121,10 +121,10 @@ int KviDccMarshal::dccListen(const QString &ip,const QString &port,bool bUseTime
void KviDccMarshal::doListen()
{
// Check the address type
- if(!kvi_isValidStringIp(m_szIp.toUtf8().data()))
+ if(!KviNetUtils::isValidStringIp(m_szIp))
{
#ifdef COMPILE_IPV6_SUPPORT
- if(!kvi_isValidStringIp_V6(m_szIp.toUtf8().data()))
+ if(!KviNetUtils::isValidStringIp_V6(m_szIp))
{
emit error(KviError_invalidIpAddress);
return;
@@ -295,10 +295,10 @@ int KviDccMarshal::dccConnect(const char * ip,const char * port,bool bUseTimeout
void KviDccMarshal::doConnect()
{
// Check the address type
- if(!kvi_isValidStringIp(m_szIp.toUtf8().data()))
+ if(!KviNetUtils::isValidStringIp(m_szIp))
{
#ifdef COMPILE_IPV6_SUPPORT
- if(!kvi_isValidStringIp_V6(m_szIp.toUtf8().data()))
+ if(!KviNetUtils::isValidStringIp_V6(m_szIp))
{
emit error(KviError_invalidIpAddress);
return;
@@ -445,12 +445,12 @@ void KviDccMarshal::snActivated(int)
if(m_bIPv6)
{
m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in6 *)addr)->sin6_port));
- if(!kvi_binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp))
+ if(!KviNetUtils::binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp))
m_szSecondaryIp = "localhost";
} else {
#endif
m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in *)addr)->sin_port));
- if(!kvi_binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp))
+ if(!KviNetUtils::binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp))
m_szSecondaryIp = "localhost";
#ifdef COMPILE_IPV6_SUPPORT
}
@@ -468,12 +468,12 @@ void KviDccMarshal::snActivated(int)
if(m_bIPv6)
{
m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in6 *)addr)->sin6_port));
- if(!kvi_binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp))
+ if(!KviNetUtils::binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp))
m_szSecondaryIp = __tr2qs_ctx("unknown","dcc");
} else {
#endif
m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in *)addr)->sin_port));
- if(!kvi_binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp))
+ if(!KviNetUtils::binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp))
m_szSecondaryIp = __tr2qs_ctx("unknown","dcc");
#ifdef COMPILE_IPV6_SUPPORT
}
diff --git a/src/modules/dcc/requests.cpp b/src/modules/dcc/requests.cpp
index dc31a8045..830c8884d 100644
--- a/src/modules/dcc/requests.cpp
+++ b/src/modules/dcc/requests.cpp
@@ -167,7 +167,7 @@ static bool dcc_module_normalize_target_data(KviDccRequest * dcc,KviStr &ipaddr,
{
addr.s_addr = htonl((unsigned long)ipaddr.toULong());
QString tmp;
- if(!kvi_binaryIpToStringIp(addr,tmp))
+ if(!KviNetUtils::binaryIpToStringIp(addr,tmp))
{
if(!dcc->ctcpMsg->msg->haltOutput())
{
@@ -179,11 +179,12 @@ static bool dcc_module_normalize_target_data(KviDccRequest * dcc,KviStr &ipaddr,
}
ipaddr = tmp;
} else {
- if(!kvi_stringIpToBinaryIp(ipaddr,&addr))
+ //FIXME: KviStr -> QString
+ if(!KviNetUtils::stringIpToBinaryIp(QString(ipaddr),&addr))
{
#ifdef COMPILE_IPV6_SUPPORT
struct in6_addr addr6;
- if(kvi_stringIpToBinaryIp_V6(ipaddr,&addr6))
+ if(KviNetUtils::stringIpToBinaryIp_V6(QString(ipaddr),&addr6))
{
dcc->bIPv6 = true;
return true; // IPV6 address.
diff --git a/src/modules/dcc/utils.cpp b/src/modules/dcc/utils.cpp
index bf57e8102..6fe529834 100644
--- a/src/modules/dcc/utils.cpp
+++ b/src/modules/dcc/utils.cpp
@@ -111,7 +111,7 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pCons
KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).trimmed();
if(!KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).isEmpty())
{
- if(kvi_isValidStringIp(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()))
+ if(KviNetUtils::isValidStringIp(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()))
{
if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0"))
{
@@ -128,7 +128,7 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pCons
return true;
}
#ifdef COMPILE_IPV6_SUPPORT
- if(kvi_isValidStringIp_V6(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()))
+ if(KviNetUtils::isValidStringIp_V6(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()))
{
szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface);
} else {
diff --git a/src/modules/dcc/voice.cpp b/src/modules/dcc/voice.cpp
index a8d6116cb..58f0815ae 100644
--- a/src/modules/dcc/voice.cpp
+++ b/src/modules/dcc/voice.cpp
@@ -752,16 +752,18 @@ void KviDccVoice::connectionInProgress()
if(m_pDescriptor->bSendRequest)
{
- KviStr ip = !m_pDescriptor->szFakeIp.isEmpty() ? m_pDescriptor->szFakeIp : m_pDescriptor->szListenIp;
+ QString ip = !m_pDescriptor->szFakeIp.isEmpty() ? m_pDescriptor->szFakeIp : m_pDescriptor->szListenIp;
KviStr port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : m_pMarshal->localPort();
//#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned nuumber)"
struct in_addr a;
- if(kvi_stringIpToBinaryIp(ip.ptr(),&a))ip.setNum(htonl(a.s_addr));
+ if(KviNetUtils::stringIpToBinaryIp(ip,&a)) {
+ ip.setNum(htonl(a.s_addr));
+ }
- m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC VOICE %s %s %s %d%c",
+ m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC VOICE %s %Q %s %d%c",
m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(),
0x01,m_pDescriptor->szCodec.ptr(),
- ip.ptr(),port.ptr(),m_pDescriptor->iSampleRate,0x01);
+ &ip,port.ptr(),m_pDescriptor->iSampleRate,0x01);
output(KVI_OUT_DCCMSG,__tr2qs_ctx("Sent DCC VOICE (%s) request to %Q, waiting for the remote client to connect...","dcc"),
m_pDescriptor->szCodec.ptr(),&(m_pDescriptor->szNick));
} else output(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC VOICE request not sent: awaiting manual connections","dcc"));
diff --git a/src/modules/http/httpfiletransfer.cpp b/src/modules/http/httpfiletransfer.cpp
index 19900a2aa..619ba185c 100644
--- a/src/modules/http/httpfiletransfer.cpp
+++ b/src/modules/http/httpfiletransfer.cpp
@@ -151,7 +151,7 @@ void KviHttpFileTransfer::displayPaint(QPainter * p,int column, QRect rect)
int iY = rect.top() + 4;
- p->drawText(rect.left() + 4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft,m_pHttpRequest->url().url().ptr());
+ p->drawText(rect.left() + 4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft,m_pHttpRequest->url().url());
iY += iLineSpacing;
if(!(m_pHttpRequest->fileName().isEmpty()))
{
@@ -441,7 +441,7 @@ void KviHttpFileTransfer::transferTerminated(bool bSuccess)
m_eGeneralStatus = Success;
displayUpdate();
if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICSUCCESS,__tr2qs_ctx("[HTTP %d]: Transfer completed","http"),id());
- g_pApp->fileDownloadTerminated(true,m_pHttpRequest->url().url().ptr(),m_pHttpRequest->fileName(),QString::null,QString::null,!m_bNotifyCompletion);
+ g_pApp->fileDownloadTerminated(true,m_pHttpRequest->url().url(),m_pHttpRequest->fileName(),QString::null,QString::null,!m_bNotifyCompletion);
} else {
m_szStatusString = __tr2qs_ctx("Transfer failed","http");
m_szStatusString += ": ";
@@ -449,7 +449,7 @@ void KviHttpFileTransfer::transferTerminated(bool bSuccess)
m_eGeneralStatus = Failure;
displayUpdate();
if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICERROR,__tr2qs_ctx("[HTTP %d]: Transfer failed: %Q","http"),id(),&(m_pHttpRequest->lastError()));
- g_pApp->fileDownloadTerminated(false,m_pHttpRequest->url().url().ptr(),m_pHttpRequest->fileName(),QString::null,m_pHttpRequest->lastError(),!m_bNotifyCompletion);
+ g_pApp->fileDownloadTerminated(false,m_pHttpRequest->url().url(),m_pHttpRequest->fileName(),QString::null,m_pHttpRequest->lastError(),!m_bNotifyCompletion);
}
if(m_bAutoClean)
diff --git a/src/modules/mediaplayer/mp_amarokinterface.cpp b/src/modules/mediaplayer/mp_amarokinterface.cpp
index 2db7a4af4..af2f0e71f 100644
--- a/src/modules/mediaplayer/mp_amarokinterface.cpp
+++ b/src/modules/mediaplayer/mp_amarokinterface.cpp
@@ -1,188 +1,196 @@
-//=============================================================================
-//
-// File : mp_amarokinterface.cpp
-// Created on Sun 27 Mar 2005 16:55:09 by Szymon Stefanek
-//
-// This file is part of the KVIrc IRC client distribution
-// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net>
-//
-// 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-//
-//=============================================================================
-
-#include "mp_amarokinterface.h"
-
-#ifdef COMPILE_KDE3_SUPPORT
-
-#include "kvi_app.h"
-#include "kvi_locale.h"
-
-#include "dcopclient.h"
-#include "kurl.h"
-
-#include <QDataStream>
-#include <QLinkedList>
-
-MP_IMPLEMENT_DESCRIPTOR(
- KviAmarokInterface,
- "amarok",
- __tr2qs_ctx(
- "An interface to the AmaroK KDE media player."
- ,
- "mediaplayer"
- )
-)
-
-
-KviAmarokInterface::KviAmarokInterface()
- : KviDCOPHelper(true, "amarok")
-{
-}
-
-KviAmarokInterface::~KviAmarokInterface()
-{
-}
-
-int KviAmarokInterface::detect(bool bStart){ return detectApp("amarok",bStart,95,99); }
-
-bool KviAmarokInterface::prev(){ return voidRetVoidDCOPCall("player","prev()"); }
-bool KviAmarokInterface::next(){ return voidRetVoidDCOPCall("player","next()"); }
-bool KviAmarokInterface::play(){ return voidRetVoidDCOPCall("player","play()"); }
-bool KviAmarokInterface::stop(){ return voidRetVoidDCOPCall("player","stop()"); }
-bool KviAmarokInterface::pause(){ return voidRetVoidDCOPCall("player","pause()"); }
-bool KviAmarokInterface::mute(){ return voidRetVoidDCOPCall("player","mute()"); }
-bool KviAmarokInterface::quit(){ return voidRetVoidDCOPCall("MainApplication-Interface","quit()"); }
-
-bool KviAmarokInterface::jumpTo(kvs_int_t &iPos)
-{
- return voidRetIntDCOPCall("player","seek(int)",iPos/1000);
-}
-bool KviAmarokInterface::setVol(kvs_int_t &iVol)
-{
- return voidRetIntDCOPCall("player","setVolume(int)",100*iVol/255);
-}
-
-#define MP_DCOP_STRING_CALL(_fncname,_iface,_fnc) \
-QString KviAmarokInterface::_fncname() \
-{ \
- QString ret; \
- if(!stringRetVoidDCOPCall(_iface,_fnc,ret))return false; \
- return ret; \
-}
-
-MP_DCOP_STRING_CALL(nowPlaying,"player","nowPlaying()")
-MP_DCOP_STRING_CALL(artist,"player","artist()")
-MP_DCOP_STRING_CALL(title,"player","title()")
-MP_DCOP_STRING_CALL(genre,"player","genre()")
-MP_DCOP_STRING_CALL(year,"player","year()")
-MP_DCOP_STRING_CALL(comment,"player","comment()")
-MP_DCOP_STRING_CALL(album,"player","album()")
-
-int KviAmarokInterface::getVol()
-{
- int ret;
- if(!intRetVoidDCOPCall("player","getVolume()",ret))return false;
- return ret * 255 / 100;
-}
-
-int KviAmarokInterface::sampleRate()
-{
- int ret;
- if(!intRetVoidDCOPCall("player","sampleRate()",ret))return false;
- return ret;
-}
-
-int KviAmarokInterface::length()
-{
- int ret;
- if(!intRetVoidDCOPCall("player","trackTotalTime()",ret))return false;
- return ret * 1000;
-}
-
-int KviAmarokInterface::position()
-{
- int ret;
- if(!intRetVoidDCOPCall("player","trackCurrentTime()",ret))return false;
- return ret * 1000;
-}
-
-bool KviAmarokInterface::getRepeat()
-{
- bool ret;
- if(!boolRetVoidDCOPCall("player","repeatTrackStatus()",ret))return false;
- return ret;
-}
-
-bool KviAmarokInterface::getShuffle()
-{
- bool ret;
- if(!boolRetVoidDCOPCall("player","randomModeStatus()",ret))return false;
- return ret;
-}
-
-bool KviAmarokInterface::setRepeat(bool &bVal)
-{
- return voidRetBoolDCOPCall("player","enableRepeatTrack(bool)",bVal);
-}
-
-bool KviAmarokInterface::setShuffle(bool &bVal)
-{
- return voidRetBoolDCOPCall("player","enableRandomMode(bool)",bVal);
-}
-
-KviMediaPlayerInterface::PlayerStatus KviAmarokInterface::status()
-{
- int ret;
- if(!intRetVoidDCOPCall("player","status()",ret))return KviMediaPlayerInterface::Unknown;
- switch(ret)
- {
- case 0:
- return KviMediaPlayerInterface::Stopped;
- break;
- case 1:
- return KviMediaPlayerInterface::Paused;
- break;
- case 2:
- return KviMediaPlayerInterface::Playing;
- break;
- default:
- return KviMediaPlayerInterface::Unknown;
- break;
- }
- return KviMediaPlayerInterface::Unknown;
-}
-
-QString KviAmarokInterface::mrl()
-{
- QString ret;
- if(!stringRetVoidDCOPCall("player","encodedURL()",ret))return false;
- KURL url(ret);
- return url.prettyURL();
-}
-
-bool KviAmarokInterface::playMrl(const QString &mrl)
-{
- QString title;
- QByteArray data, replyData;
- KviQCString replyType;
- QDataStream arg(data,IO_WriteOnly);
- arg << KURL(mrl);
- if(!g_pApp->dcopClient()->call(m_szAppId,"playlist","playMedia(KURL)",data,replyType,replyData))
- return false;
- return true;
-}
-
-
-#endif //COMPILE_KDE_SUPPORT
+//=============================================================================
+//
+// File : mp_amarokinterface.cpp
+// Created on Sun 27 Mar 2005 16:55:09 by Szymon Stefanek
+//
+// This file is part of the KVIrc IRC client distribution
+// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net>
+//
+// 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+//=============================================================================
+
+#include "mp_amarokinterface.h"
+
+#ifdef COMPILE_KDE3_SUPPORT
+
+#include "kvi_app.h"
+#include "kvi_locale.h"
+
+#include "dcopclient.h"
+#include "kurl.h"
+
+#include <QDataStream>
+#include <QLinkedList>
+
+MP_IMPLEMENT_DESCRIPTOR(
+ KviAmarokInterface,
+ "amarok",
+ __tr2qs_ctx(
+ "An interface to the AmaroK KDE media player."
+ ,
+ "mediaplayer"
+ )
+)
+
+
+KviAmarokInterface::KviAmarokInterface()
+ : KviDCOPHelper(true, "amarok")
+{
+}
+
+KviAmarokInterface::~KviAmarokInterface()
+{
+}
+
+int KviAmarokInterface::detect(bool bStart){ return detectApp("amarok",bStart,95,99); }
+
+bool KviAmarokInterface::prev(){ return voidRetVoidDCOPCall("player","prev()"); }
+bool KviAmarokInterface::next(){ return voidRetVoidDCOPCall("player","next()"); }
+bool KviAmarokInterface::play(){ return voidRetVoidDCOPCall("player","play()"); }
+bool KviAmarokInterface::stop(){ return voidRetVoidDCOPCall("player","stop()"); }
+bool KviAmarokInterface::pause(){ return voidRetVoidDCOPCall("player","pause()"); }
+bool KviAmarokInterface::mute(){ return voidRetVoidDCOPCall("player","mute()"); }
+bool KviAmarokInterface::quit(){ return voidRetVoidDCOPCall("MainApplication-Interface","quit()"); }
+
+bool KviAmarokInterface::jumpTo(kvs_int_t &iPos)
+{
+ return voidRetIntDCOPCall("player","seek(int)",iPos/1000);
+}
+bool KviAmarokInterface::setVol(kvs_int_t &iVol)
+{
+ return voidRetIntDCOPCall("player","setVolume(int)",100*iVol/255);
+}
+
+#define MP_DCOP_STRING_CALL(_fncname,_iface,_fnc) \
+QString KviAmarokInterface::_fncname() \
+{ \
+ QString ret; \
+ if(!stringRetVoidDCOPCall(_iface,_fnc,ret))return false; \
+ return ret; \
+}
+
+MP_DCOP_STRING_CALL(nowPlaying,"player","nowPlaying()")
+MP_DCOP_STRING_CALL(artist,"player","artist()")
+MP_DCOP_STRING_CALL(title,"player","title()")
+MP_DCOP_STRING_CALL(genre,"player","genre()")
+MP_DCOP_STRING_CALL(year,"player","year()")
+MP_DCOP_STRING_CALL(comment,"player","comment()")
+MP_DCOP_STRING_CALL(album,"player","album()")
+
+int KviAmarokInterface::getVol()
+{
+ int ret;
+ if(!intRetVoidDCOPCall("player","getVolume()",ret))return false;
+ return ret * 255 / 100;
+}
+
+int KviAmarokInterface::sampleRate()
+{
+ int ret;
+ if(!intRetVoidDCOPCall("player","sampleRate()",ret))return false;
+ return ret;
+}
+
+int KviAmarokInterface::length()
+{
+ int ret;
+ if(!intRetVoidDCOPCall("player","trackTotalTime()",ret))return false;
+ return ret * 1000;
+}
+
+int KviAmarokInterface::position()
+{
+ int ret;
+ if(!intRetVoidDCOPCall("player","trackCurrentTime()",ret))return false;
+ return ret * 1000;
+}
+
+bool KviAmarokInterface::getRepeat()
+{
+ bool ret;
+ if(!boolRetVoidDCOPCall("player","repeatTrackStatus()",ret))return false;
+ return ret;
+}
+
+bool KviAmarokInterface::getShuffle()
+{
+ bool ret;
+ if(!boolRetVoidDCOPCall("player","randomModeStatus()",ret))return false;
+ return ret;
+}
+
+bool KviAmarokInterface::setRepeat(bool &bVal)
+{
+ return voidRetBoolDCOPCall("player","enableRepeatTrack(bool)",bVal);
+}
+
+bool KviAmarokInterface::setShuffle(bool &bVal)
+{
+ return voidRetBoolDCOPCall("player","enableRandomMode(bool)",bVal);
+}
+
+KviMediaPlayerInterface::PlayerStatus KviAmarokInterface::status()
+{
+ int ret;
+ if(!intRetVoidDCOPCall("player","status()",ret))return KviMediaPlayerInterface::Unknown;
+ switch(ret)
+ {
+ case 0:
+ return KviMediaPlayerInterface::Stopped;
+ break;
+ case 1:
+ return KviMediaPlayerInterface::Paused;
+ break;
+ case 2:
+ return KviMediaPlayerInterface::Playing;
+ break;
+ default:
+ return KviMediaPlayerInterface::Unknown;
+ break;
+ }
+ return KviMediaPlayerInterface::Unknown;
+}
+
+QString KviAmarokInterface::mrl()
+{
+ QString ret;
+ if(!stringRetVoidDCOPCall("player","encodedURL()",ret))return false;
+ KURL url(ret);
+ return url.prettyURL();
+}
+
+int KviAmarokInterface::bitRate()
+{
+ QString ret;
+ if(!stringRetVoidDCOPCall("player","bitrate()",ret))return false;
+ int a = ret.toInt();
+ return a;
+}
+
+bool KviAmarokInterface::playMrl(const QString &mrl)
+{
+ QString title;
+ QByteArray data, replyData;
+ KviQCString replyType;
+ QDataStream arg(data,IO_WriteOnly);
+ arg << KURL(mrl);
+ if(!g_pApp->dcopClient()->call(m_szAppId,"playlist","playMedia(KURL)",data,replyType,replyData))
+ return false;
+ return true;
+}
+
+
+#endif //COMPILE_KDE_SUPPORT
diff --git a/src/modules/mediaplayer/mp_amarokinterface.h b/src/modules/mediaplayer/mp_amarokinterface.h
index fc4033c5f..9a7410e33 100644
--- a/src/modules/mediaplayer/mp_amarokinterface.h
+++ b/src/modules/mediaplayer/mp_amarokinterface.h
@@ -1,76 +1,76 @@
-#ifndef _MP_AMAROKINTERFACE_H_
-#define _MP_AMAROKINTERFACE_H_
-//=============================================================================
-//
-// File : mp_amarokinterface.h
-// Created on Sun 27 Mar 2005 16:55:09 by Szymon Stefanek
-//
-// This file is part of the KVIrc IRC client distribution
-// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net>
-//
-// 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-//
-//=============================================================================
-
-#include "kvi_settings.h"
-
-
-#ifdef COMPILE_KDE3_SUPPORT
-
- #include "kvi_dcophelper.h"
- #include "mp_interface.h"
-
- class KviAmarokInterface : public KviMediaPlayerInterface, private KviDCOPHelper
- {
- public:
- KviAmarokInterface();
- ~KviAmarokInterface();
- public:
- virtual int detect(bool bStart);
- virtual bool prev();
- virtual bool next();
- virtual bool play();
- virtual bool stop();
- virtual bool pause();
- virtual bool jumpTo(kvs_int_t &iPos);
- virtual bool setVol(kvs_int_t &iVol);
- virtual bool mute();
- virtual int getVol();
- virtual bool quit();
- virtual QString nowPlaying();
- virtual QString mrl();
- virtual QString title();
- virtual QString artist();
- virtual QString genre();
- virtual QString comment();
- virtual QString year();
- virtual QString album();
- virtual int position();
- virtual int length();
- //virtual int bitRate(); unsupported
- virtual int sampleRate();
- virtual bool playMrl(const QString &mrl);
- virtual KviMediaPlayerInterface::PlayerStatus status();
- virtual bool getRepeat();
- virtual bool getShuffle();
- virtual bool setRepeat(bool &bVal);
- virtual bool setShuffle(bool &bVal);
- };
-
- MP_DECLARE_DESCRIPTOR(KviAmarokInterface)
-
-#endif //COMPILE_KDE_SUPPORT
-
-#endif //!_MP_AMAROKINTERFACE_H_
+#ifndef _MP_AMAROKINTERFACE_H_
+#define _MP_AMAROKINTERFACE_H_
+//=============================================================================
+//
+// File : mp_amarokinterface.h
+// Created on Sun 27 Mar 2005 16:55:09 by Szymon Stefanek
+//
+// This file is part of the KVIrc IRC client distribution
+// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net>
+//
+// 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+//=============================================================================
+
+#include "kvi_settings.h"
+
+
+#ifdef COMPILE_KDE3_SUPPORT
+
+ #include "kvi_dcophelper.h"
+ #include "mp_interface.h"
+
+ class KviAmarokInterface : public KviMediaPlayerInterface, private KviDCOPHelper
+ {
+ public:
+ KviAmarokInterface();
+ ~KviAmarokInterface();
+ public:
+ virtual int detect(bool bStart);
+ virtual bool prev();
+ virtual bool next();
+ virtual bool play();
+ virtual bool stop();
+ virtual bool pause();
+ virtual bool jumpTo(kvs_int_t &iPos);
+ virtual bool setVol(kvs_int_t &iVol);
+ virtual bool mute();
+ virtual int getVol();
+ virtual bool quit();
+ virtual QString nowPlaying();
+ virtual QString mrl();
+ virtual QString title();
+ virtual QString artist();
+ virtual QString genre();
+ virtual QString comment();
+ virtual QString year();
+ virtual QString album();
+ virtual int position();
+ virtual int length();
+ virtual int bitRate();
+ virtual int sampleRate();
+ virtual bool playMrl(const QString &mrl);
+ virtual KviMediaPlayerInterface::PlayerStatus status();
+ virtual bool getRepeat();
+ virtual bool getShuffle();
+ virtual bool setRepeat(bool &bVal);
+ virtual bool setShuffle(bool &bVal);
+ };
+
+ MP_DECLARE_DESCRIPTOR(KviAmarokInterface)
+
+#endif //COMPILE_KDE_SUPPORT
+
+#endif //!_MP_AMAROKINTERFACE_H_
diff --git a/src/modules/objects/class_socket.cpp b/src/modules/objects/class_socket.cpp
index 978e9e7b2..9b6d8cd9c 100644
--- a/src/modules/objects/class_socket.cpp
+++ b/src/modules/objects/class_socket.cpp
@@ -600,9 +600,9 @@ bool KviKvsObject_socket::functionConnect(KviKvsObjectFunctionCall *c)
#ifdef COMPILE_IPV6_SUPPORT
- if(kvi_isValidStringIp(m_szRemoteIp.toUtf8().data()) || kvi_isValidStringIp_V6(m_szRemoteIp.toUtf8().data()))
+ if(KviNetUtils::isValidStringIp(m_szRemoteIp) || KviNetUtils::isValidStringIp_V6(m_szRemoteIp))
#else
- if(kvi_isValidStringIp(m_szRemoteIp.toUtf8().data()))
+ if(KviNetUtils::isValidStringIp(m_szRemoteIp))
#endif
{
debug ("ok connecting");
@@ -658,10 +658,10 @@ bool KviKvsObject_socket::functionListen(KviKvsObjectFunctionCall *c)
{
// Check the address type
- if(kvi_isValidStringIp(m_szLocalIp.toUtf8().data()))bGotIp = true;
+ if(KviNetUtils::isValidStringIp(m_szLocalIp))bGotIp = true;
else {
#ifdef COMPILE_IPV6_SUPPORT
- if(kvi_isValidStringIp_V6(m_szLocalIp.toUtf8().data()))
+ if(KviNetUtils::isValidStringIp_V6(m_szLocalIp))
{
bGotIp = true;
m_bIPv6 = true;
@@ -803,12 +803,12 @@ void KviKvsObject_socket::incomingConnection(int)
if(m_bIPv6)
{
m_uSecondaryPort = ntohs(((struct sockaddr_in6 *)addr)->sin6_port);
- if(!kvi_binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp))
+ if(!KviNetUtils::binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp))
m_szSecondaryIp = __tr("unknown");
} else {
#endif
m_uSecondaryPort = ntohs(((struct sockaddr_in *)addr)->sin_port);
- if(!kvi_binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp))
+ if(!KviNetUtils::binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp))
m_szSecondaryIp = __tr("unknown");
#ifdef COMPILE_IPV6_SUPPORT
}
@@ -870,7 +870,7 @@ void KviKvsObject_socket::doConnect()
m_pDelayTimer = 0;
- KviSockaddr sa(m_szRemoteIp.toUtf8().data(),m_uRemotePort,!kvi_isValidStringIp(m_szRemoteIp.toUtf8().data()),m_bUdp);
+ KviSockaddr sa(m_szRemoteIp.toUtf8().data(),m_uRemotePort,!KviNetUtils::isValidStringIp(m_szRemoteIp),m_bUdp);
if(!sa.socketAddress())
{
diff --git a/src/modules/options/optw_proxy.cpp b/src/modules/options/optw_proxy.cpp
index 83fccd969..2b0f376ab 100644
--- a/src/modules/options/optw_proxy.cpp
+++ b/src/modules/options/optw_proxy.cpp
@@ -82,7 +82,7 @@ KviProxyOptionsWidget::KviProxyOptionsWidget(QWidget * parent)
KviTalVBox * vbox = new KviTalVBox(this);
addWidgetToLayout(vbox,1,1,1,1);
-
+
QToolButton * tb = new QToolButton(vbox);
tb->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PROXY))));
tb->setAutoRaise(true);
@@ -95,7 +95,7 @@ KviProxyOptionsWidget::KviProxyOptionsWidget(QWidget * parent)
tb->setAutoRaise(true);
connect(tb,SIGNAL(clicked()),this,SLOT(removeCurrent()));
mergeTip(tb,__tr2qs_ctx("Remove Proxy","options"));
-
+
QFrame * lll = new QFrame(vbox);
vbox->setStretchFactor(lll,100);
@@ -248,22 +248,22 @@ void KviProxyOptionsWidget::saveLastItem()
m_pLastEditedItem->m_pProxyData->m_bIsIPv6 = false;
#endif
m_pLastEditedItem->m_pProxyData->m_szIp = "";
- KviStr tmpAddr = m_pIpEditor->address();
+ QString tmpAddr = m_pIpEditor->address();
if(!m_pIpEditor->hasEmptyFields())
{
#ifdef COMPILE_IPV6_SUPPORT
if(m_pIPv6Check->isChecked())
{
- if((!kvi_strEqualCI(tmpAddr.ptr(),"0:0:0:0:0:0:0:0")) &&
- kvi_isValidStringIp_V6(tmpAddr.ptr()))
+ if((!KviQString::equalCI(tmpAddr,"0:0:0:0:0:0:0:0")) &&
+ KviNetUtils::isValidStringIp_V6(tmpAddr))
{
m_pLastEditedItem->m_pProxyData->m_szIp = tmpAddr;
}
} else {
#endif
- if((!kvi_strEqualCI(tmpAddr.ptr(),"0.0.0.0")) &&
- kvi_isValidStringIp(tmpAddr.ptr()))
+ if((!KviQString::equalCI(tmpAddr,"0.0.0.0")) &&
+ KviNetUtils::isValidStringIp(tmpAddr))
{
m_pLastEditedItem->m_pProxyData->m_szIp = tmpAddr;
}
@@ -290,7 +290,7 @@ void KviProxyOptionsWidget::commit()
saveLastItem();
g_pProxyDataBase->clear();
KviProxyOptionsTreeWidgetItem * it;// = (KviProxyOptionsTreeWidgetItem *)m_pTreeWidget->topLevelItemCount();
-
+
//while(it)
for(int i=0;i<m_pTreeWidget->topLevelItemCount();i++)
{
diff --git a/src/modules/options/optw_servers.cpp b/src/modules/options/optw_servers.cpp
index b67853eda..88da148a9 100644
--- a/src/modules/options/optw_servers.cpp
+++ b/src/modules/options/optw_servers.cpp
@@ -931,25 +931,25 @@ void KviServerDetailsWidget::fillData(KviServer * s)
if(m_pIpEditor)
{
- KviStr tmpAddr = m_pIpEditor->address();
+ QString tmpAddr = m_pIpEditor->address();
if(!m_pIpEditor->hasEmptyFields())
{
#ifdef COMPILE_IPV6_SUPPORT
if(s->isIPv6())
{
- if((!kvi_strEqualCI(tmpAddr.ptr(),"0:0:0:0:0:0:0:0")) && kvi_isValidStringIp_V6(tmpAddr.ptr()))
+ if((!KviQString::equalCI(tmpAddr,"0:0:0:0:0:0:0:0")) && KviNetUtils::isValidStringIp(tmpAddr))
{
- s->setIp(tmpAddr.ptr());
+ s->setIp(tmpAddr);
} else {
s->setCacheIp(false);
s->setIp("");
}
} else {
#endif
- if((!kvi_strEqualCI(tmpAddr.ptr(),"0.0.0.0")) && kvi_isValidStringIp(tmpAddr.ptr()))
+ if((!KviQString::equalCI(tmpAddr,"0.0.0.0")) && KviNetUtils::isValidStringIp(tmpAddr))
{
- s->setIp(tmpAddr.ptr());
+ s->setIp(tmpAddr);
} else {
s->setCacheIp(false);
s->setIp("");
diff --git a/src/modules/reguser/dialog.cpp b/src/modules/reguser/dialog.cpp
index 3553e7941..b52774518 100644
--- a/src/modules/reguser/dialog.cpp
+++ b/src/modules/reguser/dialog.cpp
@@ -814,14 +814,14 @@ void KviRegisteredUsersDialog::importClicked()
if(img.isNull())debug("Ops.. readed a null image ?");
- KviStr fName = u->name();
- kvi_encodeFileName(fName);
+ QString fName = u->name();
+ KviFileUtils::adjustFilePath(fName);
QString fPath;
int rnm = 0 ;
do
{
- g_pApp->getLocalKvircDirectory(fPath,KviApp::Avatars,fName.ptr());
+ g_pApp->getLocalKvircDirectory(fPath,KviApp::Avatars,fName);
fPath.append(QString("%1.png").arg(rnm));
rnm++;
} while(KviFileUtils::fileExists(fPath));
diff --git a/src/modules/rijndael/CMakeLists.txt b/src/modules/rijndael/CMakeLists.txt
index 9ac817f4d..4c5fe4366 100644
--- a/src/modules/rijndael/CMakeLists.txt
+++ b/src/modules/rijndael/CMakeLists.txt
@@ -15,7 +15,7 @@ SET(kvirijndael_SRCS
)
# After this call, files will be moc'ed to moc_kvi_*.cpp
-QT4_WRAP_CPP(kvirijndael_MOC_SRCS ${kvirijndael_MOC_HDRS})
+QT4_WRAP_CPP(kvirijndael_MOC_SRCS ${kvirijndael_MOC_HDRS} "-DCOMPILE_CRYPT_SUPPORT")
SET(kvi_module_name kvirijndael)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
diff --git a/src/modules/rijndael/ablowfish.h b/src/modules/rijndael/ablowfish.h
index ef8810035..5dc3ed133 100644
--- a/src/modules/rijndael/ablowfish.h
+++ b/src/modules/rijndael/ablowfish.h
@@ -75,7 +75,7 @@
#include "kvi_settings.h"
-#ifdef COMPILE_CRYPT_SUPPORT
+#if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN)
//Block Structure
diff --git a/src/modules/rijndael/libkvirijndael.cpp b/src/modules/rijndael/libkvirijndael.cpp
index 9718653ad..32383b3dc 100644
--- a/src/modules/rijndael/libkvirijndael.cpp
+++ b/src/modules/rijndael/libkvirijndael.cpp
@@ -58,7 +58,7 @@
-#ifdef COMPILE_CRYPT_SUPPORT
+#if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN)
#include "kvi_memmove.h"
#include "kvi_malloc.h"
#include "kvi_pointerlist.h"
diff --git a/src/modules/rijndael/rijndael.h b/src/modules/rijndael/rijndael.h
index 4a5b9e506..63394d31f 100644
--- a/src/modules/rijndael/rijndael.h
+++ b/src/modules/rijndael/rijndael.h
@@ -81,7 +81,7 @@
#include "kvi_settings.h"
-#ifdef COMPILE_CRYPT_SUPPORT
+#if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN)
#define _MAX_KEY_COLUMNS (256/32)
#define _MAX_ROUNDS 14