diff options
Diffstat (limited to 'libksirtet')
-rw-r--r-- | libksirtet/base/board.cpp | 4 | ||||
-rw-r--r-- | libksirtet/base/piece.cpp | 4 | ||||
-rw-r--r-- | libksirtet/common/misc_ui.cpp | 6 | ||||
-rw-r--r-- | libksirtet/lib/internal.cpp | 20 | ||||
-rw-r--r-- | libksirtet/lib/meeting.cpp | 34 | ||||
-rw-r--r-- | libksirtet/lib/mp_board.h | 6 | ||||
-rw-r--r-- | libksirtet/lib/mp_interface.cpp | 10 | ||||
-rw-r--r-- | libksirtet/lib/mp_simple_board.cpp | 6 | ||||
-rw-r--r-- | libksirtet/lib/mp_simple_interface.cpp | 8 | ||||
-rw-r--r-- | libksirtet/lib/pline.cpp | 6 | ||||
-rw-r--r-- | libksirtet/lib/smanager.h | 4 | ||||
-rw-r--r-- | libksirtet/lib/socket.cpp | 2 | ||||
-rw-r--r-- | libksirtet/lib/socket.h | 4 | ||||
-rw-r--r-- | libksirtet/lib/wizard.cpp | 12 |
14 files changed, 63 insertions, 63 deletions
diff --git a/libksirtet/base/board.cpp b/libksirtet/base/board.cpp index 816d15e3..74643374 100644 --- a/libksirtet/base/board.cpp +++ b/libksirtet/base/board.cpp @@ -299,8 +299,8 @@ bool BaseBoard::timeout() Q_ASSERT( graphic() ); if ( state==GameOver ) return true; switch (state) { - case BeforeRemove: _beforeRemove(FALSE); break; - case AfterRemove: _afterRemove(FALSE); break; + case BeforeRemove: _beforeRemove(false); break; + case AfterRemove: _afterRemove(false); break; default: return false; } main->update(); diff --git a/libksirtet/base/piece.cpp b/libksirtet/base/piece.cpp index 061088fb..27d704bd 100644 --- a/libksirtet/base/piece.cpp +++ b/libksirtet/base/piece.cpp @@ -74,9 +74,9 @@ void SequenceArray::setBlockSize(uint bsize) _size = bsize; const GPieceInfo &pinfo = Piece::info(); TQPtrList<TQPixmap> pixmaps; - pixmaps.setAutoDelete(TRUE); + pixmaps.setAutoDelete(true); TQPtrList<TQPoint> points; - points.setAutoDelete(TRUE); + points.setAutoDelete(true); uint nm = pinfo.nbBlockModes(); for (uint i=0; i<size(); i++) { for (uint k=0; k<2; k++) diff --git a/libksirtet/common/misc_ui.cpp b/libksirtet/common/misc_ui.cpp index f4ba7203..ec40700e 100644 --- a/libksirtet/common/misc_ui.cpp +++ b/libksirtet/common/misc_ui.cpp @@ -82,14 +82,14 @@ class Led : public TQWidget { public: Led(const TQColor &c, TQWidget *parent) - : TQWidget(parent), col(c), _on(FALSE) {} + : TQWidget(parent), col(c), _on(false) {} TQSizePolicy sizePolicy() const { return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } - void on() { if (!_on) { _on = TRUE; repaint(); } } - void off() { if (_on) {_on = FALSE; repaint(); } } + void on() { if (!_on) { _on = true; repaint(); } } + void off() { if (_on) {_on = false; repaint(); } } void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } } protected: diff --git a/libksirtet/lib/internal.cpp b/libksirtet/lib/internal.cpp index e508e4d9..b5ea3881 100644 --- a/libksirtet/lib/internal.cpp +++ b/libksirtet/lib/internal.cpp @@ -39,12 +39,12 @@ void Local::writeData(bool inverse) void Local::treatData() { - readData(TRUE); + readData(true); interface->treatData(); // check reading stream for (uint i=0; i<ios.size(); i++) if ( !ios[i]->reading.readOk() ) DATA_ERROR(i); - writeData(TRUE); + writeData(true); } //----------------------------------------------------------------------------- @@ -61,7 +61,7 @@ void Server::congestion() void Server::serverTimeout() { - ctimer.start(2*interval, TRUE); + ctimer.start(2*interval, true); timeout(); } @@ -75,7 +75,7 @@ Network::Network(MPInterface *_interface, TQPtrListIterator<RemoteHostData> it(rhd); for (; it.current(); ++it) { rd.socket = it.current()->socket; - rd.socket->notifier()->setEnabled(TRUE); + rd.socket->notifier()->setEnabled(true); connect(rd.socket->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(notifier(int))); uint nb = it.current()->bds.count(); @@ -122,7 +122,7 @@ IOBuffer *Network::ioBuffer(uint i) const if ( i<remotes[k].array->size() ) return (*remotes[k].array)[i]; i -= remotes[k].array->size(); } - Q_ASSERT(FALSE); + Q_ASSERT(false); return 0; } @@ -170,7 +170,7 @@ NetworkServer::NetworkServer(MPInterface *_interface, connect(&timer, TQ_SIGNAL(timeout()), TQ_SLOT(timeoutSlot())); connect(&ctimer, TQ_SIGNAL(timeout()), TQ_SLOT(congestionTimeoutSlot())); // to catch unexpected data - for (uint i=0; i<remotes.count(); i++) remotes[i].received = TRUE; + for (uint i=0; i<remotes.count(); i++) remotes[i].received = true; nbReceived = remotes.count(); // let the client the time to create itself ... // serverTimeout(); @@ -180,7 +180,7 @@ void NetworkServer::timeout() { if ( nbReceived<remotes.count() ) LAG_ERROR; nbReceived = 0; - for (uint i=0; i<remotes.count(); i++) remotes[i].received = FALSE; + for (uint i=0; i<remotes.count(); i++) remotes[i].received = false; // send MF_ASK : asking for data from clients for (uint i=0; i<remotes.count(); i++) { remotes[i].socket->writingStream() << MF_Ask; @@ -202,7 +202,7 @@ void NetworkServer::notifier(int fd) case 0: BROKE_ERROR(i); } - remotes[i].received = TRUE; + remotes[i].received = true; nbReceived++; ReadingStream &s = remotes[i].socket->readingStream(); @@ -256,7 +256,7 @@ void Client::notifier(int) case MF_Ask: // write data from local boards to server socket (cleaning // of writing stream is done in write()) - readData(FALSE); + readData(false); remotes[0].socket->writingStream() << ios; // debug("CLIENT : send ios (size=%i)", // remotes[0].socket->writingStream().size()); @@ -270,7 +270,7 @@ void Client::notifier(int) interface->dataFromServer(s); // debug("CLIENT : after dataFromServer (at=%i)", s.device()->at()); if ( !s.readOk() ) DATA_ERROR(0); - writeData(FALSE); + writeData(false); break; default: DATA_ERROR(0); } diff --git a/libksirtet/lib/meeting.cpp b/libksirtet/lib/meeting.cpp index 7c246356..a0df2404 100644 --- a/libksirtet/lib/meeting.cpp +++ b/libksirtet/lib/meeting.cpp @@ -18,10 +18,10 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, : KDialogBase(Plain, i18n("Network Meeting"), (_server ? Ok|Cancel|Help : Cancel|Help), (_server ? Ok : Cancel), parent, name), - server(_server), ow(option), id(_id), socketRemoved(FALSE) + server(_server), ow(option), id(_id), socketRemoved(false) { sm.append(socket, SocketManager::ReadWrite); - sm[0]->notifier()->setEnabled(TRUE); + sm[0]->notifier()->setEnabled(true); /* top layout */ TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint()); @@ -49,13 +49,13 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, top->addWidget(status); // buttons - enableButtonSeparator(TRUE); + enableButtonSeparator(true); if (server) { setButtonOK(i18n("Start Game")); - enableButtonOK(FALSE); + enableButtonOK(false); } setButtonCancel(server ? i18n("Abort") : i18n("Quit")); - enableButton(Help, FALSE); + enableButton(Help, false); } NetMeeting::~NetMeeting() @@ -115,7 +115,7 @@ bool NetMeeting::ready() const for(uint k=0; k<wl->size(); k++) { switch ( wl->widget(k)->type() ) { case MeetingCheckBox::Ready : nbReady++; break; - case MeetingCheckBox::NotReady : return FALSE; + case MeetingCheckBox::NotReady : return false; default : break; } } @@ -163,7 +163,7 @@ void NetMeeting::readData(uint i) default: dataError(i); } - if (socketRemoved) socketRemoved = FALSE; + if (socketRemoved) socketRemoved = false; else if ( !sm[i]->readingStream().atEnd() ) readData(i); // more pending data } @@ -214,7 +214,7 @@ void NetMeeting::message(const TQString &str) ServerNetMeeting::ServerNetMeeting(const cId &id, const RemoteHostData &r, MPOptionWidget *option, TQPtrList<RemoteHostData> &arhd, TQWidget *parent, const char * name) -: NetMeeting(id, r.socket, option, TRUE, parent, name), rhd(arhd) +: NetMeeting(id, r.socket, option, true, parent, name), rhd(arhd) { connect(sm[0]->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(newHost(int))); players.append(Accepted); // server @@ -247,7 +247,7 @@ void ServerNetMeeting::netError(uint i, const TQString &type) void ServerNetMeeting::disconnectHost(uint i, const TQString &str) { sm.remove(i, true); - socketRemoved = TRUE; + socketRemoved = true; if ( players[i]==Accepted ) { removeLine(i-1); @@ -273,7 +273,7 @@ void ServerNetMeeting::newHost(int) uint i = sm.append(socket, SocketManager::ReadWrite); connect(sm[i]->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(readNotifier(int))); - sm[i]->notifier()->setEnabled(TRUE); + sm[i]->notifier()->setEnabled(true); } void ServerNetMeeting::idFlag(uint i) @@ -314,10 +314,10 @@ void ServerNetMeeting::newFlag(uint i) CHECK_READ(i); // complete the MeetingLineData struct with initial values - pld.own = FALSE; // client line + pld.own = false; // client line pld.ed.type = MeetingCheckBox::NotReady; // not ready by default pld.ed.text = ""; // empty line to begin with - appendLine(pld, TRUE); + appendLine(pld, true); // send to the new client already present lines including its own // (New flag + MeetingLineData struct) @@ -332,7 +332,7 @@ void ServerNetMeeting::newFlag(uint i) // send to all other clients the new line (New flag + MeetingLineData struct) wl->widget(i-1)->data(pld.ed); - pld.own = FALSE; + pld.own = false; sm.commonWritingStream() << NewFlag << pld; writeToAll(i); } @@ -407,12 +407,12 @@ void ServerNetMeeting::accept() ExtData ed; bool willPlay; for (uint k=1; k<players.count(); k++) { - willPlay = FALSE; + willPlay = false; if ( players[k]==Accepted ) { // client with lines wl->widget(k-1)->data(ed); if ( ed.type==MeetingCheckBox::Ready ) { - willPlay = TRUE; + willPlay = true; RemoteHostData *r = new RemoteHostData; r->socket = sm[0]; r->bds = ed.bds; @@ -449,7 +449,7 @@ void ServerNetMeeting::optionsChanged() ClientNetMeeting::ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *option, TQWidget *parent, const char * name) -: NetMeeting(id, rhd.socket, option, FALSE, parent, name), bds(rhd.bds) +: NetMeeting(id, rhd.socket, option, false, parent, name), bds(rhd.bds) { connect(sm[0]->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(readNotifier(int))); @@ -499,7 +499,7 @@ void ClientNetMeeting::newFlag(uint) } else { MeetingLineData pld; sm[0]->readingStream() >> pld; - appendLine(pld, FALSE); + appendLine(pld, false); } CHECK_READ(0); } diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h index 4d689b60..ca40df56 100644 --- a/libksirtet/lib/mp_board.h +++ b/libksirtet/lib/mp_board.h @@ -19,9 +19,9 @@ class MPBoard : public TQWidget /** * This method is called once at the board creation. - * @param AI is TRUE if the player is not human. - * @param multiplayers is TRUE if the game is not a single player game. - * @param first is TRUE if this board is the first local one. + * @param AI is true if the player is not human. + * @param multiplayers is true if the game is not a single player game. + * @param first is true if this board is the first local one. */ virtual void init(bool AI, bool multiplayers, bool server, bool first, const TQString &name) = 0; diff --git a/libksirtet/lib/mp_interface.cpp b/libksirtet/lib/mp_interface.cpp index a18b3d0b..40788c0d 100644 --- a/libksirtet/lib/mp_interface.cpp +++ b/libksirtet/lib/mp_interface.cpp @@ -64,7 +64,7 @@ void MPInterface::dialog() // net meeting TQPtrList<RemoteHostData> rhd; - rhd.setAutoDelete(TRUE); + rhd.setAutoDelete(true); if (cd.network) { cId id(kapp->name(), gameInfo.gameId); MPOptionWidget *ow = newOptionWidget(); @@ -110,8 +110,8 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) : i18n("AI %1").arg(i-nbHumans+1)); cd.rhd.bds += bd; } - cd.server = TRUE; - cd.network = FALSE; + cd.server = true; + cd.network = false; Q_ASSERT( (nbHumans+nbAIs)<=gameInfo.maxNbLocalPlayers ); Q_ASSERT( gameInfo.AIAllowed || nbAIs==0 ); @@ -255,7 +255,7 @@ void MPInterface::hostDisconnected(uint, const TQString &msg) errorBox(msg, TQString(), this); if ( !disconnected ) { // to avoid multiple calls - disconnected = TRUE; + disconnected = true; // the zero timer is used to be outside the "internal" class TQTimer::singleShot(0, this, TQ_SLOT(singleHumanSlot())); } @@ -263,7 +263,7 @@ void MPInterface::hostDisconnected(uint, const TQString &msg) void MPInterface::singleHumanSlot() { - disconnected = FALSE; + disconnected = false; singleHuman(); } diff --git a/libksirtet/lib/mp_simple_board.cpp b/libksirtet/lib/mp_simple_board.cpp index c0828f1e..a7e7ab64 100644 --- a/libksirtet/lib/mp_simple_board.cpp +++ b/libksirtet/lib/mp_simple_board.cpp @@ -49,19 +49,19 @@ void MPSimpleBoard::pauseFlag() void MPSimpleBoard::gameOverFlag() { Q_ASSERT( BS_Play ); - _stop(TRUE); + _stop(true); state = BS_Stop; } void MPSimpleBoard::stopFlag() { - _stop(FALSE); + _stop(false); state = BS_Standby; } void MPSimpleBoard::_stop(bool gameover) { - if ( state==BS_Pause ) _pauseFlag(FALSE); + if ( state==BS_Pause ) _pauseFlag(false); emit enableKeys(false); _stopFlag(gameover); } diff --git a/libksirtet/lib/mp_simple_interface.cpp b/libksirtet/lib/mp_simple_interface.cpp index 004f1a78..831d9daa 100644 --- a/libksirtet/lib/mp_simple_interface.cpp +++ b/libksirtet/lib/mp_simple_interface.cpp @@ -21,7 +21,7 @@ void MPSimpleInterface::init() { if ( server() ) { state = SS_Standby; - first_init = TRUE; + first_init = true; } _init(); } @@ -90,8 +90,8 @@ void MPSimpleInterface::treatData() case SS_Pause: break; case SS_Stop: treatStop(); break; case SS_Standby: break; - case SS_PauseAsked: treatPause(TRUE); break; - case SS_UnpauseAsked: treatPause(FALSE); break; + case SS_PauseAsked: treatPause(true); break; + case SS_UnpauseAsked: treatPause(false); break; } } @@ -101,7 +101,7 @@ void MPSimpleInterface::treatInit() if (first_init) { _firstInit(); - first_init = FALSE; + first_init = false; } IO_Flag f(IO_Flag::Init); diff --git a/libksirtet/lib/pline.cpp b/libksirtet/lib/pline.cpp index fd2d9200..587f1f2f 100644 --- a/libksirtet/lib/pline.cpp +++ b/libksirtet/lib/pline.cpp @@ -20,7 +20,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, /* TriCheckBox */ tcb = new MeetingCheckBox(MeetingCheckBox::Ready, isOwner, serverIsReader, this); - if ( !XOR(isOwner, serverIsReader) ) tcb->setEnabled(FALSE); + if ( !XOR(isOwner, serverIsReader) ) tcb->setEnabled(false); else connect(tcb, TQ_SIGNAL(changed(int)), TQ_SLOT(_typeChanged(int))); hbl->addWidget(tcb); @@ -31,7 +31,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, lname->setLineWidth(2); lname->setMidLineWidth(3); TQFont f = lname->font(); - f.setBold(TRUE); + f.setBold(true); lname->setFont(f); lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH, lname->sizeHint().height()); @@ -131,7 +131,7 @@ void PlayerLine::setSlot() GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name) : TQWidget(parent, name), vbl(this, interval) { - widgets.setAutoDelete(TRUE); + widgets.setAutoDelete(true); } void GWidgetList::append(TQWidget *wi) diff --git a/libksirtet/lib/smanager.h b/libksirtet/lib/smanager.h index 59dd0edb..3c050a6c 100644 --- a/libksirtet/lib/smanager.h +++ b/libksirtet/lib/smanager.h @@ -57,10 +57,10 @@ class SocketManager */ void remove(uint i, bool deleteSocket); - /** @return TRUE if it is possible to write to all the writeable sockets. */ + /** @return true if it is possible to write to all the writeable sockets. */ bool canWriteAll(uint sec = 0, uint usec = 0); - /** @return TRUE if it is possible to write to the specified socket. */ + /** @return true if it is possible to write to the specified socket. */ bool canWrite(uint i, uint sec = 0, uint usec = 0); Stream &commonWritingStream() { return writing; } diff --git a/libksirtet/lib/socket.cpp b/libksirtet/lib/socket.cpp index 6defc94b..0298645c 100644 --- a/libksirtet/lib/socket.cpp +++ b/libksirtet/lib/socket.cpp @@ -28,7 +28,7 @@ Socket::Socket(KExtendedSocket *s, bool createNotifier, if (createNotifier) { _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read, parent, name); - _notifier->setEnabled(FALSE); + _notifier->setEnabled(false); } } diff --git a/libksirtet/lib/socket.h b/libksirtet/lib/socket.h index 01dac726..f6e3f3be 100644 --- a/libksirtet/lib/socket.h +++ b/libksirtet/lib/socket.h @@ -11,7 +11,7 @@ class Socket { public: - Socket(KExtendedSocket *, bool createNotifier = FALSE, + Socket(KExtendedSocket *, bool createNotifier = false, TQObject *parent = 0, const char *name = 0); /** close the socket */ @@ -33,7 +33,7 @@ class Socket /** * Write data contained in the writing stream to the socket. * It clears the stream. - * @return TRUE if all was written without error. + * @return true if all was written without error. */ bool write(); bool write(const TQByteArray &a); diff --git a/libksirtet/lib/wizard.cpp b/libksirtet/lib/wizard.cpp index 8618d36d..411e2e71 100644 --- a/libksirtet/lib/wizard.cpp +++ b/libksirtet/lib/wizard.cpp @@ -33,7 +33,7 @@ MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd, TQWidget *parent, const char *name) -: KWizard(parent, name, TRUE), cd(_cd) +: KWizard(parent, name, true), cd(_cd) { // setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED type = Local; @@ -70,7 +70,7 @@ void MPWizard::setupTypePage() eport->setRange(MIN_USER_PORT, MAX_USER_PORT, 1, false); addPage(typePage, i18n("Choose Game Type")); - setHelpEnabled(typePage, FALSE); + setHelpEnabled(typePage, false); typeChanged(type); } @@ -115,7 +115,7 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) // connect(keys, TQ_SIGNAL(clicked()), TQ_SLOT(configureKeysSlot())); addPage(localPage, i18n("Local Player's Settings")); - setHelpEnabled(localPage, FALSE); + setHelpEnabled(localPage, false); lineTypeChanged(0); } @@ -148,10 +148,10 @@ void MPWizard::typeChanged(int t) void MPWizard::lineTypeChanged(int) { - bool b = FALSE; + bool b = false; for (uint i=0; i<wl->size(); i++) if ( wl->widget(i)->type()==PlayerComboBox::Human ) { - b = TRUE; + b = true; break; } // keys->setEnabled(b); @@ -216,7 +216,7 @@ void MPWizard::accept() void MPWizard::showPage(TQWidget *page) { - if ( page==localPage ) setFinishEnabled(localPage, TRUE); + if ( page==localPage ) setFinishEnabled(localPage, true); KWizard::showPage(page); } |