summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/controller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/puke/controller.cpp')
-rw-r--r--ksirc/puke/controller.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/ksirc/puke/controller.cpp b/ksirc/puke/controller.cpp
index a854cd60..b4c1dd20 100644
--- a/ksirc/puke/controller.cpp
+++ b/ksirc/puke/controller.cpp
@@ -55,8 +55,8 @@ PukeController::PukeController(TQString sock, TQObject *parent, const char *name
int len, prev_umask;
struct sockaddr_un unix_addr;
- running = FALSE; // Running has to be true before we do any work
- bClosing = FALSE; // we're not trying to close so set this false.
+ running = false; // Running has to be true before we do any work
+ bClosing = false; // we're not trying to close so set this false.
// Set the umask to something sane that doesn't allow others to take over ksirc
prev_umask = umask(0177);
@@ -97,7 +97,7 @@ PukeController::PukeController(TQString sock, TQObject *parent, const char *name
return;
}
- running = TRUE;
+ running = true;
fcntl(iListenFd, F_SETFL, O_NONBLOCK); // Set it non-block so that
// accept() never blocks.
@@ -109,16 +109,16 @@ PukeController::PukeController(TQString sock, TQObject *parent, const char *name
connect(objFind, TQ_SIGNAL(inserted(TQObject *)),
this, TQ_SLOT(slotInserted(TQObject *)));
- qidConnectFd.setAutoDelete(TRUE);
+ qidConnectFd.setAutoDelete(true);
- qidCommandTable.setAutoDelete(TRUE);
+ qidCommandTable.setAutoDelete(true);
/*
* Setup widget data trees
*/
- WidgetList.setAutoDelete(TRUE);
- revWidgetList.setAutoDelete(TRUE);
- widgetCF.setAutoDelete(TRUE);
+ WidgetList.setAutoDelete(true);
+ revWidgetList.setAutoDelete(true);
+ widgetCF.setAutoDelete(true);
/*
* Connect outputMessage to the acutal write buffer function
@@ -181,7 +181,7 @@ void PukeController::NewConnect(int)
connect(fds->sw, TQ_SIGNAL(activated(int)),
this, TQ_SLOT(Writeable(int)));
qidConnectFd.insert(cfd, fds);
- qsnListen->setEnabled(TRUE);
+ qsnListen->setEnabled(true);
/*
* Now we add ourselves as a client to the fd so we can process messages going to us
@@ -197,8 +197,8 @@ void PukeController::NewConnect(int)
void PukeController::Writeable(int fd)
{
if(qidConnectFd[fd]){
- qidConnectFd[fd]->writeable = TRUE;
- qidConnectFd[fd]->sw->setEnabled(FALSE);
+ qidConnectFd[fd]->writeable = true;
+ qidConnectFd[fd]->sw->setEnabled(false);
//
// Insert buffer flushing code here.
//
@@ -211,7 +211,7 @@ void PukeController::Writeable(int fd)
void PukeController::writeBuffer(int fd, PukeMessage *message)
{
if(qidConnectFd[fd]){
- // if(qidConnectFd[fd]->writeable == FALSE){
+ // if(!qidConnectFd[fd]->writeable){
// kdDebug(5008) << "PUKE: Writing to FD that's not writeable: " << fd << endl;
// }
if(message != 0){
@@ -345,7 +345,7 @@ void PukeController::Traffic(int fd)
}
}
else{
- qidConnectFd[fd]->sr->setEnabled(TRUE);
+ qidConnectFd[fd]->sr->setEnabled(true);
}
}
@@ -656,7 +656,7 @@ void PukeController::hdlrPukeDeleteWidget(int fd, PukeMessage *pm)
}
*/
- if(checkWidgetId(&wI) == FALSE){
+ if(!checkWidgetId(&wI)){
tqWarning("WidgetRunner: no such widget: %d", wI.iWinId);
throw(errorCommandFailed(PUKE_INVALID, INVALID_DEL_NO_SUCH_WIDGET));
}
@@ -672,16 +672,16 @@ void PukeController::hdlrPukeDeleteWidget(int fd, PukeMessage *pm)
void PukeController::closefd(int fd)
{
- if(bClosing == TRUE)
+ if(bClosing)
return;
- bClosing = TRUE;
+ bClosing = true;
if(qidConnectFd[fd] == NULL){
kdDebug(5008) << "PukeController: Connect table NULL, closed twice?" << endl;
return;
}
// Shutof the listener before closing the socket, just in case.
- qidConnectFd[fd]->sr->setEnabled(FALSE); // Shut them off
- qidConnectFd[fd]->sw->setEnabled(FALSE);
+ qidConnectFd[fd]->sr->setEnabled(false); // Shut them off
+ qidConnectFd[fd]->sw->setEnabled(false);
delete qidConnectFd[fd]->sr;
delete qidConnectFd[fd]->sw;
qidConnectFd[fd]->server.truncate(0);
@@ -694,7 +694,7 @@ void PukeController::closefd(int fd)
TQIntDict<WidgetS> *qidWS = WidgetList[fd];
if(qidWS == 0){
kdDebug(5008) << "WidgetRunner:: Close called twice?" << endl;
- bClosing = FALSE;
+ bClosing = false;
return;
}
@@ -739,20 +739,20 @@ void PukeController::closefd(int fd)
} while (qidWS->count() > 0);
WidgetList.remove(fd);
- bClosing = FALSE;
+ bClosing = false;
}
bool PukeController::checkWidgetId(widgetId *pwi)
{
if(WidgetList[pwi->fd] != NULL)
if(WidgetList[pwi->fd]->find(pwi->iWinId) != NULL)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
PObject *PukeController::id2pobject(widgetId *pwi){
- if(checkWidgetId(pwi) == TRUE){
+ if(checkWidgetId(pwi)){
return WidgetList[pwi->fd]->find(pwi->iWinId)->pwidget;
}
throw(errorNoSuchWidget(*pwi));
@@ -779,7 +779,7 @@ void PukeController::insertPObject(int fd, int iWinId, WidgetS *obj){
// If no widget list exists for this fd, create one
if(WidgetList[fd] == NULL){
TQIntDict<WidgetS> *qidWS = new TQIntDict<WidgetS>;
- qidWS->setAutoDelete(TRUE);
+ qidWS->setAutoDelete(true);
WidgetList.insert(fd, qidWS);
}
// Set main widget structure list
@@ -813,7 +813,7 @@ void PukeController::pobjectDestroyed(){
return;
}
- if(checkWidgetId(pwi) == TRUE){
+ if(checkWidgetId(pwi)){
WidgetList[pwi->fd]->remove(pwi->iWinId);
}
else {
@@ -898,7 +898,7 @@ void PukeController::messageHandler(int fd, PukeMessage *pm) {
}
}
else{
- if(checkWidgetId(&wI) == TRUE){
+ if(checkWidgetId(&wI)){
WidgetList[wI.fd]->find(wI.iWinId)->pwidget->messageHandler(fd, pm);
}
else{
@@ -942,9 +942,9 @@ widgetId PukeController::createWidget(widgetId wI, PukeMessage *pm)
wIret.iWinId = uiBaseWinId;
wIret.fd = wI.fd;
- if(checkWidgetId(&wI) == TRUE){
+ if(checkWidgetId(&wI)){
PObject *obj = WidgetList[wI.fd]->find(wI.iWinId)->pwidget;
- if(obj->widget()->isWidgetType() == FALSE){
+ if(!obj->widget()->isWidgetType()){
throw(errorCommandFailed(PUKE_INVALID, 0));
}
parent = (PWidget *) obj;