diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /kbackgammon/engines/fibs/kplayerlist.cpp | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip |
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbackgammon/engines/fibs/kplayerlist.cpp')
-rw-r--r-- | kbackgammon/engines/fibs/kplayerlist.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp index 06b724e5..a928de7e 100644 --- a/kbackgammon/engines/fibs/kplayerlist.cpp +++ b/kbackgammon/engines/fibs/kplayerlist.cpp @@ -79,7 +79,7 @@ public: /* * Constructor */ - KFibsPlayerListLVI(KFibsPlayerList *parent) : KListViewItem(parent) { _plist = parent; } + KFibsPlayerListLVI(KFibsPlayerList *tqparent) : KListViewItem(tqparent) { _plist = tqparent; } /* * Destructor @@ -101,7 +101,7 @@ public: case KFibsPlayerList::Watches: case KFibsPlayerList::Client: case KFibsPlayerList::Email: - case KFibsPlayerList::Status: + case KFibsPlayerList::tqStatus: case KFibsPlayerList::Host: s = s.lower(); break; @@ -175,7 +175,7 @@ public: /* * Short abbreviations for Blind, Ready, and Away. */ - TQString mAbrv[KFibsPlayerList::MaxStatus]; + TQString mAbrv[KFibsPlayerList::MaxtqStatus]; /* * Name of the last selected player - for internal purposes @@ -200,8 +200,8 @@ public: /* * Construct the playerlist and do some initial setup */ -KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) - : KListView(parent, name) +KFibsPlayerList::KFibsPlayerList(TQWidget *tqparent, const char *name) + : KListView(tqparent, name) { d = new KFibsPlayerListPrivate(); KActionCollection* actions = new KActionCollection(this); @@ -218,7 +218,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->name = i18n("Player"); d->mCol[Opponent]->name = i18n("Opponent"); d->mCol[Watches]->name = i18n("Watches"); - d->mCol[Status]->name = i18n("Status"); + d->mCol[tqStatus]->name = i18n("tqStatus"); d->mCol[Rating]->name = i18n("Rating"); d->mCol[Experience]->name = i18n("Exp."); d->mCol[Idle]->name = i18n("Idle"); @@ -231,7 +231,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->key = "player"; d->mCol[Opponent]->key = "opponent"; d->mCol[Watches]->key = "watches"; - d->mCol[Status]->key = "status"; + d->mCol[tqStatus]->key = "status"; d->mCol[Rating]->key = "rating"; d->mCol[Experience]->key = "experience"; d->mCol[Idle]->key = "idle"; @@ -246,7 +246,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mAbrv[Away ] = i18n("abreviate away", "A"); d->mAbrv[Ready] = i18n("abreviate ready", "R"); - d->mName = TQString::null; + d->mName = TQString(); d->mWatch = false; @@ -289,41 +289,41 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mAct[KFibsPlayerListPrivate::Info] = new KAction(i18n("Info"), TQIconSet(kapp->iconLoader()->loadIcon ("help.xpm", KIcon::Small)), - 0, this, TQT_SLOT(slotInfo()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotInfo()), actions); d->mAct[KFibsPlayerListPrivate::Talk] = new KAction(i18n("Talk"), TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-chat.png", KIcon::Small)), - 0, this, TQT_SLOT(slotTalk()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotTalk()), actions); - d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, TQT_SLOT(slotLook()), actions); - d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, TQT_SLOT(slotWatch()), actions); - d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, TQT_SLOT(slotUnwatch()),actions); - d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, TQT_SLOT(slotBlind()), actions); - d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, TQT_SLOT(slotUpdate()), actions); + d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotLook()), actions); + d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotWatch()), actions); + d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUnwatch()),actions); + d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBlind()), actions); + d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUpdate()), actions); - d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, TQT_SLOT(slotReload()), actions); - d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, TQT_SLOT(slotMail()), actions); - d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions); + d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(slotReload()), actions); + d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(TQT_TQOBJECT(this), TQT_SLOT(slotMail()), actions); + d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(hide()), actions); - d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteD()), actions); - d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite1()), actions); - d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite2()), actions); - d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite3()), actions); - d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite4()), actions); - d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite5()), actions); - d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite6()), actions); - d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite7()), actions); - d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteU()), actions); - d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteR()), actions); /* @@ -469,7 +469,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) gl = new TQGridLayout(gbl, LVEnd, 2, 20); gl->addWidget(lb, 0, 0); - // two column layout.... + // two column tqlayout.... for (i = 1; i < LVEnd/2; i++) { gl->addWidget(d->mCol[2*i-1]->cb, i, 0); gl->addWidget(d->mCol[2*i ]->cb, i, 1); @@ -483,7 +483,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) */ nb->addTab(w, i18n("&Playerlist")); - connect(nb, TQT_SIGNAL(applyButtonPressed()), this, TQT_SLOT(setupOk())); + connect(nb, TQT_SIGNAL(applyButtonPressed()), TQT_TQOBJECT(this), TQT_SLOT(setupOk())); } /* @@ -567,14 +567,14 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo /* * Get the name of the selected player */ - d->mUser = (i ? i->text(Player) : TQString::null); + d->mUser = (i ? i->text(Player) : TQString()); - d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).arg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).tqarg(d->mUser)); d->mAct[KFibsPlayerListPrivate::Info ]->setEnabled(i); d->mAct[KFibsPlayerListPrivate::Talk ]->setEnabled(i); @@ -587,15 +587,15 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo d->mAct[KFibsPlayerListPrivate::Unwatch]->setEnabled(d->mWatch); d->mPm[0]->setItemEnabled(d->mInID, i && d->mName != d->mUser); - d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").arg(d->mUser)); + d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").tqarg(d->mUser)); - d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString::null); + d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString()); d->mAct[KFibsPlayerListPrivate::Mail]->setEnabled(!d->mMail.isEmpty()); - if (i && d->mCol[Status]->show) + if (i && d->mCol[tqStatus]->show) d->mAct[KFibsPlayerListPrivate::BlindAct]->setText - ((i->text(d->mCol[Status]->index).contains(d->mAbrv[Blind])) ? - i18n("Unblind %1").arg(d->mUser) : i18n("Blind %1").arg(d->mUser)); + ((i->text(d->mCol[tqStatus]->index).tqcontains(d->mAbrv[Blind])) ? + i18n("Unblind %1").tqarg(d->mUser) : i18n("Blind %1").tqarg(d->mUser)); else d->mAct[KFibsPlayerListPrivate::BlindAct]->setText(i18n("Blind")); @@ -657,7 +657,7 @@ void KFibsPlayerList::slotLook() */ void KFibsPlayerList::slotMail() { - kapp->invokeMailer(d->mMail, TQString::null); + kapp->invokeMailer(d->mMail, TQString()); } /* @@ -721,7 +721,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) TQDateTime fromEpoch; TQString str_entry[LVEnd], tmp; - entry[Status][0] = '\0'; + entry[tqStatus][0] = '\0'; // the line comes from FIBS and is 7 bit ASCII sscanf(line.latin1(), "%99s %99s %99s %1s %1s %99s %99s %99s %99s %99s %99s %99s", entry[Player], entry[Opponent], @@ -738,9 +738,9 @@ void KFibsPlayerList::changePlayer(const TQString &line) if ((str_entry[j] = entry[j]) == "-") str_entry[j] = ""; } - str_entry[Status].replace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); - str_entry[Status].replace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); - str_entry[Status].replace(Blind, 1, "-"); + str_entry[tqStatus].tqreplace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); + str_entry[tqStatus].tqreplace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); + str_entry[tqStatus].tqreplace(Blind, 1, "-"); // disable drawing until the end of update setUpdatesEnabled(false); @@ -758,9 +758,9 @@ void KFibsPlayerList::changePlayer(const TQString &line) i = new KFibsPlayerListLVI(this); // count the KFibs and KBackgammon clients - if (str_entry[Client].contains("KFibs")) + if (str_entry[Client].tqcontains("KFibs")) d->mCount[0]++; - else if (str_entry[Client].contains(PROG_NAME)) + else if (str_entry[Client].tqcontains(PROG_NAME)) d->mCount[1]++; // new entry requires an update to the player count @@ -771,7 +771,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) found: // getting here means the player is in the list - update private status - str_entry[Status].replace(Blind,1,i->text(Status).contains + str_entry[tqStatus].tqreplace(Blind,1,i->text(tqStatus).tqcontains (d->mAbrv[Blind]) ? d->mAbrv[Blind] : "-"); update: @@ -794,9 +794,9 @@ void KFibsPlayerList::deletePlayer(const TQString &player) TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(0) == player) { - if (it.current()->text(Client).contains(PROG_NAME)) + if (it.current()->text(Client).tqcontains(PROG_NAME)) --d->mCount[1]; - else if (it.current()->text(Client).contains("KFibs")) + else if (it.current()->text(Client).tqcontains("KFibs")) --d->mCount[0]; delete it.current(); updateCaption(); @@ -808,7 +808,7 @@ void KFibsPlayerList::deletePlayer(const TQString &player) /* * Set/Unset the status stat in the corresponding column of the list */ -void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag) +void KFibsPlayerList::changePlayertqStatus(const TQString &player, int stat, bool flag) { TQListViewItem *i = 0; @@ -827,7 +827,7 @@ void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool /* * Update the status flag */ - i->setText(Status, i->text(Status).replace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); + i->setText(tqStatus, i->text(tqStatus).tqreplace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); } @@ -886,7 +886,7 @@ void KFibsPlayerList::setName(const TQString &name) */ void KFibsPlayerList::updateCaption() { - setCaption(i18n("Player List - %1 - %2/%3").arg(childCount()).arg(d->mCount[0]).arg(d->mCount[1])); + setCaption(i18n("Player List - %1 - %2/%3").tqarg(childCount()).tqarg(d->mCount[0]).tqarg(d->mCount[1])); } /* |