aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/context/libkvicontext.cpp4
-rw-r--r--src/modules/dcc/requests.cpp50
-rw-r--r--src/modules/dcc/utils.cpp4
-rw-r--r--src/modules/links/libkvilinks.cpp6
-rw-r--r--src/modules/links/linkswindow.cpp14
-rw-r--r--src/modules/list/libkvilist.cpp2
-rw-r--r--src/modules/list/listwindow.cpp12
-rw-r--r--src/modules/reguser/dialog.cpp50
-rw-r--r--src/modules/socketspy/socketspywindow.cpp8
-rw-r--r--src/modules/trayicon/libkvitrayicon.cpp52
-rw-r--r--src/modules/url/libkviurl.cpp32
-rw-r--r--src/modules/window/libkviwindow.cpp10
12 files changed, 122 insertions, 122 deletions
diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp
index 09b41e611..2aa71eed6 100644
--- a/src/modules/context/libkvicontext.cpp
+++ b/src/modules/context/libkvicontext.cpp
@@ -302,7 +302,7 @@ static bool context_kvs_fnc_state(KviKvsModuleFunctionCall * c)
if(pConsole)
{
- switch(pConsole->ircContext()->state())
+ switch(pConsole->context()->state())
{
case KviIrcContext::Idle:
c->returnValue()->setString(QString("idle"));
@@ -359,7 +359,7 @@ static bool context_kvs_fnc_list(KviKvsModuleFunctionCall * c)
{
if(pWnd->type() == KVI_WINDOW_TYPE_CONSOLE)
{
- pArray->set(idx,new KviKvsVariant((kvs_int_t)((KviConsole *)pWnd)->ircContextId()));
+ pArray->set(idx,new KviKvsVariant((kvs_int_t)((KviConsole *)pWnd)->context()->id()));
idx++;
}
}
diff --git a/src/modules/dcc/requests.cpp b/src/modules/dcc/requests.cpp
index 5828a7dd9..dc31a8045 100644
--- a/src/modules/dcc/requests.cpp
+++ b/src/modules/dcc/requests.cpp
@@ -227,7 +227,7 @@ static void dccModuleParseDccChat(KviDccRequest *dcc)
// with the same random number appended, and then should listen for a connection.
//
// when a zero port request is initiated by another party we get
- //
+ //
// DCC CHAT chat <fakeipaddress> 0 <tag>
//
// and we reply with
@@ -279,7 +279,7 @@ static void dccModuleParseDccChat(KviDccRequest *dcc)
KviDccDescriptor * d = new KviDccDescriptor(dcc->pConsole);
d->szNick = dcc->ctcpMsg->pSource->nick();
- d->szUser = dcc->ctcpMsg->pSource->username();
+ d->szUser = dcc->ctcpMsg->pSource->user();
d->szHost = dcc->ctcpMsg->pSource->host();
dcc_fill_local_nick_user_host(d,dcc);
@@ -314,7 +314,7 @@ static void dccModuleParseDccChat(KviDccRequest *dcc)
if(!t)
{
// hum.. not our tag
-
+
// FIXME: As segnaled by PRAEDO, ezbounce seems to send a fourth parameter in response to /quote ezb log
// Pragma: That's a bug in ezbounce, it sends the filesize of the log as a DCC CHAT parameter...
// The author probably copied and pasted the CTCP line from DCC SEND and forgot to remove the filesize.
@@ -425,7 +425,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
// swap the tag and the filename (we have added a fileoffer with this tag)
dcc->szParam1 = dcc->szParam5;
dcc->szParam5 = "";
-
+
dccModuleParseDccRecv(dcc);
return;
}
@@ -444,7 +444,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
{
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("The above request is broken: The fourth parameter should be the file size but does not appear to be an unsigned number, trying to continue","dcc"),dcc->szParam4.ptr());
- }
+ }
dcc->szParam4 = __tr2qs_ctx("<unknown size>","dcc");
}
@@ -454,7 +454,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
{
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("The above request is broken: The filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr());
- }
+ }
dcc->szParam1.cutToLast('/');
}
@@ -474,7 +474,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
KviDccDescriptor * d = new KviDccDescriptor(dcc->pConsole);
d->szNick = dcc->ctcpMsg->pSource->nick();
- d->szUser = dcc->ctcpMsg->pSource->username();
+ d->szUser = dcc->ctcpMsg->pSource->user();
d->szHost = dcc->ctcpMsg->pSource->host();
dcc_fill_local_nick_user_host(d,dcc);
@@ -539,7 +539,7 @@ static void dccModuleParseDccAccept(KviDccRequest *dcc)
static void dccModuleParseDccResume(KviDccRequest *dcc)
{
// This is usually RESUME <filename> <port> <resumesize>
-
+
// when a zero port request is initiated by us we send out
// DCC SEND <filename> <fakeipaddress> 0 <filesize> <tag>
// and if the remote party wants to resume then we get
@@ -595,7 +595,7 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc)
{
dcc->ctcpMsg->msg->console()->outputNoFmt(KVI_OUT_DCCMSG,
__tr2qs_ctx("The above request has resume file size missing, assuming a resume file size of 0","dcc"));
- }
+ }
dcc->szParam4 = "0";
}
@@ -605,7 +605,7 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc)
{
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("The above request is broken: The filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr());
- }
+ }
dcc->szParam1.cutToLast('/');
}
@@ -649,7 +649,7 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc)
d->szFileName = dcc->szParam1.ptr();
d->szFileSize = dcc->szParam4.ptr();
-
+
//d->bResume = false; // This is actually useless
d->szLocalFileName = o->absFilePath();
@@ -690,7 +690,7 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc)
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("%Q [%Q@%Q] is ready to receive the file \"%s\"","dcc"),
&(dcc->ctcpMsg->pSource->nick()),
- &(dcc->ctcpMsg->pSource->username()),
+ &(dcc->ctcpMsg->pSource->user()),
&(dcc->ctcpMsg->pSource->host()),
dcc->szParam1.ptr());
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
@@ -734,7 +734,7 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc)
{
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("The above request is broken: The fourth parameter should be the file size but does not appear to be an unsigned number; trying to continue","dcc"),dcc->szParam2.ptr());
- }
+ }
dcc->szParam2 = __tr_ctx("<unknown size>","dcc");
}
@@ -744,7 +744,7 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc)
{
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("The above request is broken: The filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr());
- }
+ }
dcc->szParam1.cutToLast('/');
}
@@ -766,7 +766,7 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc)
KviDccDescriptor * d = new KviDccDescriptor(dcc->pConsole);
d->szNick = dcc->ctcpMsg->pSource->nick();
- d->szUser = dcc->ctcpMsg->pSource->username();
+ d->szUser = dcc->ctcpMsg->pSource->user();
d->szHost = dcc->ctcpMsg->pSource->host();
d->szIp = __tr2qs_ctx("(unknown)","dcc");
d->szPort = d->szIp;
@@ -786,7 +786,7 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc)
d->szFileName = dcc->szParam1.ptr();
d->szFileSize = dcc->szParam2.ptr();
d->bActive = false; // we have to listen!
- d->bResume = false;
+ d->bResume = false;
d->bRecvFile = true; // we have to receive the file!
#ifdef COMPILE_SSL_SUPPORT
@@ -855,7 +855,7 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
__tr2qs_ctx("No file offer named '%s' (with size %s) available for %Q [%Q@%Q]","dcc"),
dcc->szParam1.ptr(),uSize > 0 ? dcc->szParam2.ptr() : __tr_ctx("\"any\"","dcc"),
&(dcc->ctcpMsg->pSource->nick()),
- &(dcc->ctcpMsg->pSource->username()),
+ &(dcc->ctcpMsg->pSource->user()),
&(dcc->ctcpMsg->pSource->host()));
dcc_module_request_error(dcc,szError);
}
@@ -863,7 +863,7 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
}
//#warning "IF NOT IGNORE DCC GET!"
-
+
//#warning "CREATE IT MINIMIZED ETC..."
//#warning "MAYBE USE A DIALOG TO ACCEPT THE REQUEST ?"
//#warning "DO NOT ACCEPT /etc/* requests..."
@@ -874,7 +874,7 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
KviStr szSubproto("RSEND");
szSubproto.prepend(szExtensions);
-
+
QString szFileName = QFileInfo(o->absFilePath()).fileName();
if(o->name() != szFileName)
{
@@ -899,7 +899,7 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("Accepting file request from %Q [%Q@%Q] for '%s' (real file: %Q), offering DCC %s since we can't accept incoming connections (user option)","dcc"),
&(dcc->ctcpMsg->pSource->nick()),
- &(dcc->ctcpMsg->pSource->username()),
+ &(dcc->ctcpMsg->pSource->user()),
&(dcc->ctcpMsg->pSource->host()),dcc->szParam1.ptr(),
&(o->absFilePath()),szSubproto.ptr());
}
@@ -915,11 +915,11 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
KviDccDescriptor * d = new KviDccDescriptor(dcc->pConsole);
d->szNick = dcc->ctcpMsg->pSource->nick();
d->szLocalFileName = o->absFilePath();
- d->szUser = dcc->ctcpMsg->pSource->username();
+ d->szUser = dcc->ctcpMsg->pSource->user();
d->szHost = dcc->ctcpMsg->pSource->host();
d->bRecvFile = false;
dcc_fill_local_nick_user_host(d,dcc);
-
+
QString tmp;
if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp))
{
@@ -956,7 +956,7 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("Accepting file request from %Q [%Q@%Q] for '%s' (real file: %Q), offering DCC %Q","dcc"),
&(dcc->ctcpMsg->pSource->nick()),
- &(dcc->ctcpMsg->pSource->username()),
+ &(dcc->ctcpMsg->pSource->user()),
&(dcc->ctcpMsg->pSource->host()),
dcc->szParam1.ptr(),
&(o->absFilePath()),&(d->szType));
@@ -1019,7 +1019,7 @@ static void dccModuleParseDccVoice(KviDccRequest *dcc)
KviDccDescriptor * d = new KviDccDescriptor(dcc->pConsole);
d->szNick = dcc->ctcpMsg->pSource->nick();
- d->szUser = dcc->ctcpMsg->pSource->username();
+ d->szUser = dcc->ctcpMsg->pSource->user();
d->szHost = dcc->ctcpMsg->pSource->host();
dcc_fill_local_nick_user_host(d,dcc);
@@ -1141,7 +1141,7 @@ static dccParseProcEntry dccParseProcTable[KVI_NUM_KNOWN_DCC_TYPES]=
KVIMODULEEXPORTFUNC void dccModuleCtcpDccParseRoutine(KviDccRequest *dcc)
{
dcc->szType.toUpper();
-
+
for(int i=0;i<KVI_NUM_KNOWN_DCC_TYPES;i++)
{
if(kvi_strEqualCS(dccParseProcTable[i].type,dcc->szType.ptr()))
diff --git a/src/modules/dcc/utils.cpp b/src/modules/dcc/utils.cpp
index f6e0bf721..bf57e8102 100644
--- a/src/modules/dcc/utils.cpp
+++ b/src/modules/dcc/utils.cpp
@@ -133,7 +133,7 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pCons
szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface);
} else {
#endif
- if(!kvi_getInterfaceAddress(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data(),szListenIp))
+ if(!KviNetUtils::getInterfaceAddress(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),szListenIp))
{
KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault) = false;
if(c)c->warning(__tr2qs_ctx("Can't listen on default interface '%s': fix it in the options dialog, disabling the option (so the next dcc will work)","dcc"),
@@ -155,7 +155,7 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pCons
if(pConsole->isConnected())
{
//#warning "The IPV6 choice is not OK here.... and maybe allow to bind to specified ports"
- pConsole->socket()->getLocalHostIp(szListenIp,pConsole->isIPv6Connection());
+ pConsole->connection()->socket()->getLocalHostIp(szListenIp,pConsole->isIPv6Connection());
} else {
szListenIp = "0.0.0.0"; // huh ? :)
}
diff --git a/src/modules/links/libkvilinks.cpp b/src/modules/links/libkvilinks.cpp
index cc09c9626..66414ee64 100644
--- a/src/modules/links/libkvilinks.cpp
+++ b/src/modules/links/libkvilinks.cpp
@@ -58,11 +58,11 @@ KviPointerList<KviLinksWindow> * g_pLinksWindowList = 0;
static bool links_kvs_cmd_open(KviKvsModuleCommandCall * c)
{
-
+
// FIND ME
- if(!c->window()->console())return c->context()->errorNoIrcContext();
+ if(!c->window()->context())return c->context()->errorNoIrcContext();
- if(!(c->window()->console()->ircContext()->linksWindow()))
+ if(!(c->window()->context()->linksWindow()))
{
KviLinksWindow *w = new KviLinksWindow(c->window()->frame(),c->window()->console());
c->window()->frame()->addWindow(w);
diff --git a/src/modules/links/linkswindow.cpp b/src/modules/links/linkswindow.cpp
index 137f9be78..1c98af4c6 100644
--- a/src/modules/links/linkswindow.cpp
+++ b/src/modules/links/linkswindow.cpp
@@ -86,7 +86,7 @@ KviLinksWindow::KviLinksWindow(KviFrame * lpFrm,KviConsole * lpConsole)
connectionStateChange();
- m_pConsole->ircContext()->setLinksWindowPointer(this);
+ m_pConsole->context()->setLinksWindowPointer(this);
m_szRootServer = __tr2qs("(None)");
}
@@ -94,14 +94,14 @@ KviLinksWindow::KviLinksWindow(KviFrame * lpFrm,KviConsole * lpConsole)
KviLinksWindow::~KviLinksWindow()
{
g_pLinksWindowList->removeRef(this);
- m_pConsole->ircContext()->setLinksWindowPointer(0);
+ m_pConsole->context()->setLinksWindowPointer(0);
delete m_pLinkList;
delete m_pHostPopup;
}
void KviLinksWindow::getBaseLogFileName(KviStr &buffer)
{
- buffer.sprintf("LINKS_%d",console()->ircContextId());
+ buffer.sprintf("LINKS_%d",context()->id());
}
void KviLinksWindow::requestLinks()
@@ -151,7 +151,7 @@ QSize KviLinksWindow::sizeHint() const
void KviLinksWindow::fillCaptionBuffers()
{
- KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Links for %Q [IRC Context %u]"),&m_szRootServer,m_pConsole->ircContextId());
+ KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Links for %Q [IRC Context %u]"),&m_szRootServer,m_pConsole->context()->id());
KviQString::sprintf(m_szHtmlActiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Links for %Q</b></font> " \
@@ -159,7 +159,7 @@ void KviLinksWindow::fillCaptionBuffers()
KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii(),
&m_szRootServer,
KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name().ascii(),
- m_pConsole->ircContextId());
+ m_pConsole->context()->id());
KviQString::sprintf(m_szHtmlInactiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Links for %Q</b></font> " \
@@ -167,7 +167,7 @@ void KviLinksWindow::fillCaptionBuffers()
KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii(),
&m_szRootServer,
KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name().ascii(),
- m_pConsole->ircContextId());
+ m_pConsole->context()->id());
}
void KviLinksWindow::die()
@@ -262,7 +262,7 @@ void KviLinksWindow::endOfLinks()
}
}
}
-
+
avgHops = ((totalHosts > 0) ? ((totalHops * 100) / totalHosts) : 0 );
int nearProcent = ((totalHosts > 0) ? ((nearLinks * 10000) / totalHosts) : 0);
int directProcent = ((totalHosts > 0) ? ((directLinks * 10000) / totalHosts) : 0);
diff --git a/src/modules/list/libkvilist.cpp b/src/modules/list/libkvilist.cpp
index 9941bb404..52450aeee 100644
--- a/src/modules/list/libkvilist.cpp
+++ b/src/modules/list/libkvilist.cpp
@@ -52,7 +52,7 @@ static bool list_kvs_cmd_open(KviKvsModuleCommandCall * c)
if(!c->window()->console())return c->context()->errorNoIrcContext();
- if(!(c->window()->console()->ircContext()->listWindow()))
+ if(!(c->window()->context()->listWindow()))
{
KviListWindow *w = new KviListWindow(c->window()->frame(),c->window()->console());
c->window()->frame()->addWindow(w);
diff --git a/src/modules/list/listwindow.cpp b/src/modules/list/listwindow.cpp
index f57d39276..c9bb4a790 100644
--- a/src/modules/list/listwindow.cpp
+++ b/src/modules/list/listwindow.cpp
@@ -231,7 +231,7 @@ KviListWindow::KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole)
m_pIrcView = new KviIrcView(m_pVertSplitter,lpFrm,this);
- m_pConsole->ircContext()->setListWindowPointer(this);
+ m_pConsole->context()->setListWindowPointer(this);
connect(m_pConsole->context(),SIGNAL(stateChanged()),
this,SLOT(connectionStateChange()));
@@ -243,7 +243,7 @@ KviListWindow::KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole)
KviListWindow::~KviListWindow()
{
g_pListWindowList->removeRef(this);
- m_pConsole->ircContext()->setListWindowPointer(0);
+ m_pConsole->context()->setListWindowPointer(0);
if(m_pFlushTimer)delete m_pFlushTimer;
m_pItemList->setAutoDelete(true);
delete m_pItemList;
@@ -251,7 +251,7 @@ KviListWindow::~KviListWindow()
void KviListWindow::getBaseLogFileName(KviStr &buffer)
{
- buffer.sprintf("LIST_%d",console()->ircContextId());
+ buffer.sprintf("LIST_%d",context()->id());
}
void KviListWindow::requestList()
@@ -315,21 +315,21 @@ QSize KviListWindow::sizeHint() const
void KviListWindow::fillCaptionBuffers()
{
- KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Channel List [IRC Context %u]"),m_pConsole->ircContextId());
+ KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Channel List [IRC Context %u]"),m_pConsole->context()->id());
KviQString::sprintf(m_szHtmlActiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Channel List</b></font> " \
"<font color=\"%s\">[IRC Context %u]</font></nobr>"),
KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().toAscii().data(),
KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name().toAscii().data(),
- m_pConsole->ircContextId());
+ m_pConsole->context()->id());
KviQString::sprintf(m_szHtmlInactiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Channel list</b></font> " \
"<font color=\"%s\">[IRC Context %u]</font></nobr>"),
KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().toAscii().data(),
KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name().toAscii().data(),
- m_pConsole->ircContextId());
+ m_pConsole->context()->id());
}
void KviListWindow::die()
diff --git a/src/modules/reguser/dialog.cpp b/src/modules/reguser/dialog.cpp
index 24a3224cf..3553e7941 100644
--- a/src/modules/reguser/dialog.cpp
+++ b/src/modules/reguser/dialog.cpp
@@ -204,7 +204,7 @@ KviRegisteredUsersDialog::KviRegisteredUsersDialog(QWidget * par)
connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
QToolTip::add(m_pAddButton,__tr2qs("Open the edit dialog to create a new user entry."));
m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NEWITEM)));
-
+
m_pAddGroupButton = new QPushButton(__tr2qs("&Add Group..."),vbox);
connect(m_pAddGroupButton,SIGNAL(clicked()),this,SLOT(addGroupClicked()));
QToolTip::add(m_pAddGroupButton,__tr2qs("Adds a new group"));
@@ -300,12 +300,12 @@ void KviRegisteredUsersDialog::itemPressed(KviTalListViewItem *it,const QPoint &
if(b->type()==KviRegisteredUsersDialogItemBase::User)
{
KviRegisteredUsersDialogItem *i = (KviRegisteredUsersDialogItem *)it;
-
+
QRect r = m_pListView->itemRect(i);
int daw = m_pListView->columnWidth(0);
-
+
QPoint ppp = m_pListView->mapFromGlobal(pnt);
-
+
if((c == 1) && (ppp.x() < (r.height() + 5 + daw)))
{
// notify list toggle
@@ -315,7 +315,7 @@ void KviRegisteredUsersDialog::itemPressed(KviTalListViewItem *it,const QPoint &
} else {
// try to find the nicknames to be notified
QString szMask;
-
+
for(KviIrcMask * m = i->user()->maskList()->first();m;m = i->user()->maskList()->next())
{
QString tmp = m->nick();
@@ -331,7 +331,7 @@ void KviRegisteredUsersDialog::itemPressed(KviTalListViewItem *it,const QPoint &
szMask.replace("'","");
szMask.replace("&","");
szMask.replace(",","");
-
+
i->user()->setProperty("notify",szMask);
}
m_pListView->update();
@@ -367,7 +367,7 @@ void KviRegisteredUsersDialog::addGroupClicked()
void KviRegisteredUsersDialog::editGroup(KviRegisteredUserGroup* group)
{
bool ok;
-
+
QString text = QInputDialog::getText(
"KVIrc", __tr("Group name:"), QLineEdit::Normal,
group->name(), &ok, this );
@@ -378,15 +378,15 @@ void KviRegisteredUsersDialog::editGroup(KviRegisteredUserGroup* group)
g_pLocalRegisteredUserDataBase->groupDict()->setAutoDelete(1);
group->setName(text);
g_pLocalRegisteredUserDataBase->groupDict()->insert(text,group);
-
+
KviPointerHashTable<QString,KviRegisteredUser> * d = g_pLocalRegisteredUserDataBase->userDict();
-
+
for(KviRegisteredUser * u = d->first();u;u = d->next())
{
if(u->group()==szOldGroup)
u->setGroup(text);
}
-
+
fillList();
}
}
@@ -399,7 +399,7 @@ void KviRegisteredUsersDialog::listViewRightButtonClicked ( KviTalListViewItem *
if(b->type()==KviRegisteredUsersDialogItemBase::User)
{
KviTalPopupMenu *groups = new KviTalPopupMenu;
-
+
KviPointerHashTable<QString,KviRegisteredUserGroup> * pGroups = g_pLocalRegisteredUserDataBase->groupDict();
m_TmpDict.clear();
for(KviPointerHashTableEntry<QString,KviRegisteredUserGroup> * g = pGroups->firstEntry();g;g = pGroups->nextEntry())
@@ -407,9 +407,9 @@ void KviRegisteredUsersDialog::listViewRightButtonClicked ( KviTalListViewItem *
int id=groups->insertItem(g->key());
m_TmpDict.replace(id,g->data());
}
-
+
connect(groups,SIGNAL(activated ( int )),this,SLOT(moveToGroupMenuClicked(int)));
-
+
KviTalPopupMenu *mainPopup = new KviTalPopupMenu;
mainPopup->insertItem(__tr("Move to group"),groups);
mainPopup->exec(point);
@@ -426,7 +426,7 @@ void KviRegisteredUsersDialog::moveToGroupMenuClicked(int id)
if(b->type()==KviRegisteredUsersDialogItemBase::User)
{
((KviRegisteredUsersDialogItem *)(it.current()))->user()->setGroup(szGroup);
- }
+ }
++it;
}
fillList();
@@ -437,7 +437,7 @@ void KviRegisteredUsersDialog::fillList()
m_pListView->clear();
KviPointerHashTable<QString,KviRegisteredUsersGroupItem> groupItems(5,false);
groupItems.setAutoDelete(false);
-
+
KviPointerHashTable<QString,KviRegisteredUserGroup> * pGroups = g_pLocalRegisteredUserDataBase->groupDict();
for(KviRegisteredUserGroup * g = pGroups->first();g;g = pGroups->next())
{
@@ -445,7 +445,7 @@ void KviRegisteredUsersDialog::fillList()
groupItems.insert(g->name(),pCur);
pCur->setOpen(TRUE);
}
-
+
KviPointerHashTable<QString,KviRegisteredUser> * d = g_pLocalRegisteredUserDataBase->userDict();
KviRegisteredUsersDialogItem * item;
@@ -544,14 +544,14 @@ void KviRegisteredUsersDialog::removeClicked()
// if(it->isSelected())l.append(it);
// it = (KviRegisteredUsersDialogItem *)it->nextSibling();
// }
-//
+//
// for(KviRegisteredUsersDialogItem * i = l.first();i;i = l.next())
// {
// //g_pLocalRegisteredUserDataBase->removeUser(i->user()->name());
// delete i;
// }
// } else {
-//
+//
// }
}
@@ -713,7 +713,7 @@ void KviRegisteredUsersDialog::exportClicked()
if(!f.save(1))goto write_error;
QImageWriter io;
io.setDevice(&f);
- io.setFormat("PNG");
+ io.setFormat("PNG");
if(!io.write(av->pixmap()->convertToImage()))goto write_error;
} else {
if(!f.save(0))goto write_error;
@@ -817,20 +817,20 @@ void KviRegisteredUsersDialog::importClicked()
KviStr fName = u->name();
kvi_encodeFileName(fName);
- KviStr fPath;
+ QString fPath;
int rnm = 0 ;
do
{
g_pApp->getLocalKvircDirectory(fPath,KviApp::Avatars,fName.ptr());
- fPath.append(KviStr::Format,"%d.png",rnm);
+ fPath.append(QString("%1.png").arg(rnm));
rnm++;
- } while(KviFileUtils::fileExists(fPath.ptr()));
+ } while(KviFileUtils::fileExists(fPath));
- if(!img.save(fPath.ptr(),"PNG"))
+ if(!img.save(fPath,"PNG"))
{
- debug("Can't save image %s",fPath.ptr());
+ debug("Can't save image %s",fPath.local8Bit().data());
} else {
- u->setProperty("avatar",fPath.ptr());
+ u->setProperty("avatar",fPath);
}
}
}
diff --git a/src/modules/socketspy/socketspywindow.cpp b/src/modules/socketspy/socketspywindow.cpp
index 89a230180..0f6a263f8 100644
--- a/src/modules/socketspy/socketspywindow.cpp
+++ b/src/modules/socketspy/socketspywindow.cpp
@@ -72,26 +72,26 @@ QSize KviSocketSpyWindow::sizeHint() const
void KviSocketSpyWindow::getBaseLogFileName(KviStr &buffer)
{
- buffer.sprintf("SOCKETSPY_%d",console()->ircContextId());
+ buffer.sprintf("SOCKETSPY_%d",context()->id());
}
void KviSocketSpyWindow::fillCaptionBuffers()
{
- KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Socket Spy [IRC Context %u]"),m_pConsole->ircContextId());
+ KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Socket Spy [IRC Context %u]"),m_pConsole->context()->id());
KviQString::sprintf(m_szHtmlActiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Socket Spy</b></font> " \
"<font color=\"%s\">[IRC Context %u]</font></nobr>"),
KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().toAscii().data(),
KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name().toAscii().data(),
- m_pConsole->ircContextId());
+ m_pConsole->context()->id());
KviQString::sprintf(m_szHtmlInactiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Socket Spy</b></font> " \
"<font color=\"%s\">[IRC Context %u]</font></nobr>"),
KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().toAscii().data(),
KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name().toAscii().data(),
- m_pConsole->ircContextId());
+ m_pConsole->context()->id());
}
void KviSocketSpyWindow::incomingMessage(const char * message)
diff --git a/src/modules/trayicon/libkvitrayicon.cpp b/src/modules/trayicon/libkvitrayicon.cpp
index 5cd26c15b..ebd84e0ed 100644
--- a/src/modules/trayicon/libkvitrayicon.cpp
+++ b/src/modules/trayicon/libkvitrayicon.cpp
@@ -73,7 +73,7 @@ KviTrayIcon::KviTrayIcon(KviFrame * frm)
m_iChannels = 0;
m_iQueries = 0;
m_iOther = 0;
-
+
m_pFlashingTimer = new QTimer(this,"flashing_timer");
connect( m_pFlashingTimer, SIGNAL(timeout()), this, SLOT(flashingTimerShot()) );
m_bFlashed=0;
@@ -83,7 +83,7 @@ KviTrayIcon::KviTrayIcon(KviFrame * frm)
m_pTip = new KviDynamicToolTip(frm,"dock_tooltip");
m_pAwayPopup = new KviTalPopupMenu(0);
-
+
QLabel * l = new QLabel(__tr2qs("<b>KVIrc</b>"),m_pContextPopup);
QPalette p;
l->setStyleSheet("background-color: " + p.color(QPalette::Normal, QPalette::Mid).name());
@@ -91,7 +91,7 @@ KviTrayIcon::KviTrayIcon(KviFrame * frm)
m_pContextPopup->setWindowTitle(__tr2qs("Context"));
m_iAwayMenuId = m_pContextPopup->insertItem ( __tr2qs("Away"), m_pAwayPopup);
m_pContextPopup->changeItem(m_iAwayMenuId,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),__tr2qs("Away"));
-
+
int id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_OPTIONS)),__tr2qs("&Configure KVIrc..."),m_pFrm,SLOT(executeInternalCommand(int)));
m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_OPTIONS_DIALOG);
id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("&About KVIrc"),m_pFrm,SLOT(executeInternalCommand(int)));
@@ -104,7 +104,7 @@ KviTrayIcon::KviTrayIcon(KviFrame * frm)
id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITAPP)),__tr2qs("&Quit"),g_pApp,SLOT(quit()));
m_pContextPopup->setAccel(__tr2qs("Ctrl+Q"),id);
connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(fillContextPopup()));
-
+
QIcon icon(*g_pDock1);
setIcon(icon);
@@ -163,7 +163,7 @@ void KviTrayIcon::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt)
for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
{
-
+
if(b->kviWindow()->view())
{
if(b->kviWindow()->view()->haveUnreadedMessages())
@@ -249,15 +249,15 @@ void KviTrayIcon::fillContextPopup()
{
m_pContextPopup->setItemVisible(m_iAwayMenuId,true);
m_pAwayPopup->clear();
-
+
int iAllAway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on all"),this,SLOT(doAway(int)));
m_pAwayPopup->setItemParameter(iAllAway,-1);
-
+
int iAllUnaway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on all"),this,SLOT(doAway(int)));
m_pAwayPopup->setItemParameter(iAllUnaway,-2);
-
+
int iSeparator=m_pAwayPopup->insertSeparator();
-
+
KviPointerHashTableIterator<QString,KviWindow> it(*g_pGlobalWindowDict);
bool bAllAway=1;
bool bAllUnaway=1;
@@ -278,7 +278,7 @@ void KviTrayIcon::fillContextPopup()
id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(int)));
bAllAway=0;
}
- m_pAwayPopup->setItemParameter(id,pConsole->ircContextId());
+ m_pAwayPopup->setItemParameter(id,pConsole->context()->id());
iNetCount++;
}
}
@@ -308,7 +308,7 @@ void KviTrayIcon::toggleParentFrame()
top_widget->show();
top_widget->raise();
top_widget->setActiveWindow();
- if(g_pActiveWindow) g_pActiveWindow->setFocus();
+ if(g_pActiveWindow) g_pActiveWindow->setFocus();
if(m_pFrm->isMinimized())
m_pFrm->showNormal();
else
@@ -320,7 +320,7 @@ void KviTrayIcon::refresh()
{
grabActivityInfo();
- if( (m_iChannels == 2) || (m_iQueries == 2) )
+ if( (m_iChannels == 2) || (m_iQueries == 2) )
{
if(!m_pFlashingTimer->isActive() && KVI_OPTION_BOOL(KviOption_boolEnableTrayIconFlashing) )
m_pFlashingTimer->start(1000);
@@ -338,24 +338,24 @@ void KviTrayIcon::refresh()
thisRestrictionOfQt4IsNotNice.drawPixmap((ICON_SIZE-16)/2,(ICON_SIZE-16)/2,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16);
} else {
thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,ICON_SIZE/2,ICON_SIZE/2,
- m_iOther ?
+ m_iOther ?
((m_iOther == 2) ? *g_pDock3 : *g_pDock2)
: *g_pDock1,0,0,ICON_SIZE/2,ICON_SIZE/2);
thisRestrictionOfQt4IsNotNice.drawPixmap(0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
m_iConsoles ?
- ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2)
+ ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2)
: *g_pDock1,0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2);
thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2,
m_iQueries ?
- ((m_iQueries == 2)
- ? *g_pDock3 : *g_pDock2)
+ ((m_iQueries == 2)
+ ? *g_pDock3 : *g_pDock2)
: *g_pDock1,ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2);
thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
m_iChannels ?
- ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2)
+ ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2)
: *g_pDock1
,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2);
@@ -374,15 +374,15 @@ void KviTrayIcon::activatedSlot( QSystemTrayIcon::ActivationReason reason )
void KviTrayIcon::grabActivityInfo()
{
KviTaskBarBase * t = m_pFrm->taskBar();
-
+
if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
{
if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=5;
if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=5;
-
+
if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=1;
if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=1;
-
+
if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage))
KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage);
}
@@ -442,21 +442,21 @@ void KviTrayIcon::grabActivityInfo()
}
}
}
-
+
if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
{
if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iConsoles=2;
else if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iConsoles=1;
else m_iConsoles=0;
-
+
if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iChannels=2;
else if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iChannels=1;
else m_iChannels=0;
-
+
if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iQueries=2;
else if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iQueries=1;
else m_iQueries=0;
-
+
if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iOther=2;
else if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iOther=1;
else m_iOther=0;
@@ -645,10 +645,10 @@ static bool trayicon_module_cleanup(KviModule *m)
delete g_pDock1;
g_pDock1 = 0;
-
+
delete g_pDock2;
g_pDock2 = 0;
-
+
delete g_pDock3;
g_pDock3 = 0;
diff --git a/src/modules/url/libkviurl.cpp b/src/modules/url/libkviurl.cpp
index 8ccb35df9..b2d8c1ce0 100644
--- a/src/modules/url/libkviurl.cpp
+++ b/src/modules/url/libkviurl.cpp
@@ -56,7 +56,7 @@ KviPointerList<UrlDlgList> *g_pUrlDlgList;
KviPointerList<KviStr> *g_pBanList;
ConfigDialog *g_pConfigDialog;
-KviStr szConfigPath;
+QString szConfigPath;
void saveUrlList();
void loadUrlList();
@@ -112,7 +112,7 @@ UrlDialog::UrlDialog(KviPointerList<KviUrl> *g_pList)
m_pMenuBar = new KviTalMenuBar(this,"url menu");
m_pUrlList = new KviTalListView(this);
//m_pUrlList = new KviListView(this,"list");
- KviConfig cfg(szConfigPath.ptr(),KviConfig::Read);
+ KviConfig cfg(szConfigPath,KviConfig::Read);
KviTalPopupMenu *pop;
@@ -312,7 +312,7 @@ void UrlDialog::resizeEvent(QResizeEvent *)
UrlDialog::~UrlDialog()
{
- KviConfig cfg(szConfigPath.ptr(),KviConfig::Write);
+ KviConfig cfg(szConfigPath,KviConfig::Write);
cfg.setGroup("ConfigDialog");
if (cfg.readBoolEntry("SaveColumnWidthOnClose",false)) {
cfg.setGroup("ColsWidth");
@@ -342,7 +342,7 @@ ConfigDialog::ConfigDialog()
QGridLayout *g = new QGridLayout(this);
- KviConfig *cfg = new KviConfig(szConfigPath.ptr(),KviConfig::Read);
+ KviConfig *cfg = new KviConfig(szConfigPath,KviConfig::Read);
cfg->setGroup("ConfigDialog");
cb[0] = new QCheckBox(__tr2qs("Save URL list on module unload"),this);
@@ -381,7 +381,7 @@ void ConfigDialog::acceptbtn()
{
if (m_pBanFrame) m_pBanFrame->saveBans();
- KviConfig *cfg = new KviConfig(szConfigPath.ptr(),KviConfig::Write);
+ KviConfig *cfg = new KviConfig(szConfigPath,KviConfig::Write);
cfg->setGroup("ConfigDialog");
cfg->writeEntry("SaveUrlListOnUnload",cb[0]->isChecked());
cfg->writeEntry("SaveColumnWidthOnClose",cb[1]->isChecked());
@@ -477,7 +477,7 @@ void BanFrame::removeBan()
void BanFrame::saveBans()
{
if (m_pEnable->isChecked()) saveBanList();
- KviConfig *cfg = new KviConfig(szConfigPath.ptr(),KviConfig::Write);
+ KviConfig *cfg = new KviConfig(szConfigPath,KviConfig::Write);
cfg->setGroup("ConfigDialog");
cfg->writeEntry("BanEnabled",m_pEnable->isChecked());
delete cfg;
@@ -500,7 +500,7 @@ void saveUrlList()
file.open(IO_WriteOnly);
QTextStream stream(&file);
-
+
stream << g_pList->count() << endl;
for(KviUrl *tmp=g_pList->first();tmp;tmp=g_pList->next())
@@ -516,11 +516,11 @@ void saveUrlList()
void loadUrlList()
{
- KviStr urllist;
+ QString urllist;
g_pApp->getLocalKvircDirectory(urllist,KviApp::ConfigPlugins);
urllist += g_pUrlListFilename;
QFile file;
- file.setName(QString::fromUtf8(urllist.ptr()));
+ file.setName(urllist);
if (!file.open(IO_ReadOnly))return;
QTextStream stream(&file);
@@ -556,11 +556,11 @@ void loadUrlList()
void saveBanList()
{
- KviStr banlist;
+ QString banlist;
g_pApp->getLocalKvircDirectory(banlist,KviApp::ConfigPlugins);
banlist += g_pBanListFilename;
QFile file;
- file.setName(QString::fromUtf8(banlist.ptr()));
+ file.setName(banlist);
file.open(IO_WriteOnly);
QTextStream stream(&file);
@@ -576,13 +576,13 @@ void saveBanList()
void loadBanList()
{
- KviStr banlist;
+ QString banlist;
g_pApp->getLocalKvircDirectory(banlist,KviApp::ConfigPlugins);
banlist += g_pBanListFilename;
QFile file;
- file.setName(QString::fromUtf8(banlist.ptr()));
+ file.setName(banlist);
if (!file.open(IO_ReadOnly))return;
-
+
QTextStream stream(&file);
g_pBanList->clear();
@@ -809,13 +809,13 @@ static bool url_module_init(KviModule *m)
UrlDlgList *udl = new UrlDlgList();
udl->dlg = 0;
g_pUrlDlgList->append(udl);
-
+
return true;
}
static bool url_module_cleanup(KviModule *m)
{
- KviConfig cfg(szConfigPath.ptr(),KviConfig::Read);
+ KviConfig cfg(szConfigPath,KviConfig::Read);
cfg.setGroup("ConfigDialog");
if (cfg.readBoolEntry("SaveUrlListOnUnload",false) == true) saveUrlList();
for (UrlDlgList *tmpitem=g_pUrlDlgList->first();tmpitem;tmpitem=g_pUrlDlgList->next()) {
diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp
index 66acf411e..947dde9b8 100644
--- a/src/modules/window/libkviwindow.cpp
+++ b/src/modules/window/libkviwindow.cpp
@@ -799,7 +799,7 @@ static bool window_kvs_fnc_context(KviKvsModuleFunctionCall * c)
GET_KVS_FNC_WINDOW_ID
if(pWnd)
{
- c->returnValue()->setInteger(pWnd->console() ? pWnd->console()->ircContextId() : 0);
+ c->returnValue()->setInteger(pWnd->context() ? pWnd->context()->id() : 0);
}
return true;
}
@@ -1034,7 +1034,7 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c)
{
return true;
}
- uId = c->window()->console()->ircContextId();
+ uId = c->window()->context()->id();
}
bool bAllWindows = KviQString::equalCI(szType.toLower(),"all");
@@ -1042,9 +1042,9 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c)
while(KviWindow * wnd = it.current())
{
- if(wnd->console())
+ if(wnd->context())
{
- if(wnd->console()->ircContextId() == uId)
+ if(wnd->context()->id() == uId)
{
if(bAllWindows)
{
@@ -1391,7 +1391,7 @@ static bool window_kvs_cmd_setBackground(KviKvsModuleCommandCall * c)
if(pWnd)
pWnd->view()->setPrivateBackgroundPixmap(*pix);
*/
-
+
//FIXME: This is broken
return true;