summaryrefslogtreecommitdiffstats
path: root/libkdegames
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /libkdegames
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz
tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdegames')
-rw-r--r--libkdegames/highscore/kconfigrawbackend.cpp4
-rw-r--r--libkdegames/highscore/kconfigrawbackend.h4
-rw-r--r--libkdegames/highscore/kexthighscore.cpp28
-rw-r--r--libkdegames/highscore/kexthighscore.h18
-rw-r--r--libkdegames/highscore/kexthighscore_gui.cpp190
-rw-r--r--libkdegames/highscore/kexthighscore_gui.h70
-rw-r--r--libkdegames/highscore/kexthighscore_internal.cpp176
-rw-r--r--libkdegames/highscore/kexthighscore_internal.h104
-rw-r--r--libkdegames/highscore/kexthighscore_item.cpp70
-rw-r--r--libkdegames/highscore/kexthighscore_item.h62
-rw-r--r--libkdegames/highscore/kexthighscore_tab.cpp98
-rw-r--r--libkdegames/highscore/kexthighscore_tab.h24
-rw-r--r--libkdegames/highscore/khighscore.cpp60
-rw-r--r--libkdegames/highscore/khighscore.h48
-rw-r--r--libkdegames/highscore/kscoredialog.cpp110
-rw-r--r--libkdegames/highscore/kscoredialog.h20
-rw-r--r--libkdegames/kcanvasrootpixmap.cpp10
-rw-r--r--libkdegames/kcanvasrootpixmap.h12
-rw-r--r--libkdegames/kcarddialog.cpp322
-rw-r--r--libkdegames/kcarddialog.h48
-rw-r--r--libkdegames/kchat.cpp20
-rw-r--r--libkdegames/kchat.h20
-rw-r--r--libkdegames/kchatbase.cpp166
-rw-r--r--libkdegames/kchatbase.h90
-rw-r--r--libkdegames/kchatdialog.cpp94
-rw-r--r--libkdegames/kchatdialog.h20
-rw-r--r--libkdegames/kgame/dialogs/kgameconnectdialog.cpp98
-rw-r--r--libkdegames/kgame/dialogs/kgameconnectdialog.h30
-rw-r--r--libkdegames/kgame/dialogs/kgamedebugdialog.cpp218
-rw-r--r--libkdegames/kgame/dialogs/kgamedebugdialog.h10
-rw-r--r--libkdegames/kgame/dialogs/kgamedialog.cpp50
-rw-r--r--libkdegames/kgame/dialogs/kgamedialog.h26
-rw-r--r--libkdegames/kgame/dialogs/kgamedialogconfig.cpp190
-rw-r--r--libkdegames/kgame/dialogs/kgamedialogconfig.h32
-rw-r--r--libkdegames/kgame/dialogs/kgameerrordialog.cpp40
-rw-r--r--libkdegames/kgame/dialogs/kgameerrordialog.h12
-rw-r--r--libkdegames/kgame/kgame.cpp122
-rw-r--r--libkdegames/kgame/kgame.h68
-rw-r--r--libkdegames/kgame/kgamechat.cpp64
-rw-r--r--libkdegames/kgame/kgamechat.h22
-rw-r--r--libkdegames/kgame/kgameerror.cpp20
-rw-r--r--libkdegames/kgame/kgameerror.h12
-rw-r--r--libkdegames/kgame/kgameio.cpp116
-rw-r--r--libkdegames/kgame/kgameio.h76
-rw-r--r--libkdegames/kgame/kgamemessage.cpp16
-rw-r--r--libkdegames/kgame/kgamemessage.h18
-rw-r--r--libkdegames/kgame/kgamenetwork.cpp98
-rw-r--r--libkdegames/kgame/kgamenetwork.h32
-rw-r--r--libkdegames/kgame/kgameprocess.cpp36
-rw-r--r--libkdegames/kgame/kgameprocess.h50
-rw-r--r--libkdegames/kgame/kgameproperty.cpp26
-rw-r--r--libkdegames/kgame/kgameproperty.h44
-rw-r--r--libkdegames/kgame/kgamepropertyarray.h72
-rw-r--r--libkdegames/kgame/kgamepropertyhandler.cpp70
-rw-r--r--libkdegames/kgame/kgamepropertyhandler.h42
-rw-r--r--libkdegames/kgame/kgamepropertylist.h54
-rw-r--r--libkdegames/kgame/kgamesequence.cpp2
-rw-r--r--libkdegames/kgame/kgamesequence.h2
-rw-r--r--libkdegames/kgame/kmessageclient.cpp74
-rw-r--r--libkdegames/kgame/kmessageclient.h46
-rw-r--r--libkdegames/kgame/kmessageio.cpp82
-rw-r--r--libkdegames/kgame/kmessageio.h70
-rw-r--r--libkdegames/kgame/kmessageserver.cpp110
-rw-r--r--libkdegames/kgame/kmessageserver.h68
-rw-r--r--libkdegames/kgame/kplayer.cpp38
-rw-r--r--libkdegames/kgame/kplayer.h30
-rw-r--r--libkdegames/kgamelcd.cpp94
-rw-r--r--libkdegames/kgamelcd.h76
-rw-r--r--libkdegames/kgamemisc.cpp6
-rw-r--r--libkdegames/kgamemisc.h4
-rw-r--r--libkdegames/kgameprogress.cpp100
-rw-r--r--libkdegames/kgameprogress.h58
-rw-r--r--libkdegames/kgrid2d.h18
-rw-r--r--libkdegames/kstdgameaction.cpp50
-rw-r--r--libkdegames/kstdgameaction.h50
75 files changed, 2315 insertions, 2315 deletions
diff --git a/libkdegames/highscore/kconfigrawbackend.cpp b/libkdegames/highscore/kconfigrawbackend.cpp
index a379ba23..29ffa845 100644
--- a/libkdegames/highscore/kconfigrawbackend.cpp
+++ b/libkdegames/highscore/kconfigrawbackend.cpp
@@ -21,11 +21,11 @@
#include "kconfigrawbackend.moc"
#include <unistd.h>
-#include <qfile.h>
+#include <tqfile.h>
KConfigRawBackEnd::KConfigRawBackEnd(KConfigBase *_config, int fd)
- : KConfigINIBackEnd(_config, QString::null, "config", false),
+ : KConfigINIBackEnd(_config, TQString::null, "config", false),
_fd(fd), _stream(0)
{
_file.open(IO_ReadOnly, _fd);
diff --git a/libkdegames/highscore/kconfigrawbackend.h b/libkdegames/highscore/kconfigrawbackend.h
index 4b780320..0c5fde03 100644
--- a/libkdegames/highscore/kconfigrawbackend.h
+++ b/libkdegames/highscore/kconfigrawbackend.h
@@ -20,7 +20,7 @@
#ifndef _KCONFIGRAWBACKEND_H
#define _KCONFIGRAWBACKEND_H
-#include <qfile.h>
+#include <tqfile.h>
#include <kconfigbackend.h>
#include <ksimpleconfig.h>
@@ -39,7 +39,7 @@ public:
private:
int _fd;
FILE *_stream;
- QFile _file;
+ TQFile _file;
class KConfigRawBackEndPrivate;
KConfigRawBackEndPrivate *d;
diff --git a/libkdegames/highscore/kexthighscore.cpp b/libkdegames/highscore/kexthighscore.cpp
index 0ad9b3af..585dafd4 100644
--- a/libkdegames/highscore/kexthighscore.cpp
+++ b/libkdegames/highscore/kexthighscore.cpp
@@ -19,7 +19,7 @@
#include "kexthighscore.h"
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kdebug.h>
@@ -44,7 +44,7 @@ void setGameType(uint type)
internal->setGameType(type);
}
-bool configure(QWidget *parent)
+bool configure(TQWidget *parent)
{
internal->checkFirst();
ConfigDialog *cd = new ConfigDialog(parent);
@@ -54,14 +54,14 @@ bool configure(QWidget *parent)
return saved;
}
-void show(QWidget *parent, int rank)
+void show(TQWidget *parent, int rank)
{
HighscoresDialog *hd = new HighscoresDialog(rank, parent);
hd->exec();
delete hd;
}
-void submitScore(const Score &score, QWidget *widget)
+void submitScore(const Score &score, TQWidget *widget)
{
int rank = internal->submitScore(score, widget,
internal->showMode!=Manager::NeverShow);
@@ -81,7 +81,7 @@ void submitScore(const Score &score, QWidget *widget)
}
}
-void show(QWidget *widget)
+void show(TQWidget *widget)
{
internal->checkFirst();
show(widget, -1);
@@ -145,7 +145,7 @@ void Manager::setShowDrawGamesStatistic(bool show)
internal->showDrawGames = show;
}
-void Manager::setWWHighscores(const KURL &url, const QString &version)
+void Manager::setWWHighscores(const KURL &url, const TQString &version)
{
Q_ASSERT( url.isValid() );
internal->serverURL = url;
@@ -157,7 +157,7 @@ void Manager::setWWHighscores(const KURL &url, const QString &version)
internal->version = version;
}
-void Manager::setScoreHistogram(const QMemArray<uint> &scores,
+void Manager::setScoreHistogram(const TQMemArray<uint> &scores,
ScoreTypeBound type)
{
Q_ASSERT( scores.size()>=2 );
@@ -238,7 +238,7 @@ void Manager::setScoreItem(uint worstScore, Item *item)
->item()->setDefaultValue(worstScore);
}
-void Manager::addScoreItem(const QString &name, Item *item)
+void Manager::addScoreItem(const TQString &name, Item *item)
{
internal->scoreInfos().addItem(name, item, true);
}
@@ -247,7 +247,7 @@ void Manager::setPlayerItem(PlayerItemType type, Item *item)
{
const Item *scoreItem = internal->scoreInfos().item("score")->item();
uint def = scoreItem->defaultValue().toUInt();
- QString name;
+ TQString name;
switch (type) {
case MeanScore:
name = "mean score";
@@ -261,7 +261,7 @@ void Manager::setPlayerItem(PlayerItemType type, Item *item)
internal->playerInfos().setItem(name, item);
}
-QString Manager::gameTypeLabel(uint gameType, LabelType type) const
+TQString Manager::gameTypeLabel(uint gameType, LabelType type) const
{
if ( gameType!=0 )
kdFatal(11002) << "You need to reimplement KExtHighscore::Manager for "
@@ -272,15 +272,15 @@ QString Manager::gameTypeLabel(uint gameType, LabelType type) const
case I18N: break;
case WW: return "normal";
}
- return QString::null;
+ return TQString::null;
}
-void Manager::addToQueryURL(KURL &url, const QString &item,
- const QString &content)
+void Manager::addToQueryURL(KURL &url, const TQString &item,
+ const TQString &content)
{
Q_ASSERT( !item.isEmpty() && url.queryItem(item).isNull() );
- QString query = url.query();
+ TQString query = url.query();
if ( !query.isEmpty() ) query += '&';
query += item + '=' + KURL::encode_string(content);
url.setQuery(query);
diff --git a/libkdegames/highscore/kexthighscore.h b/libkdegames/highscore/kexthighscore.h
index 2484f97b..6dac5ff7 100644
--- a/libkdegames/highscore/kexthighscore.h
+++ b/libkdegames/highscore/kexthighscore.h
@@ -51,19 +51,19 @@ KDE_EXPORT void setGameType(uint gameType);
* Configure the highscores.
* @return true if the configuration has been modified and saved
*/
-KDE_EXPORT bool configure(QWidget *parent);
+KDE_EXPORT bool configure(TQWidget *parent);
/**
* Show the highscores lists.
*/
-KDE_EXPORT void show(QWidget *parent);
+KDE_EXPORT void show(TQWidget *parent);
/**
* Submit a score. See @ref Manager for usage example.
*
* @param widget a widget used as parent for error message box.
*/
-KDE_EXPORT void submitScore(const Score &score, QWidget *widget);
+KDE_EXPORT void submitScore(const Score &score, TQWidget *widget);
/**
* @return the last score in the local list of highscores. The worst possible
@@ -160,7 +160,7 @@ class KDE_EXPORT Manager
* @param version the game version which is sent to the web server (it can
* be useful for backward compatibility on the server side).
*/
- void setWWHighscores(const KURL &url, const QString &version);
+ void setWWHighscores(const KURL &url, const TQString &version);
/**
* Set if the number of lost games should be track for the world-wide
@@ -211,7 +211,7 @@ class KDE_EXPORT Manager
*
* Note: should be called at construction time.
*/
- void setScoreHistogram(const QMemArray<uint> &scores, ScoreTypeBound type);
+ void setScoreHistogram(const TQMemArray<uint> &scores, ScoreTypeBound type);
/**
* Enumerate different conditions under which to show the
@@ -272,7 +272,7 @@ class KDE_EXPORT Manager
*
* Note : This method should be called at construction time.
*/
- void addScoreItem(const QString &name, Item *item);
+ void addScoreItem(const TQString &name, Item *item);
enum PlayerItemType { MeanScore, BestScore };
/**
@@ -307,7 +307,7 @@ class KDE_EXPORT Manager
* implementation works only for one game type : you need to reimplement
* this method if the number of game types is more than one.
*/
- virtual QString gameTypeLabel(uint gameType, LabelType type) const;
+ virtual TQString gameTypeLabel(uint gameType, LabelType type) const;
protected:
/**
@@ -352,8 +352,8 @@ class KDE_EXPORT Manager
* @param item the item name
* @param content the item content
*/
- static void addToQueryURL(KURL &url, const QString &item,
- const QString &content);
+ static void addToQueryURL(KURL &url, const TQString &item,
+ const TQString &content);
friend class ManagerPrivate;
diff --git a/libkdegames/highscore/kexthighscore_gui.cpp b/libkdegames/highscore/kexthighscore_gui.cpp
index 547a885c..3786f529 100644
--- a/libkdegames/highscore/kexthighscore_gui.cpp
+++ b/libkdegames/highscore/kexthighscore_gui.cpp
@@ -20,11 +20,11 @@
#include "kexthighscore_gui.h"
#include "kexthighscore_gui.moc"
-#include <qlayout.h>
-#include <qtextstream.h>
-#include <qheader.h>
-#include <qgrid.h>
-#include <qvgroupbox.h>
+#include <tqlayout.h>
+#include <tqtextstream.h>
+#include <tqheader.h>
+#include <tqgrid.h>
+#include <tqvgroupbox.h>
#include <kapplication.h>
#include <kmessagebox.h>
@@ -45,23 +45,23 @@ namespace KExtHighscore
{
//-----------------------------------------------------------------------------
-ShowItem::ShowItem(QListView *list, bool highlight)
+ShowItem::ShowItem(TQListView *list, bool highlight)
: KListViewItem(list), _highlight(highlight)
{}
-void ShowItem::paintCell(QPainter *p, const QColorGroup &cg,
+void ShowItem::paintCell(TQPainter *p, const TQColorGroup &cg,
int column, int width, int align)
{
- QColorGroup cgrp(cg);
- if (_highlight) cgrp.setColor(QColorGroup::Text, red);
+ TQColorGroup cgrp(cg);
+ if (_highlight) cgrp.setColor(TQColorGroup::Text, red);
KListViewItem::paintCell(p, cgrp, column, width, align);
}
//-----------------------------------------------------------------------------
-ScoresList::ScoresList(QWidget *parent)
+ScoresList::ScoresList(TQWidget *parent)
: KListView(parent)
{
- setSelectionMode(QListView::NoSelection);
+ setSelectionMode(TQListView::NoSelection);
setItemMargin(3);
setAllColumnsShowFocus(true);
setSorting(-1);
@@ -74,16 +74,16 @@ void ScoresList::addHeader(const ItemArray &items)
addLineItem(items, 0, 0);
}
-QListViewItem *ScoresList::addLine(const ItemArray &items,
+TQListViewItem *ScoresList::addLine(const ItemArray &items,
uint index, bool highlight)
{
- QListViewItem *item = new ShowItem(this, highlight);
+ TQListViewItem *item = new ShowItem(this, highlight);
addLineItem(items, index, item);
return item;
}
void ScoresList::addLineItem(const ItemArray &items,
- uint index, QListViewItem *line)
+ uint index, TQListViewItem *line)
{
uint k = 0;
for (uint i=0; i<items.size(); i++) {
@@ -99,11 +99,11 @@ void ScoresList::addLineItem(const ItemArray &items,
}
//-----------------------------------------------------------------------------
-HighscoresList::HighscoresList(QWidget *parent)
+HighscoresList::HighscoresList(TQWidget *parent)
: ScoresList(parent)
{}
-QString HighscoresList::itemText(const ItemContainer &item, uint row) const
+TQString HighscoresList::itemText(const ItemContainer &item, uint row) const
{
return item.pretty(row);
}
@@ -111,26 +111,26 @@ QString HighscoresList::itemText(const ItemContainer &item, uint row) const
void HighscoresList::load(const ItemArray &items, int highlight)
{
clear();
- QListViewItem *line = 0;
+ TQListViewItem *line = 0;
for (int j=items.nbEntries()-1; j>=0; j--) {
- QListViewItem *item = addLine(items, j, j==highlight);
+ TQListViewItem *item = addLine(items, j, j==highlight);
if ( j==highlight ) line = item;
}
if (line) ensureItemVisible(line);
}
//-----------------------------------------------------------------------------
-HighscoresWidget::HighscoresWidget(QWidget *parent)
- : QWidget(parent, "show_highscores_widget"),
+HighscoresWidget::HighscoresWidget(TQWidget *parent)
+ : TQWidget(parent, "show_highscores_widget"),
_scoresUrl(0), _playersUrl(0), _statsTab(0), _histoTab(0)
{
const ScoreInfos &s = internal->scoreInfos();
const PlayerInfos &p = internal->playerInfos();
- QVBoxLayout *vbox = new QVBoxLayout(this, KDialogBase::spacingHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(this, KDialogBase::spacingHint());
- _tw = new QTabWidget(this);
- connect(_tw, SIGNAL(currentChanged(QWidget *)), SLOT(tabChanged()));
+ _tw = new TQTabWidget(this);
+ connect(_tw, TQT_SIGNAL(currentChanged(TQWidget *)), TQT_SLOT(tabChanged()));
vbox->addWidget(_tw);
// scores tab
@@ -160,15 +160,15 @@ HighscoresWidget::HighscoresWidget(QWidget *parent)
KURL url = internal->queryURL(ManagerPrivate::Scores);
_scoresUrl = new KURLLabel(url.url(),
i18n("View world-wide highscores"), this);
- connect(_scoresUrl, SIGNAL(leftClickedURL(const QString &)),
- SLOT(showURL(const QString &)));
+ connect(_scoresUrl, TQT_SIGNAL(leftClickedURL(const TQString &)),
+ TQT_SLOT(showURL(const TQString &)));
vbox->addWidget(_scoresUrl);
url = internal->queryURL(ManagerPrivate::Players);
_playersUrl = new KURLLabel(url.url(),
i18n("View world-wide players"), this);
- connect(_playersUrl, SIGNAL(leftClickedURL(const QString &)),
- SLOT(showURL(const QString &)));
+ connect(_playersUrl, TQT_SIGNAL(leftClickedURL(const TQString &)),
+ TQT_SLOT(showURL(const TQString &)));
vbox->addWidget(_playersUrl);
}
}
@@ -179,7 +179,7 @@ void HighscoresWidget::changeTab(int i)
_tw->setCurrentPage(i);
}
-void HighscoresWidget::showURL(const QString &url) const
+void HighscoresWidget::showURL(const TQString &url) const
{
(void)new KRun(KURL(url));
}
@@ -197,7 +197,7 @@ void HighscoresWidget::load(int rank)
}
//-----------------------------------------------------------------------------
-HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
+HighscoresDialog::HighscoresDialog(int rank, TQWidget *parent)
: KDialogBase(internal->nbGameTypes()>1 ? TreeList : Plain,
i18n("Highscores"), Close|User1|User2, Close,
parent, "show_highscores", true, true,
@@ -208,25 +208,25 @@ HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
if ( internal->nbGameTypes()>1 ) {
for (uint i=0; i<internal->nbGameTypes(); i++) {
- QString title = internal->manager.gameTypeLabel(i, Manager::I18N);
- QString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
- QWidget *w = addVBoxPage(title, QString::null,
+ TQString title = internal->manager.gameTypeLabel(i, Manager::I18N);
+ TQString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
+ TQWidget *w = addVBoxPage(title, TQString::null,
BarIcon(icon, KIcon::SizeLarge));
if ( i==internal->gameType() ) createPage(w);
}
- connect(this, SIGNAL(aboutToShowPage(QWidget *)),
- SLOT(createPage(QWidget *)));
+ connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget *)),
+ TQT_SLOT(createPage(TQWidget *)));
showPage(internal->gameType());
} else {
- QVBoxLayout *vbox = new QVBoxLayout(plainPage());
+ TQVBoxLayout *vbox = new TQVBoxLayout(plainPage());
createPage(plainPage());
vbox->addWidget(_widgets[0]);
setMainWidget(_widgets[0]);
}
}
-void HighscoresDialog::createPage(QWidget *page)
+void HighscoresDialog::createPage(TQWidget *page)
{
internal->hsConfig().readCurrentConfig();
_current = page;
@@ -234,7 +234,7 @@ void HighscoresDialog::createPage(QWidget *page)
int i = (several ? pageIndex(page) : 0);
if ( _widgets[i]==0 ) {
_widgets[i] = new HighscoresWidget(page);
- connect(_widgets[i], SIGNAL(tabChanged(int)), SLOT(tabChanged(int)));
+ connect(_widgets[i], TQT_SIGNAL(tabChanged(int)), TQT_SLOT(tabChanged(int)));
}
uint type = internal->gameType();
if (several) internal->setGameType(i);
@@ -251,7 +251,7 @@ void HighscoresDialog::slotUser1()
void HighscoresDialog::slotUser2()
{
- KURL url = KFileDialog::getSaveURL(QString::null, QString::null, this);
+ KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this);
if ( url.isEmpty() ) return;
if ( KIO::NetAccess::exists(url, true, this) ) {
KGuiItem gi = KStdGuiItem::save();
@@ -270,7 +270,7 @@ void HighscoresDialog::slotUser2()
//-----------------------------------------------------------------------------
LastMultipleScoresList::LastMultipleScoresList(
- const QValueVector<Score> &scores, QWidget *parent)
+ const TQValueVector<Score> &scores, TQWidget *parent)
: ScoresList(parent), _scores(scores)
{
const ScoreInfos &s = internal->scoreInfos();
@@ -279,7 +279,7 @@ LastMultipleScoresList::LastMultipleScoresList(
}
void LastMultipleScoresList::addLineItem(const ItemArray &si,
- uint index, QListViewItem *line)
+ uint index, TQListViewItem *line)
{
uint k = 1; // skip "id"
for (uint i=0; i<si.size()-2; i++) {
@@ -294,20 +294,20 @@ void LastMultipleScoresList::addLineItem(const ItemArray &si,
}
}
-QString LastMultipleScoresList::itemText(const ItemContainer &item,
+TQString LastMultipleScoresList::itemText(const ItemContainer &item,
uint row) const
{
- QString name = item.name();
+ TQString name = item.name();
if ( name=="rank" )
- return (_scores[row].type()==Won ? i18n("Winner") : QString::null);
- QVariant v = _scores[row].data(name);
+ return (_scores[row].type()==Won ? i18n("Winner") : TQString::null);
+ TQVariant v = _scores[row].data(name);
if ( name=="name" ) return v.toString();
return item.item()->pretty(row, v);
}
//-----------------------------------------------------------------------------
TotalMultipleScoresList::TotalMultipleScoresList(
- const QValueVector<Score> &scores, QWidget *parent)
+ const TQValueVector<Score> &scores, TQWidget *parent)
: ScoresList(parent), _scores(scores)
{
const ScoreInfos &s = internal->scoreInfos();
@@ -316,7 +316,7 @@ TotalMultipleScoresList::TotalMultipleScoresList(
}
void TotalMultipleScoresList::addLineItem(const ItemArray &si,
- uint index, QListViewItem *line)
+ uint index, TQListViewItem *line)
{
const PlayerInfos &pi = internal->playerInfos();
uint k = 1; // skip "id"
@@ -330,7 +330,7 @@ void TotalMultipleScoresList::addLineItem(const ItemArray &si,
}
if (line) line->setText(i, itemText(*container, index));
else {
- QString label =
+ TQString label =
(i==2 ? i18n("Won Games") : container->item()->label());
addColumn(label);
setColumnAlignment(i, container->item()->alignment());
@@ -338,90 +338,90 @@ void TotalMultipleScoresList::addLineItem(const ItemArray &si,
}
}
-QString TotalMultipleScoresList::itemText(const ItemContainer &item,
+TQString TotalMultipleScoresList::itemText(const ItemContainer &item,
uint row) const
{
- QString name = item.name();
- if ( name=="rank" ) return QString::number(_scores.size()-row);
+ TQString name = item.name();
+ if ( name=="rank" ) return TQString::number(_scores.size()-row);
if ( name=="nb games" )
- return QString::number( _scores[row].data("nb won games").toUInt() );
- QVariant v = _scores[row].data(name);
+ return TQString::number( _scores[row].data("nb won games").toUInt() );
+ TQVariant v = _scores[row].data(name);
if ( name=="name" ) return v.toString();
return item.item()->pretty(row, v);
}
//-----------------------------------------------------------------------------
-ConfigDialog::ConfigDialog(QWidget *parent)
+ConfigDialog::ConfigDialog(TQWidget *parent)
: KDialogBase(Swallow, i18n("Configure Highscores"),
Ok|Apply|Cancel, Cancel,
parent, "configure_highscores", true, true),
_saved(false), _WWHEnabled(0)
{
- QWidget *page = 0;
- QTabWidget *tab = 0;
+ TQWidget *page = 0;
+ TQTabWidget *tab = 0;
if ( internal->isWWHSAvailable() ) {
- tab = new QTabWidget(this);
+ tab = new TQTabWidget(this);
setMainWidget(tab);
- page = new QWidget(tab);
+ page = new TQWidget(tab);
tab->addTab(page, i18n("Main"));
} else {
- page = new QWidget(this);
+ page = new TQWidget(this);
setMainWidget(page);
}
- QGridLayout *pageTop =
- new QGridLayout(page, 2, 2, spacingHint(), spacingHint());
+ TQGridLayout *pageTop =
+ new TQGridLayout(page, 2, 2, spacingHint(), spacingHint());
- QLabel *label = new QLabel(i18n("Nickname:"), page);
+ TQLabel *label = new TQLabel(i18n("Nickname:"), page);
pageTop->addWidget(label, 0, 0);
- _nickname = new QLineEdit(page);
- connect(_nickname, SIGNAL(textChanged(const QString &)),
- SLOT(modifiedSlot()));
- connect(_nickname, SIGNAL(textChanged(const QString &)),
- SLOT(nickNameChanged(const QString &)));
+ _nickname = new TQLineEdit(page);
+ connect(_nickname, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(modifiedSlot()));
+ connect(_nickname, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(nickNameChanged(const TQString &)));
_nickname->setMaxLength(16);
pageTop->addWidget(_nickname, 0, 1);
- label = new QLabel(i18n("Comment:"), page);
+ label = new TQLabel(i18n("Comment:"), page);
pageTop->addWidget(label, 1, 0);
- _comment = new QLineEdit(page);
- connect(_comment, SIGNAL(textChanged(const QString &)),
- SLOT(modifiedSlot()));
+ _comment = new TQLineEdit(page);
+ connect(_comment, TQT_SIGNAL(textChanged(const TQString &)),
+ TQT_SLOT(modifiedSlot()));
_comment->setMaxLength(50);
pageTop->addWidget(_comment, 1, 1);
if (tab) {
_WWHEnabled
- = new QCheckBox(i18n("World-wide highscores enabled"), page);
- connect(_WWHEnabled, SIGNAL(toggled(bool)),
- SLOT(modifiedSlot()));
+ = new TQCheckBox(i18n("World-wide highscores enabled"), page);
+ connect(_WWHEnabled, TQT_SIGNAL(toggled(bool)),
+ TQT_SLOT(modifiedSlot()));
pageTop->addMultiCellWidget(_WWHEnabled, 2, 2, 0, 1);
// advanced tab
- QWidget *page = new QWidget(tab);
+ TQWidget *page = new TQWidget(tab);
tab->addTab(page, i18n("Advanced"));
- QVBoxLayout *pageTop =
- new QVBoxLayout(page, spacingHint(), spacingHint());
+ TQVBoxLayout *pageTop =
+ new TQVBoxLayout(page, spacingHint(), spacingHint());
- QVGroupBox *group = new QVGroupBox(i18n("Registration Data"), page);
+ TQVGroupBox *group = new TQVGroupBox(i18n("Registration Data"), page);
pageTop->addWidget(group);
- QGrid *grid = new QGrid(2, group);
+ TQGrid *grid = new TQGrid(2, group);
grid->setSpacing(spacingHint());
- label = new QLabel(i18n("Nickname:"), grid);
+ label = new TQLabel(i18n("Nickname:"), grid);
_registeredName = new KLineEdit(grid);
_registeredName->setReadOnly(true);
- label = new QLabel(i18n("Key:"), grid);
+ label = new TQLabel(i18n("Key:"), grid);
_key = new KLineEdit(grid);
_key->setReadOnly(true);
KGuiItem gi = KStdGuiItem::clear();
gi.setText(i18n("Remove"));
_removeButton = new KPushButton(gi, grid);
- connect(_removeButton, SIGNAL(clicked()), SLOT(removeSlot()));
+ connect(_removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeSlot()));
}
load();
@@ -429,7 +429,7 @@ ConfigDialog::ConfigDialog(QWidget *parent)
enableButtonApply(false);
}
-void ConfigDialog::nickNameChanged(const QString &text)
+void ConfigDialog::nickNameChanged(const TQString &text)
{
enableButtonOK( !text.isEmpty() );
}
@@ -456,7 +456,7 @@ void ConfigDialog::removeSlot()
i18n("This will permanently remove your "
"registration key. You will not be able to use "
"the currently registered nickname anymore."),
- QString::null, gi);
+ TQString::null, gi);
if ( res==KMessageBox::Continue ) {
internal->playerInfos().removeKey();
_registeredName->clear();
@@ -471,7 +471,7 @@ void ConfigDialog::load()
{
internal->hsConfig().readCurrentConfig();
const PlayerInfos &infos = internal->playerInfos();
- _nickname->setText(infos.isAnonymous() ? QString::null : infos.name());
+ _nickname->setText(infos.isAnonymous() ? TQString::null : infos.name());
_comment->setText(infos.comment());
if (_WWHEnabled) {
_WWHEnabled->setChecked(infos.isWWEnabled());
@@ -491,7 +491,7 @@ bool ConfigDialog::save()
// do not bother the user with "nickname empty" if he has not
// messed with nickname settings ...
- QString newName = _nickname->text();
+ TQString newName = _nickname->text();
if ( newName.isEmpty() && !internal->playerInfos().isAnonymous()
&& !enabled ) return true;
@@ -516,28 +516,28 @@ bool ConfigDialog::save()
}
//-----------------------------------------------------------------------------
-AskNameDialog::AskNameDialog(QWidget *parent)
+AskNameDialog::AskNameDialog(TQWidget *parent)
: KDialogBase(Plain, i18n("Enter Your Nickname"), Ok | Cancel, Ok,
parent, "ask_name_dialog")
{
internal->hsConfig().readCurrentConfig();
- QVBoxLayout *top =
- new QVBoxLayout(plainPage(), marginHint(), spacingHint());
- QLabel *label =
- new QLabel(i18n("Congratulations, you have won!"), plainPage());
+ TQVBoxLayout *top =
+ new TQVBoxLayout(plainPage(), marginHint(), spacingHint());
+ TQLabel *label =
+ new TQLabel(i18n("Congratulations, you have won!"), plainPage());
top->addWidget(label);
- QHBoxLayout *hbox = new QHBoxLayout(top);
- label = new QLabel(i18n("Enter your nickname:"), plainPage());
+ TQHBoxLayout *hbox = new TQHBoxLayout(top);
+ label = new TQLabel(i18n("Enter your nickname:"), plainPage());
hbox->addWidget(label);
- _edit = new QLineEdit(plainPage());
+ _edit = new TQLineEdit(plainPage());
_edit->setFocus();
- connect(_edit, SIGNAL(textChanged(const QString &)), SLOT(nameChanged()));
+ connect(_edit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(nameChanged()));
hbox->addWidget(_edit);
top->addSpacing(spacingHint());
- _checkbox = new QCheckBox(i18n("Do not ask again."), plainPage());
+ _checkbox = new TQCheckBox(i18n("Do not ask again."), plainPage());
top->addWidget(_checkbox);
nameChanged();
diff --git a/libkdegames/highscore/kexthighscore_gui.h b/libkdegames/highscore/kexthighscore_gui.h
index e721299a..2a142856 100644
--- a/libkdegames/highscore/kexthighscore_gui.h
+++ b/libkdegames/highscore/kexthighscore_gui.h
@@ -20,10 +20,10 @@
#ifndef KEXTHIGHSCORE_GUI_H
#define KEXTHIGHSCORE_GUI_H
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qvbox.h>
-#include <qtabwidget.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
+#include <tqtabwidget.h>
#include <klistview.h>
#include <klineedit.h>
@@ -45,10 +45,10 @@ class AdditionalTab;
class ShowItem : public KListViewItem
{
public:
- ShowItem(QListView *, bool highlight);
+ ShowItem(TQListView *, bool highlight);
protected:
- virtual void paintCell(QPainter *, const QColorGroup &, int column,
+ virtual void paintCell(TQPainter *, const TQColorGroup &, int column,
int width, int align);
private:
@@ -59,17 +59,17 @@ class ScoresList : public KListView
{
Q_OBJECT
public:
- ScoresList(QWidget *parent);
+ ScoresList(TQWidget *parent);
void addHeader(const ItemArray &);
protected:
- QListViewItem *addLine(const ItemArray &, uint index, bool highlight);
- virtual QString itemText(const ItemContainer &, uint row) const = 0;
+ TQListViewItem *addLine(const ItemArray &, uint index, bool highlight);
+ virtual TQString itemText(const ItemContainer &, uint row) const = 0;
private:
virtual void addLineItem(const ItemArray &, uint index,
- QListViewItem *item);
+ TQListViewItem *item);
};
//-----------------------------------------------------------------------------
@@ -77,19 +77,19 @@ class HighscoresList : public ScoresList
{
Q_OBJECT
public:
- HighscoresList(QWidget *parent);
+ HighscoresList(TQWidget *parent);
void load(const ItemArray &, int highlight);
protected:
- QString itemText(const ItemContainer &, uint row) const;
+ TQString itemText(const ItemContainer &, uint row) const;
};
class HighscoresWidget : public QWidget
{
Q_OBJECT
public:
- HighscoresWidget(QWidget *parent);
+ HighscoresWidget(TQWidget *parent);
void load(int rank);
@@ -100,11 +100,11 @@ class HighscoresWidget : public QWidget
void changeTab(int i);
private slots:
- void showURL(const QString &) const;
+ void showURL(const TQString &) const;
void tabChanged() { emit tabChanged(_tw->currentPageIndex()); }
private:
- QTabWidget *_tw;
+ TQTabWidget *_tw;
HighscoresList *_scoresList, *_playersList;
KURLLabel *_scoresUrl, *_playersUrl;
AdditionalTab *_statsTab, *_histoTab;
@@ -114,18 +114,18 @@ class HighscoresDialog : public KDialogBase
{
Q_OBJECT
public:
- HighscoresDialog(int rank, QWidget *parent);
+ HighscoresDialog(int rank, TQWidget *parent);
private slots:
void slotUser1();
void slotUser2();
void tabChanged(int i) { _tab = i; }
- void createPage(QWidget *);
+ void createPage(TQWidget *);
private:
int _rank, _tab;
- QWidget *_current;
- QValueVector<HighscoresWidget *> _widgets;
+ TQWidget *_current;
+ TQValueVector<HighscoresWidget *> _widgets;
};
//-----------------------------------------------------------------------------
@@ -133,28 +133,28 @@ class LastMultipleScoresList : public ScoresList
{
Q_OBJECT
public:
- LastMultipleScoresList(const QValueVector<Score> &, QWidget *parent);
+ LastMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent);
private:
- void addLineItem(const ItemArray &, uint index, QListViewItem *line);
- QString itemText(const ItemContainer &, uint row) const;
+ void addLineItem(const ItemArray &, uint index, TQListViewItem *line);
+ TQString itemText(const ItemContainer &, uint row) const;
private:
- const QValueVector<Score> &_scores;
+ const TQValueVector<Score> &_scores;
};
class TotalMultipleScoresList : public ScoresList
{
Q_OBJECT
public:
- TotalMultipleScoresList(const QValueVector<Score> &, QWidget *parent);
+ TotalMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent);
private:
- void addLineItem(const ItemArray &, uint index, QListViewItem *line);
- QString itemText(const ItemContainer &, uint row) const;
+ void addLineItem(const ItemArray &, uint index, TQListViewItem *line);
+ TQString itemText(const ItemContainer &, uint row) const;
private:
- const QValueVector<Score> &_scores;
+ const TQValueVector<Score> &_scores;
};
//-----------------------------------------------------------------------------
@@ -162,7 +162,7 @@ class ConfigDialog : public KDialogBase
{
Q_OBJECT
public:
- ConfigDialog(QWidget *parent);
+ ConfigDialog(TQWidget *parent);
bool hasBeenSaved() const { return _saved; }
@@ -171,12 +171,12 @@ class ConfigDialog : public KDialogBase
void removeSlot();
void accept();
void slotApply() { save(); }
- void nickNameChanged(const QString &);
+ void nickNameChanged(const TQString &);
private:
bool _saved;
- QCheckBox *_WWHEnabled;
- QLineEdit *_nickname, *_comment;
+ TQCheckBox *_WWHEnabled;
+ TQLineEdit *_nickname, *_comment;
KLineEdit *_key, *_registeredName;
KPushButton *_removeButton;
@@ -189,17 +189,17 @@ class AskNameDialog : public KDialogBase
{
Q_OBJECT
public:
- AskNameDialog(QWidget *parent);
+ AskNameDialog(TQWidget *parent);
- QString name() const { return _edit->text(); }
+ TQString name() const { return _edit->text(); }
bool dontAskAgain() const { return _checkbox->isChecked(); }
private slots:
void nameChanged();
private:
- QLineEdit *_edit;
- QCheckBox *_checkbox;
+ TQLineEdit *_edit;
+ TQCheckBox *_checkbox;
};
} // namespace
diff --git a/libkdegames/highscore/kexthighscore_internal.cpp b/libkdegames/highscore/kexthighscore_internal.cpp
index a8395753..3c73c3aa 100644
--- a/libkdegames/highscore/kexthighscore_internal.cpp
+++ b/libkdegames/highscore/kexthighscore_internal.cpp
@@ -23,9 +23,9 @@
#include <sys/types.h>
#include <unistd.h>
-#include <qfile.h>
-#include <qlayout.h>
-#include <qdom.h>
+#include <tqfile.h>
+#include <tqlayout.h>
+#include <tqdom.h>
#include <kglobal.h>
#include <kio/netaccess.h>
@@ -62,17 +62,17 @@ void ItemContainer::setItem(Item *item)
_item = item;
}
-QString ItemContainer::entryName() const
+TQString ItemContainer::entryName() const
{
if ( _subGroup.isEmpty() ) return _name;
return _name + "_" + _subGroup;
}
-QVariant ItemContainer::read(uint i) const
+TQVariant ItemContainer::read(uint i) const
{
Q_ASSERT(_item);
- QVariant v = _item->defaultValue();
+ TQVariant v = _item->defaultValue();
if ( isStored() ) {
internal->hsConfig().setHighscoreGroup(_group);
v = internal->hsConfig().readPropertyEntry(i+1, entryName(), v);
@@ -80,13 +80,13 @@ QVariant ItemContainer::read(uint i) const
return _item->read(i, v);
}
-QString ItemContainer::pretty(uint i) const
+TQString ItemContainer::pretty(uint i) const
{
Q_ASSERT(_item);
return _item->pretty(i, read(i));
}
-void ItemContainer::write(uint i, const QVariant &value) const
+void ItemContainer::write(uint i, const TQVariant &value) const
{
Q_ASSERT( isStored() );
Q_ASSERT( internal->hsConfig().isLocked() );
@@ -111,14 +111,14 @@ ItemArray::~ItemArray()
for (uint i=0; i<size(); i++) delete at(i);
}
-int ItemArray::findIndex(const QString &name) const
+int ItemArray::findIndex(const TQString &name) const
{
for (uint i=0; i<size(); i++)
if ( at(i)->name()==name ) return i;
return -1;
}
-const ItemContainer *ItemArray::item(const QString &name) const
+const ItemContainer *ItemArray::item(const TQString &name) const
{
int i = findIndex(name);
if ( i==-1 ) kdError(11002) << k_funcinfo << "no item named \"" << name
@@ -126,7 +126,7 @@ const ItemContainer *ItemArray::item(const QString &name) const
return at(i);
}
-ItemContainer *ItemArray::item(const QString &name)
+ItemContainer *ItemArray::item(const TQString &name)
{
int i = findIndex(name);
if ( i==-1 ) kdError(11002) << k_funcinfo << "no item named \"" << name
@@ -134,7 +134,7 @@ ItemContainer *ItemArray::item(const QString &name)
return at(i);
}
-void ItemArray::setItem(const QString &name, Item *item)
+void ItemArray::setItem(const TQString &name, Item *item)
{
int i = findIndex(name);
if ( i==-1 ) kdError(11002) << k_funcinfo << "no item named \"" << name
@@ -144,7 +144,7 @@ void ItemArray::setItem(const QString &name, Item *item)
_setItem(i, name, item, stored, canHaveSubGroup);
}
-void ItemArray::addItem(const QString &name, Item *item,
+void ItemArray::addItem(const TQString &name, Item *item,
bool stored, bool canHaveSubGroup)
{
if ( findIndex(name)!=-1 )
@@ -155,16 +155,16 @@ void ItemArray::addItem(const QString &name, Item *item,
_setItem(i, name, item, stored, canHaveSubGroup);
}
-void ItemArray::_setItem(uint i, const QString &name, Item *item,
+void ItemArray::_setItem(uint i, const TQString &name, Item *item,
bool stored, bool canHaveSubGroup)
{
at(i)->setItem(item);
at(i)->setName(name);
- at(i)->setGroup(stored ? _group : QString::null);
- at(i)->setSubGroup(canHaveSubGroup ? _subGroup : QString::null);
+ at(i)->setGroup(stored ? _group : TQString::null);
+ at(i)->setSubGroup(canHaveSubGroup ? _subGroup : TQString::null);
}
-void ItemArray::setGroup(const QString &group)
+void ItemArray::setGroup(const TQString &group)
{
Q_ASSERT( !group.isNull() );
_group = group;
@@ -172,7 +172,7 @@ void ItemArray::setGroup(const QString &group)
if ( at(i)->isStored() ) at(i)->setGroup(group);
}
-void ItemArray::setSubGroup(const QString &subGroup)
+void ItemArray::setSubGroup(const TQString &subGroup)
{
Q_ASSERT( !subGroup.isNull() );
_subGroup = subGroup;
@@ -197,7 +197,7 @@ void ItemArray::write(uint k, const Score &data, uint nb) const
}
}
-void ItemArray::exportToText(QTextStream &s) const
+void ItemArray::exportToText(TQTextStream &s) const
{
for (uint k=0; k<nbEntries()+1; k++) {
for (uint i=0; i<size(); i++) {
@@ -219,7 +219,7 @@ class ScoreNameItem : public NameItem
ScoreNameItem(const ScoreInfos &score, const PlayerInfos &infos)
: _score(score), _infos(infos) {}
- QString pretty(uint i, const QVariant &v) const {
+ TQString pretty(uint i, const TQVariant &v) const {
uint id = _score.item("id")->read(i).toUInt();
if ( id==0 ) return NameItem::pretty(i, v);
return _infos.prettyName(id-1);
@@ -269,7 +269,7 @@ PlayerInfos::PlayerInfos()
it = Manager::createItem(Manager::BestScoreDefault);
addItem("best score", it, true, true);
addItem("date", new DateItem, true, true);
- it = new Item(QString::null, i18n("Comment"), Qt::AlignLeft);
+ it = new Item(TQString::null, i18n("Comment"), Qt::AlignLeft);
addItem("comment", it);
// statistics items
@@ -281,7 +281,7 @@ PlayerInfos::PlayerInfos()
addItem("max won trend", new Item((uint)0), true, true);
struct passwd *pwd = getpwuid(getuid());
- QString username = pwd->pw_name;
+ TQString username = pwd->pw_name;
#ifdef HIGHSCORE_DIRECTORY
internal->hsConfig().setHighscoreGroup("players");
for (uint i=0; ;i++) {
@@ -300,9 +300,9 @@ PlayerInfos::PlayerInfos()
internal->hsConfig().lockForWriting();
KEMailSettings emailConfig;
emailConfig.setProfile(emailConfig.defaultProfileName());
- QString name = emailConfig.getSetting(KEMailSettings::RealName);
+ TQString name = emailConfig.getSetting(KEMailSettings::RealName);
if ( name.isEmpty() || isNameUsed(name) ) name = username;
- if ( isNameUsed(name) ) name= QString(ItemContainer::ANONYMOUS);
+ if ( isNameUsed(name) ) name= TQString(ItemContainer::ANONYMOUS);
#ifdef HIGHSCORE_DIRECTORY
internal->hsConfig().writeEntry(_id+1, "username", username);
item("name")->write(_id, name);
@@ -314,14 +314,14 @@ PlayerInfos::PlayerInfos()
#ifdef HIGHSCORE_DIRECTORY
if (_oldLocalPlayer) { // player already exists in local config file
// copy player data
- QString prefix = QString("%1_").arg(_oldLocalId+1);
- QMap<QString, QString> entries =
+ TQString prefix = TQString("%1_").arg(_oldLocalId+1);
+ TQMap<TQString, TQString> entries =
cg.config()->entryMap("KHighscore_players");
- QMap<QString, QString>::const_iterator it;
+ TQMap<TQString, TQString>::const_iterator it;
for (it=entries.begin(); it!=entries.end(); ++it) {
- QString key = it.key();
+ TQString key = it.key();
if ( key.find(prefix)==0 ) {
- QString name = key.right(key.length()-prefix.length());
+ TQString name = key.right(key.length()-prefix.length());
if ( name!="name" || !isNameUsed(it.data()) )
internal->hsConfig().writeEntry(_id+1, name, it.data());
}
@@ -340,7 +340,7 @@ PlayerInfos::PlayerInfos()
internal->hsConfig().writeAndUnlock();
}
-void PlayerInfos::createHistoItems(const QMemArray<uint> &scores, bool bound)
+void PlayerInfos::createHistoItems(const TQMemArray<uint> &scores, bool bound)
{
Q_ASSERT( _histogram.size()==0 );
_bound = bound;
@@ -357,14 +357,14 @@ bool PlayerInfos::isAnonymous() const
uint PlayerInfos::nbEntries() const
{
internal->hsConfig().setHighscoreGroup("players");
- QStringList list = internal->hsConfig().readList("name", -1);
+ TQStringList list = internal->hsConfig().readList("name", -1);
return list.count();
}
-QString PlayerInfos::key() const
+TQString PlayerInfos::key() const
{
ConfigGroup cg;
- return cg.config()->readEntry(HS_KEY, QString::null);
+ return cg.config()->readEntry(HS_KEY, TQString::null);
}
bool PlayerInfos::isWWEnabled() const
@@ -373,13 +373,13 @@ bool PlayerInfos::isWWEnabled() const
return cg.config()->readBoolEntry(HS_WW_ENABLED, false);
}
-QString PlayerInfos::histoName(uint i) const
+TQString PlayerInfos::histoName(uint i) const
{
- const QMemArray<uint> &sh = _histogram;
+ const TQMemArray<uint> &sh = _histogram;
Q_ASSERT( i<sh.size() || (_bound || i==sh.size()) );
if ( i==sh.size() )
- return QString("nb scores greater than %1").arg(sh[sh.size()-1]);
- return QString("nb scores less than %1").arg(sh[i]);
+ return TQString("nb scores greater than %1").arg(sh[sh.size()-1]);
+ return TQString("nb scores less than %1").arg(sh[i]);
}
uint PlayerInfos::histoSize() const
@@ -446,7 +446,7 @@ void PlayerInfos::submitScore(const Score &score) const
// update histogram
if ( score.type()==Won ) {
- const QMemArray<uint> &sh = _histogram;
+ const TQMemArray<uint> &sh = _histogram;
for (uint i=1; i<histoSize(); i++)
if ( i==sh.size() || score.score()<sh[i] ) {
item(histoName(i))->increment(_id);
@@ -455,7 +455,7 @@ void PlayerInfos::submitScore(const Score &score) const
}
}
-bool PlayerInfos::isNameUsed(const QString &newName) const
+bool PlayerInfos::isNameUsed(const TQString &newName) const
{
if ( newName==name() ) return false; // own name...
for (uint i=0; i<nbEntries(); i++)
@@ -464,14 +464,14 @@ bool PlayerInfos::isNameUsed(const QString &newName) const
return false;
}
-void PlayerInfos::modifyName(const QString &newName) const
+void PlayerInfos::modifyName(const TQString &newName) const
{
item("name")->write(_id, newName);
}
-void PlayerInfos::modifySettings(const QString &newName,
- const QString &comment, bool WWEnabled,
- const QString &newKey) const
+void PlayerInfos::modifySettings(const TQString &newName,
+ const TQString &comment, bool WWEnabled,
+ const TQString &newKey) const
{
modifyName(newName);
item("comment")->write(_id, comment);
@@ -481,10 +481,10 @@ void PlayerInfos::modifySettings(const QString &newName,
if (WWEnabled) cg.config()->writeEntry(HS_REGISTERED_NAME, newName);
}
-QString PlayerInfos::registeredName() const
+TQString PlayerInfos::registeredName() const
{
ConfigGroup cg;
- return cg.config()->readEntry(HS_REGISTERED_NAME, QString::null);
+ return cg.config()->readEntry(HS_REGISTERED_NAME, TQString::null);
}
void PlayerInfos::removeKey()
@@ -493,12 +493,12 @@ void PlayerInfos::removeKey()
// save old key/nickname
uint i = 0;
- QString str = "%1 old #%2";
- QString sk;
+ TQString str = "%1 old #%2";
+ TQString sk;
do {
i++;
sk = str.arg(HS_KEY).arg(i);
- } while ( !cg.config()->readEntry(sk, QString::null).isEmpty() );
+ } while ( !cg.config()->readEntry(sk, TQString::null).isEmpty() );
cg.config()->writeEntry(sk, key());
cg.config()->writeEntry(str.arg(HS_REGISTERED_NAME).arg(i),
registeredName());
@@ -531,11 +531,11 @@ ManagerPrivate::~ManagerPrivate()
delete _hsConfig;
}
-KURL ManagerPrivate::queryURL(QueryType type, const QString &newName) const
+KURL ManagerPrivate::queryURL(QueryType type, const TQString &newName) const
{
KURL url = serverURL;
- QString nameItem = "nickname";
- QString name = _playerInfos->registeredName();
+ TQString nameItem = "nickname";
+ TQString name = _playerInfos->registeredName();
bool withVersion = true;
bool key = false;
bool level = false;
@@ -572,7 +572,7 @@ KURL ManagerPrivate::queryURL(QueryType type, const QString &newName) const
if ( !name.isEmpty() ) Manager::addToQueryURL(url, nameItem, name);
if (key) Manager::addToQueryURL(url, "key", _playerInfos->key());
if (level) {
- QString label = manager.gameTypeLabel(_gameType, Manager::WW);
+ TQString label = manager.gameTypeLabel(_gameType, Manager::WW);
if ( !label.isEmpty() ) Manager::addToQueryURL(url, "level", label);
}
@@ -602,61 +602,61 @@ const char *DUMMY_STRINGS[] = {
const char *UNABLE_TO_CONTACT =
I18N_NOOP("Unable to contact world-wide highscore server");
-bool ManagerPrivate::doQuery(const KURL &url, QWidget *parent,
- QDomNamedNodeMap *map)
+bool ManagerPrivate::doQuery(const KURL &url, TQWidget *parent,
+ TQDomNamedNodeMap *map)
{
KIO::http_update_cache(url, true, 0); // remove cache !
- QString tmpFile;
+ TQString tmpFile;
if ( !KIO::NetAccess::download(url, tmpFile, parent) ) {
- QString details = i18n("Server URL: %1").arg(url.host());
+ TQString details = i18n("Server URL: %1").arg(url.host());
KMessageBox::detailedSorry(parent, i18n(UNABLE_TO_CONTACT), details);
return false;
}
- QFile file(tmpFile);
+ TQFile file(tmpFile);
if ( !file.open(IO_ReadOnly) ) {
KIO::NetAccess::removeTempFile(tmpFile);
- QString details = i18n("Unable to open temporary file.");
+ TQString details = i18n("Unable to open temporary file.");
KMessageBox::detailedSorry(parent, i18n(UNABLE_TO_CONTACT), details);
return false;
}
- QTextStream t(&file);
- QString content = t.read().stripWhiteSpace();
+ TQTextStream t(&file);
+ TQString content = t.read().stripWhiteSpace();
file.close();
KIO::NetAccess::removeTempFile(tmpFile);
- QDomDocument doc;
+ TQDomDocument doc;
if ( doc.setContent(content) ) {
- QDomElement root = doc.documentElement();
- QDomElement element = root.firstChild().toElement();
+ TQDomElement root = doc.documentElement();
+ TQDomElement element = root.firstChild().toElement();
if ( element.tagName()=="success" ) {
if (map) *map = element.attributes();
return true;
}
if ( element.tagName()=="error" ) {
- QDomAttr attr = element.attributes().namedItem("label").toAttr();
+ TQDomAttr attr = element.attributes().namedItem("label").toAttr();
if ( !attr.isNull() ) {
- QString msg = i18n(attr.value().latin1());
- QString caption = i18n("Message from world-wide highscores "
+ TQString msg = i18n(attr.value().latin1());
+ TQString caption = i18n("Message from world-wide highscores "
"server");
KMessageBox::sorry(parent, msg, caption);
return false;
}
}
}
- QString msg = i18n("Invalid answer from world-wide highscores server.");
- QString details = i18n("Raw message: %1").arg(content);
+ TQString msg = i18n("Invalid answer from world-wide highscores server.");
+ TQString details = i18n("Raw message: %1").arg(content);
KMessageBox::detailedSorry(parent, msg, details);
return false;
}
-bool ManagerPrivate::getFromQuery(const QDomNamedNodeMap &map,
- const QString &name, QString &value,
- QWidget *parent)
+bool ManagerPrivate::getFromQuery(const TQDomNamedNodeMap &map,
+ const TQString &name, TQString &value,
+ TQWidget *parent)
{
- QDomAttr attr = map.namedItem(name).toAttr();
+ TQDomAttr attr = map.namedItem(name).toAttr();
if ( attr.isNull() ) {
KMessageBox::sorry(parent,
i18n("Invalid answer from world-wide "
@@ -683,11 +683,11 @@ int ManagerPrivate::rank(const Score &score) const
return (i<_scoreInfos->maxNbEntries() ? (int)i : -1);
}
-bool ManagerPrivate::modifySettings(const QString &newName,
- const QString &comment, bool WWEnabled,
- QWidget *widget)
+bool ManagerPrivate::modifySettings(const TQString &newName,
+ const TQString &comment, bool WWEnabled,
+ TQWidget *widget)
{
- QString newKey;
+ TQString newKey;
bool newPlayer = false;
if (WWEnabled) {
@@ -696,7 +696,7 @@ bool ManagerPrivate::modifySettings(const QString &newName,
KURL url = queryURL((newPlayer ? Register : Change), newName);
Manager::addToQueryURL(url, "comment", comment);
- QDomNamedNodeMap map;
+ TQDomNamedNodeMap map;
bool ok = doQuery(url, widget, &map);
if ( !ok || (newPlayer && !getFromQuery(map, "key", newKey, widget)) )
return false;
@@ -720,7 +720,7 @@ void ManagerPrivate::convertToGlobal()
// read old highscores
KHighscore *tmp = _hsConfig;
_hsConfig = new KHighscore(true, 0);
- QValueVector<Score> scores(_scoreInfos->nbEntries());
+ TQValueVector<Score> scores(_scoreInfos->nbEntries());
for (uint i=0; i<scores.count(); i++)
scores[i] = readScore(i);
@@ -759,8 +759,8 @@ void ManagerPrivate::setGameType(uint type)
Q_ASSERT( type<_nbGameTypes );
_gameType = kMin(type, _nbGameTypes-1);
- QString str = "scores";
- QString lab = manager.gameTypeLabel(_gameType, Manager::Standard);
+ TQString str = "scores";
+ TQString lab = manager.gameTypeLabel(_gameType, Manager::Standard);
if ( !lab.isEmpty() ) {
_playerInfos->setSubGroup(lab);
str += "_" + lab;
@@ -774,22 +774,22 @@ void ManagerPrivate::checkFirst()
}
int ManagerPrivate::submitScore(const Score &ascore,
- QWidget *widget, bool askIfAnonymous)
+ TQWidget *widget, bool askIfAnonymous)
{
checkFirst();
Score score = ascore;
score.setData("id", _playerInfos->id() + 1);
- score.setData("date", QDateTime::currentDateTime());
+ score.setData("date", TQDateTime::currentDateTime());
// ask new name if anonymous and winner
const char *dontAskAgainName = "highscore_ask_name_dialog";
- QString newName;
+ TQString newName;
KMessageBox::ButtonCode dummy;
if ( score.type()==Won && askIfAnonymous && _playerInfos->isAnonymous()
&& KMessageBox::shouldBeShownYesNo(dontAskAgainName, dummy) ) {
AskNameDialog d(widget);
- if ( d.exec()==QDialog::Accepted ) newName = d.name();
+ if ( d.exec()==TQDialog::Accepted ) newName = d.name();
if ( d.dontAskAgain() )
KMessageBox::saveDontShowAgainYesNo(dontAskAgainName,
KMessageBox::No);
@@ -825,7 +825,7 @@ int ManagerPrivate::submitLocal(const Score &score)
}
bool ManagerPrivate::submitWorldWide(const Score &score,
- QWidget *widget) const
+ TQWidget *widget) const
{
if ( score.type()==Lost && !trackLostGames ) return true;
if ( score.type()==Draw && !trackDrawGames ) return true;
@@ -833,15 +833,15 @@ bool ManagerPrivate::submitWorldWide(const Score &score,
KURL url = queryURL(Submit);
manager.additionalQueryItems(url, score);
int s = (score.type()==Won ? score.score() : (int)score.type());
- QString str = QString::number(s);
+ TQString str = TQString::number(s);
Manager::addToQueryURL(url, "score", str);
- KMD5 context(QString(_playerInfos->registeredName() + str).latin1());
+ KMD5 context(TQString(_playerInfos->registeredName() + str).latin1());
Manager::addToQueryURL(url, "check", context.hexDigest());
return doQuery(url, widget);
}
-void ManagerPrivate::exportHighscores(QTextStream &s)
+void ManagerPrivate::exportHighscores(TQTextStream &s)
{
uint tmp = _gameType;
diff --git a/libkdegames/highscore/kexthighscore_internal.h b/libkdegames/highscore/kexthighscore_internal.h
index 3b206877..639c059b 100644
--- a/libkdegames/highscore/kexthighscore_internal.h
+++ b/libkdegames/highscore/kexthighscore_internal.h
@@ -48,16 +48,16 @@ class RankItem : public Item
RankItem()
: Item((uint)0, i18n("Rank"), Qt::AlignRight) {}
- QVariant read(uint rank, const QVariant &) const { return rank; }
- QString pretty(uint rank, const QVariant &) const
- { return QString::number(rank+1); }
+ TQVariant read(uint rank, const TQVariant &) const { return rank; }
+ TQString pretty(uint rank, const TQVariant &) const
+ { return TQString::number(rank+1); }
};
class NameItem : public Item
{
public:
NameItem()
- : Item(QString::null, i18n("Name"), Qt::AlignLeft) {
+ : Item(TQString::null, i18n("Name"), Qt::AlignLeft) {
setPrettySpecial(Anonymous);
}
};
@@ -66,7 +66,7 @@ class DateItem : public Item
{
public:
DateItem()
- : Item(QDateTime(), i18n("Date"), Qt::AlignRight) {
+ : Item(TQDateTime(), i18n("Date"), Qt::AlignRight) {
setPrettyFormat(DateTime);
}
};
@@ -92,29 +92,29 @@ class ItemContainer
const Item *item() const { return _item; }
Item *item() { return _item; }
- void setName(const QString &name) { _name = name; }
- QString name() const { return _name; }
+ void setName(const TQString &name) { _name = name; }
+ TQString name() const { return _name; }
- void setGroup(const QString &group) { _group = group; }
+ void setGroup(const TQString &group) { _group = group; }
bool isStored() const { return !_group.isNull(); }
- void setSubGroup(const QString &subGroup) { _subGroup = subGroup; }
+ void setSubGroup(const TQString &subGroup) { _subGroup = subGroup; }
bool canHaveSubGroup() const { return !_subGroup.isNull(); }
static const char ANONYMOUS[]; // name assigned to anonymous players
static const char ANONYMOUS_LABEL[];
- QVariant read(uint i) const;
- QString pretty(uint i) const;
- void write(uint i, const QVariant &value) const;
- // for UInt QVariant (return new value)
+ TQVariant read(uint i) const;
+ TQString pretty(uint i) const;
+ void write(uint i, const TQVariant &value) const;
+ // for UInt TQVariant (return new value)
uint increment(uint i) const;
private:
Item *_item;
- QString _name, _group, _subGroup;
+ TQString _name, _group, _subGroup;
- QString entryName() const;
+ TQString entryName() const;
ItemContainer(const ItemContainer &);
ItemContainer &operator =(const ItemContainer &);
@@ -125,7 +125,7 @@ class ItemContainer
* Manage a bunch of @ref Item which are saved under the same group
* in KHighscores config file.
*/
-class ItemArray : public QMemArray<ItemContainer *>
+class ItemArray : public TQMemArray<ItemContainer *>
{
public:
ItemArray();
@@ -133,26 +133,26 @@ class ItemArray : public QMemArray<ItemContainer *>
virtual uint nbEntries() const = 0;
- const ItemContainer *item(const QString &name) const;
- ItemContainer *item(const QString &name);
+ const ItemContainer *item(const TQString &name) const;
+ ItemContainer *item(const TQString &name);
- void addItem(const QString &name, Item *, bool stored = true,
+ void addItem(const TQString &name, Item *, bool stored = true,
bool canHaveSubGroup = false);
- void setItem(const QString &name, Item *);
- int findIndex(const QString &name) const;
+ void setItem(const TQString &name, Item *);
+ int findIndex(const TQString &name) const;
- void setGroup(const QString &group);
- void setSubGroup(const QString &subGroup);
+ void setGroup(const TQString &group);
+ void setSubGroup(const TQString &subGroup);
void read(uint k, Score &data) const;
void write(uint k, const Score &data, uint maxNbLines) const;
- void exportToText(QTextStream &) const;
+ void exportToText(TQTextStream &) const;
private:
- QString _group, _subGroup;
+ TQString _group, _subGroup;
- void _setItem(uint i, const QString &name, Item *, bool stored,
+ void _setItem(uint i, const TQString &name, Item *, bool stored,
bool canHaveSubGroup);
ItemArray(const ItemArray &);
@@ -176,7 +176,7 @@ class ScoreInfos : public ItemArray
class ConfigGroup : public KConfigGroupSaver
{
public:
- ConfigGroup(const QString &group = QString::null)
+ ConfigGroup(const TQString &group = TQString::null)
: KConfigGroupSaver(kapp->config(), group) {}
};
@@ -189,34 +189,34 @@ class PlayerInfos : public ItemArray
bool isNewPlayer() const { return _newPlayer; }
bool isOldLocalPlayer() const { return _oldLocalPlayer; }
uint nbEntries() const;
- QString name() const { return item("name")->read(_id).toString(); }
+ TQString name() const { return item("name")->read(_id).toString(); }
bool isAnonymous() const;
- QString prettyName() const { return prettyName(_id); }
- QString prettyName(uint id) const { return item("name")->pretty(id); }
- QString registeredName() const;
- QString comment() const { return item("comment")->pretty(_id); }
+ TQString prettyName() const { return prettyName(_id); }
+ TQString prettyName(uint id) const { return item("name")->pretty(id); }
+ TQString registeredName() const;
+ TQString comment() const { return item("comment")->pretty(_id); }
bool isWWEnabled() const;
- QString key() const;
+ TQString key() const;
uint id() const { return _id; }
uint oldLocalId() const { return _oldLocalId; }
- void createHistoItems(const QMemArray<uint> &scores, bool bound);
- QString histoName(uint i) const;
+ void createHistoItems(const TQMemArray<uint> &scores, bool bound);
+ TQString histoName(uint i) const;
uint histoSize() const;
- const QMemArray<uint> &histogram() const { return _histogram; }
+ const TQMemArray<uint> &histogram() const { return _histogram; }
void submitScore(const Score &) const;
// return true if the nickname is already used locally
- bool isNameUsed(const QString &name) const;
- void modifyName(const QString &newName) const;
- void modifySettings(const QString &newName, const QString &comment,
- bool WWEnabled, const QString &newKey) const;
+ bool isNameUsed(const TQString &name) const;
+ void modifyName(const TQString &newName) const;
+ void modifySettings(const TQString &newName, const TQString &comment,
+ bool WWEnabled, const TQString &newKey) const;
void removeKey();
private:
bool _newPlayer, _bound, _oldLocalPlayer;
uint _id, _oldLocalId;
- QMemArray<uint> _histogram;
+ TQMemArray<uint> _histogram;
};
//-----------------------------------------------------------------------------
@@ -227,13 +227,13 @@ class ManagerPrivate
void init(uint maxNbentries);
~ManagerPrivate();
- bool modifySettings(const QString &newName, const QString &comment,
- bool WWEnabled, QWidget *widget);
+ bool modifySettings(const TQString &newName, const TQString &comment,
+ bool WWEnabled, TQWidget *widget);
void setGameType(uint type);
void checkFirst();
int submitLocal(const Score &score);
- int submitScore(const Score &score, QWidget *widget, bool askIfAnonymous);
+ int submitScore(const Score &score, TQWidget *widget, bool askIfAnonymous);
Score readScore(uint i) const;
uint gameType() const { return _gameType; }
@@ -243,13 +243,13 @@ class ManagerPrivate
PlayerInfos &playerInfos() { return *_playerInfos; }
KHighscore &hsConfig() { return *_hsConfig; }
enum QueryType { Submit, Register, Change, Players, Scores };
- KURL queryURL(QueryType type, const QString &newName=QString::null) const;
+ KURL queryURL(QueryType type, const TQString &newName=TQString::null) const;
- void exportHighscores(QTextStream &);
+ void exportHighscores(TQTextStream &);
Manager &manager;
KURL serverURL;
- QString version;
+ TQString version;
bool showStatistics, showDrawGames, trackLostGames, trackDrawGames;
Manager::ShowMode showMode;
@@ -264,11 +264,11 @@ class ManagerPrivate
// return -1 if not a local best score
int rank(const Score &score) const;
- bool submitWorldWide(const Score &score, QWidget *parent) const;
- static bool doQuery(const KURL &url, QWidget *parent,
- QDomNamedNodeMap *map = 0);
- static bool getFromQuery(const QDomNamedNodeMap &map, const QString &name,
- QString &value, QWidget *parent);
+ bool submitWorldWide(const Score &score, TQWidget *parent) const;
+ static bool doQuery(const KURL &url, TQWidget *parent,
+ TQDomNamedNodeMap *map = 0);
+ static bool getFromQuery(const TQDomNamedNodeMap &map, const TQString &name,
+ TQString &value, TQWidget *parent);
void convertToGlobal();
};
diff --git a/libkdegames/highscore/kexthighscore_item.cpp b/libkdegames/highscore/kexthighscore_item.cpp
index 48556e02..fa6c7e2c 100644
--- a/libkdegames/highscore/kexthighscore_item.cpp
+++ b/libkdegames/highscore/kexthighscore_item.cpp
@@ -19,7 +19,7 @@
#include "kexthighscore_item.h"
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kglobal.h>
#include <kdialogbase.h>
#include <kdebug.h>
@@ -33,7 +33,7 @@ namespace KExtHighscore
{
//-----------------------------------------------------------------------------
-Item::Item(const QVariant &def, const QString &label, int alignment)
+Item::Item(const TQVariant &def, const TQString &label, int alignment)
: _default(def), _label(label), _alignment(alignment),
_format(NoFormat), _special(NoSpecial)
{}
@@ -41,16 +41,16 @@ Item::Item(const QVariant &def, const QString &label, int alignment)
Item::~Item()
{}
-QVariant Item::read(uint, const QVariant &value) const
+TQVariant Item::read(uint, const TQVariant &value) const
{
return value;
}
void Item::setPrettyFormat(Format format)
{
- bool buint = ( _default.type()==QVariant::UInt );
- bool bdouble = ( _default.type()==QVariant::Double );
- bool bnum = ( buint || bdouble || _default.type()==QVariant::Int );
+ bool buint = ( _default.type()==TQVariant::UInt );
+ bool bdouble = ( _default.type()==TQVariant::Double );
+ bool bnum = ( buint || bdouble || _default.type()==TQVariant::Int );
switch (format) {
case OneDecimal:
@@ -61,7 +61,7 @@ void Item::setPrettyFormat(Format format)
Q_ASSERT(bnum);
break;
case DateTime:
- Q_ASSERT( _default.type()==QVariant::DateTime );
+ Q_ASSERT( _default.type()==TQVariant::DateTime );
break;
case NoFormat:
break;
@@ -72,9 +72,9 @@ void Item::setPrettyFormat(Format format)
void Item::setPrettySpecial(Special special)
{
- bool buint = ( _default.type()==QVariant::UInt );
- bool bnum = ( buint || _default.type()==QVariant::Double
- || _default.type()==QVariant::Int );
+ bool buint = ( _default.type()==TQVariant::UInt );
+ bool bnum = ( buint || _default.type()==TQVariant::Double
+ || _default.type()==TQVariant::Int );
switch (special) {
case ZeroNotDefined:
@@ -86,7 +86,7 @@ void Item::setPrettySpecial(Special special)
case DefaultNotDefined:
break;
case Anonymous:
- Q_ASSERT( _default.type()==QVariant::String );
+ Q_ASSERT( _default.type()==TQVariant::String );
break;
case NoSpecial:
break;
@@ -95,15 +95,15 @@ void Item::setPrettySpecial(Special special)
_special = special;
}
-QString Item::timeFormat(uint n)
+TQString Item::timeFormat(uint n)
{
Q_ASSERT( n<=3600 && n!=0 );
n = 3600 - n;
- return QString::number(n / 60).rightJustify(2, '0') + ':'
- + QString::number(n % 60).rightJustify(2, '0');
+ return TQString::number(n / 60).rightJustify(2, '0') + ':'
+ + TQString::number(n % 60).rightJustify(2, '0');
}
-QString Item::pretty(uint, const QVariant &value) const
+TQString Item::pretty(uint, const TQVariant &value) const
{
switch (_special) {
case ZeroNotDefined:
@@ -125,9 +125,9 @@ QString Item::pretty(uint, const QVariant &value) const
switch (_format) {
case OneDecimal:
- return QString::number(value.toDouble(), 'f', 1);
+ return TQString::number(value.toDouble(), 'f', 1);
case Percentage:
- return QString::number(value.toDouble(), 'f', 1) + "%";
+ return TQString::number(value.toDouble(), 'f', 1) + "%";
case MinuteTime:
return timeFormat(value.toUInt());
case DateTime:
@@ -152,13 +152,13 @@ Score::Score(ScoreType type)
Score::~Score()
{}
-const QVariant &Score::data(const QString &name) const
+const TQVariant &Score::data(const TQString &name) const
{
Q_ASSERT( _data.contains(name) );
return _data[name];
}
-void Score::setData(const QString &name, const QVariant &value)
+void Score::setData(const TQString &name, const TQVariant &value)
{
Q_ASSERT( _data.contains(name) );
Q_ASSERT( _data[name].type()==value.type() );
@@ -176,14 +176,14 @@ bool Score::operator <(const Score &score)
return internal->manager.isStrictlyLess(*this, score);
}
-QDataStream &operator <<(QDataStream &s, const Score &score)
+TQDataStream &operator <<(TQDataStream &s, const Score &score)
{
s << (Q_UINT8)score.type();
s << score._data;
return s;
}
-QDataStream &operator >>(QDataStream &s, Score &score)
+TQDataStream &operator >>(TQDataStream &s, Score &score)
{
Q_UINT8 type;
s >> type;
@@ -204,7 +204,7 @@ void MultiplayerScores::clear()
Score score;
for (uint i=0; i<_scores.size(); i++) {
_nbGames[i] = 0;
- QVariant name = _scores[i].data("name");
+ TQVariant name = _scores[i].data("name");
_scores[i] = score;
_scores[i].setData("name", name);
_scores[i]._data["mean score"] = double(0);
@@ -219,14 +219,14 @@ void MultiplayerScores::setPlayerCount(uint nb)
clear();
}
-void MultiplayerScores::setName(uint i, const QString &name)
+void MultiplayerScores::setName(uint i, const TQString &name)
{
_scores[i].setData("name", name);
}
void MultiplayerScores::addScore(uint i, const Score &score)
{
- QVariant name = _scores[i].data("name");
+ TQVariant name = _scores[i].data("name");
double mean = _scores[i].data("mean score").toDouble();
uint won = _scores[i].data("nb won games").toUInt();
_scores[i] = score;
@@ -238,7 +238,7 @@ void MultiplayerScores::addScore(uint i, const Score &score)
_scores[i]._data["nb won games"] = won;
}
-void MultiplayerScores::show(QWidget *parent)
+void MultiplayerScores::show(TQWidget *parent)
{
// check consistency
if ( _nbGames.size()<2 ) kdWarning(11002) << "less than 2 players" << endl;
@@ -252,11 +252,11 @@ void MultiplayerScores::show(QWidget *parent)
}
// order the players according to the number of won games
- QValueVector<Score> ordered;
+ TQValueVector<Score> ordered;
for (uint i=0; i<_scores.size(); i++) {
uint won = _scores[i].data("nb won games").toUInt();
double mean = _scores[i].data("mean score").toDouble();
- QValueVector<Score>::iterator it;
+ TQValueVector<Score>::iterator it;
for(it = ordered.begin(); it!=ordered.end(); ++it) {
uint cwon = (*it).data("nb won games").toUInt();
double cmean = (*it).data("mean score").toDouble();
@@ -272,21 +272,21 @@ void MultiplayerScores::show(QWidget *parent)
KDialogBase dialog(KDialogBase::Plain, i18n("Multiplayers Scores"),
KDialogBase::Close, KDialogBase::Close,
parent, "show_multiplayers_score", true, true);
- QHBoxLayout *hbox = new QHBoxLayout(dialog.plainPage(),
+ TQHBoxLayout *hbox = new TQHBoxLayout(dialog.plainPage(),
KDialog::marginHint(), KDialog::spacingHint());
- QVBox *vbox = new QVBox(dialog.plainPage());
+ TQVBox *vbox = new TQVBox(dialog.plainPage());
hbox->addWidget(vbox);
- if ( _nbGames[0]==0 ) (void)new QLabel(i18n("No game played."), vbox);
+ if ( _nbGames[0]==0 ) (void)new TQLabel(i18n("No game played."), vbox);
else {
- (void)new QLabel(i18n("Scores for last game:"), vbox);
+ (void)new TQLabel(i18n("Scores for last game:"), vbox);
(void)new LastMultipleScoresList(ordered, vbox);
}
if ( _nbGames[0]>1 ) {
- vbox = new QVBox(dialog.plainPage());
+ vbox = new TQVBox(dialog.plainPage());
hbox->addWidget(vbox);
- (void)new QLabel(i18n("Scores for the last %1 games:")
+ (void)new TQLabel(i18n("Scores for the last %1 games:")
.arg(_nbGames[0]), vbox);
(void)new TotalMultipleScoresList(ordered, vbox);
}
@@ -295,14 +295,14 @@ void MultiplayerScores::show(QWidget *parent)
dialog.exec();
}
-QDataStream &operator <<(QDataStream &s, const MultiplayerScores &score)
+TQDataStream &operator <<(TQDataStream &s, const MultiplayerScores &score)
{
s << score._scores;
s << score._nbGames;
return s;
}
-QDataStream &operator >>(QDataStream &s, MultiplayerScores &score)
+TQDataStream &operator >>(TQDataStream &s, MultiplayerScores &score)
{
s >> score._scores;
s >> score._nbGames;
diff --git a/libkdegames/highscore/kexthighscore_item.h b/libkdegames/highscore/kexthighscore_item.h
index 0200fabd..ff067bd2 100644
--- a/libkdegames/highscore/kexthighscore_item.h
+++ b/libkdegames/highscore/kexthighscore_item.h
@@ -20,10 +20,10 @@
#ifndef KEXTHIGHSCORE_ITEM_H
#define KEXTHIGHSCORE_ITEM_H
-#include <qvariant.h>
-#include <qnamespace.h>
-#include <qmap.h>
-#include <qvaluevector.h>
+#include <tqvariant.h>
+#include <tqnamespace.h>
+#include <tqmap.h>
+#include <tqvaluevector.h>
#include <kdemacros.h>
class QWidget;
@@ -75,14 +75,14 @@ class KDE_EXPORT Item
/**
* Constructor.
*
- * @param def default value ; the QVariant also gives the type of data.
+ * @param def default value ; the TQVariant also gives the type of data.
* Be sure to cast the value to the required type (for e.g. with uint).
* @param label the label corresponding to the item. If empty, the item
* is not shown.
* @param alignment the alignment of the item.
*/
- Item(const QVariant &def = QVariant::Invalid,
- const QString &label = QString::null, int alignment = Qt::AlignRight);
+ Item(const TQVariant &def = TQVariant::Invalid,
+ const TQString &label = TQString::null, int alignment = Qt::AlignRight);
virtual ~Item();
@@ -106,12 +106,12 @@ class KDE_EXPORT Item
/**
* Set the label.
*/
- void setLabel(const QString &label) { _label = label; }
+ void setLabel(const TQString &label) { _label = label; }
/**
* @return the label.
*/
- QString label() const { return _label; }
+ TQString label() const { return _label; }
/**
* @return the alignment.
@@ -121,12 +121,12 @@ class KDE_EXPORT Item
/**
* Set default value.
*/
- void setDefaultValue(const QVariant &value) { _default = value; }
+ void setDefaultValue(const TQVariant &value) { _default = value; }
/**
* @return the default value.
*/
- const QVariant &defaultValue() const { return _default; }
+ const TQVariant &defaultValue() const { return _default; }
/**
* @return the converted value (by default the value is left
@@ -135,7 +135,7 @@ class KDE_EXPORT Item
* @param i the element index ("rank" for score / "id" for player)
* @param value the value to convert
*/
- virtual QVariant read(uint i, const QVariant &value) const;
+ virtual TQVariant read(uint i, const TQVariant &value) const;
/**
* @return the string to be displayed. You may need to reimplement this
@@ -144,11 +144,11 @@ class KDE_EXPORT Item
* @param i the element index ("rank" for score / "id" for player)
* @param value the value to convert
*/
- virtual QString pretty(uint i, const QVariant &value) const;
+ virtual TQString pretty(uint i, const TQVariant &value) const;
private:
- QVariant _default;
- QString _label;
+ TQVariant _default;
+ TQString _label;
int _alignment;
Format _format;
Special _special;
@@ -156,7 +156,7 @@ class KDE_EXPORT Item
class ItemPrivate;
ItemPrivate *d;
- static QString timeFormat(uint);
+ static TQString timeFormat(uint);
};
//-----------------------------------------------------------------------------
@@ -192,14 +192,14 @@ class KDE_EXPORT Score
/**
* @return the data associated with the named Item.
*/
- const QVariant &data(const QString &name) const;
+ const TQVariant &data(const TQString &name) const;
/**
* Set the data associated with the named Item. Note that the
* value should have the type of the default value of the
* Item.
*/
- void setData(const QString &name, const QVariant &value);
+ void setData(const TQString &name, const TQVariant &value);
/**
* @return the score value.
@@ -230,19 +230,19 @@ class KDE_EXPORT Score
private:
ScoreType _type;
- QMap<QString, QVariant> _data;
+ TQMap<TQString, TQVariant> _data;
class ScorePrivate;
ScorePrivate *d;
friend class MultiplayerScores;
- friend QDataStream &operator <<(QDataStream &stream, const Score &score);
- friend QDataStream &operator >>(QDataStream &stream, Score &score);
+ friend TQDataStream &operator <<(TQDataStream &stream, const Score &score);
+ friend TQDataStream &operator >>(TQDataStream &stream, Score &score);
};
-KDE_EXPORT QDataStream &operator <<(QDataStream &stream, const Score &score);
-KDE_EXPORT QDataStream &operator >>(QDataStream &stream, Score &score);
+KDE_EXPORT TQDataStream &operator <<(TQDataStream &stream, const Score &score);
+KDE_EXPORT TQDataStream &operator >>(TQDataStream &stream, Score &score);
/**
* This class is used to store and show scores for multiplayer games.
@@ -279,7 +279,7 @@ class KDE_EXPORT MultiplayerScores
/**
* Set the name of player.
*/
- void setName(uint player, const QString &name);
+ void setName(uint player, const TQString &name);
/**
* Add the score of player.
@@ -294,23 +294,23 @@ class KDE_EXPORT MultiplayerScores
/**
* Show scores.
*/
- void show(QWidget *parent);
+ void show(TQWidget *parent);
private:
- QValueVector<uint> _nbGames;
- QValueVector<Score> _scores;
+ TQValueVector<uint> _nbGames;
+ TQValueVector<Score> _scores;
class MultiplayerScoresPrivate;
MultiplayerScoresPrivate *d;
- friend QDataStream &operator <<(QDataStream &stream,
+ friend TQDataStream &operator <<(TQDataStream &stream,
const MultiplayerScores &score);
- friend QDataStream &operator >>(QDataStream &stream,
+ friend TQDataStream &operator >>(TQDataStream &stream,
MultiplayerScores &score);
};
-KDE_EXPORT QDataStream &operator <<(QDataStream &stream, const MultiplayerScores &score);
-KDE_EXPORT QDataStream &operator >>(QDataStream &stream, MultiplayerScores &score);
+KDE_EXPORT TQDataStream &operator <<(TQDataStream &stream, const MultiplayerScores &score);
+KDE_EXPORT TQDataStream &operator >>(TQDataStream &stream, MultiplayerScores &score);
} // namespace
diff --git a/libkdegames/highscore/kexthighscore_tab.cpp b/libkdegames/highscore/kexthighscore_tab.cpp
index 3e9cbe8a..3b2b5852 100644
--- a/libkdegames/highscore/kexthighscore_tab.cpp
+++ b/libkdegames/highscore/kexthighscore_tab.cpp
@@ -20,11 +20,11 @@
#include "kexthighscore_tab.h"
#include "kexthighscore_tab.moc"
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qvgroupbox.h>
-#include <qgrid.h>
-#include <qheader.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqvgroupbox.h>
+#include <tqgrid.h>
+#include <tqheader.h>
#include <kdialogbase.h>
#include <klistview.h>
@@ -39,14 +39,14 @@ namespace KExtHighscore
{
//-----------------------------------------------------------------------------
-PlayersCombo::PlayersCombo(QWidget *parent, const char *name)
- : QComboBox(parent, name)
+PlayersCombo::PlayersCombo(TQWidget *parent, const char *name)
+ : TQComboBox(parent, name)
{
const PlayerInfos &p = internal->playerInfos();
for (uint i = 0; i<p.nbEntries(); i++)
insertItem(p.prettyName(i));
- insertItem(QString("<") + i18n("all") + '>');
- connect(this, SIGNAL(activated(int)), SLOT(activatedSlot(int)));
+ insertItem(TQString("<") + i18n("all") + '>');
+ connect(this, TQT_SIGNAL(activated(int)), TQT_SLOT(activatedSlot(int)));
}
void PlayersCombo::activatedSlot(int i)
@@ -65,19 +65,19 @@ void PlayersCombo::load()
}
//-----------------------------------------------------------------------------
-AdditionalTab::AdditionalTab(QWidget *parent, const char *name)
- : QWidget(parent, name)
+AdditionalTab::AdditionalTab(TQWidget *parent, const char *name)
+ : TQWidget(parent, name)
{
- QVBoxLayout *top = new QVBoxLayout(this, KDialogBase::marginHint(),
+ TQVBoxLayout *top = new TQVBoxLayout(this, KDialogBase::marginHint(),
KDialogBase::spacingHint());
- QHBoxLayout *hbox = new QHBoxLayout(top);
- QLabel *label = new QLabel(i18n("Select player:"), this);
+ TQHBoxLayout *hbox = new TQHBoxLayout(top);
+ TQLabel *label = new TQLabel(i18n("Select player:"), this);
hbox->addWidget(label);
_combo = new PlayersCombo(this);
- connect(_combo, SIGNAL(playerSelected(uint)),
- SLOT(playerSelected(uint)));
- connect(_combo, SIGNAL(allSelected()), SLOT(allSelected()));
+ connect(_combo, TQT_SIGNAL(playerSelected(uint)),
+ TQT_SLOT(playerSelected(uint)));
+ connect(_combo, TQT_SIGNAL(allSelected()), TQT_SLOT(allSelected()));
hbox->addWidget(_combo);
hbox->addStretch(1);
}
@@ -94,11 +94,11 @@ void AdditionalTab::allSelected()
display(internal->playerInfos().nbEntries());
}
-QString AdditionalTab::percent(uint n, uint total, bool withBraces)
+TQString AdditionalTab::percent(uint n, uint total, bool withBraces)
{
- if ( n==0 || total==0 ) return QString::null;
- QString s = QString("%1%").arg(100.0 * n / total, 0, 'f', 1);
- return (withBraces ? QString("(") + s + ")" : s);
+ if ( n==0 || total==0 ) return TQString::null;
+ TQString s = TQString("%1%").arg(100.0 * n / total, 0, 'f', 1);
+ return (withBraces ? TQString("(") + s + ")" : s);
}
void AdditionalTab::load()
@@ -116,32 +116,32 @@ const char *StatisticsTab::TREND_LABELS[Nb_Trends] = {
I18N_NOOP("Current:"), I18N_NOOP("Max won:"), I18N_NOOP("Max lost:")
};
-StatisticsTab::StatisticsTab(QWidget *parent)
+StatisticsTab::StatisticsTab(TQWidget *parent)
: AdditionalTab(parent, "statistics_tab")
{
// construct GUI
- QVBoxLayout *top = static_cast<QVBoxLayout *>(layout());
+ TQVBoxLayout *top = static_cast<TQVBoxLayout *>(layout());
- QHBoxLayout *hbox = new QHBoxLayout(top);
- QVBoxLayout *vbox = new QVBoxLayout(hbox);
- QVGroupBox *group = new QVGroupBox(i18n("Game Counts"), this);
+ TQHBoxLayout *hbox = new TQHBoxLayout(top);
+ TQVBoxLayout *vbox = new TQVBoxLayout(hbox);
+ TQVGroupBox *group = new TQVGroupBox(i18n("Game Counts"), this);
vbox->addWidget(group);
- QGrid *grid = new QGrid(3, group);
+ TQGrid *grid = new TQGrid(3, group);
grid->setSpacing(KDialogBase::spacingHint());
for (uint k=0; k<Nb_Counts; k++) {
if ( Count(k)==Draw && !internal->showDrawGames ) continue;
- (void)new QLabel(i18n(COUNT_LABELS[k]), grid);
- _nbs[k] = new QLabel(grid);
- _percents[k] = new QLabel(grid);
+ (void)new TQLabel(i18n(COUNT_LABELS[k]), grid);
+ _nbs[k] = new TQLabel(grid);
+ _percents[k] = new TQLabel(grid);
}
- group = new QVGroupBox(i18n("Trends"), this);
+ group = new TQVGroupBox(i18n("Trends"), this);
vbox->addWidget(group);
- grid = new QGrid(2, group);
+ grid = new TQGrid(2, group);
grid->setSpacing(KDialogBase::spacingHint());
for (uint k=0; k<Nb_Trends; k++) {
- (void)new QLabel(i18n(TREND_LABELS[k]), grid);
- _trends[k] = new QLabel(grid);
+ (void)new TQLabel(i18n(TREND_LABELS[k]), grid);
+ _trends[k] = new TQLabel(grid);
}
hbox->addStretch(1);
@@ -182,9 +182,9 @@ void StatisticsTab::load()
init();
}
-QString StatisticsTab::percent(const Data &d, Count count) const
+TQString StatisticsTab::percent(const Data &d, Count count) const
{
- if ( count==Total ) return QString::null;
+ if ( count==Total ) return TQString::null;
return AdditionalTab::percent(d.count[count], d.count[Total], true);
}
@@ -193,26 +193,26 @@ void StatisticsTab::display(uint i)
const Data &d = _data[i];
for (uint k=0; k<Nb_Counts; k++) {
if ( Count(k) && !internal->showDrawGames ) continue;
- _nbs[k]->setText(QString::number(d.count[k]));
+ _nbs[k]->setText(TQString::number(d.count[k]));
_percents[k]->setText(percent(d, Count(k)));
}
for (uint k=0; k<Nb_Trends; k++) {
- QString s;
+ TQString s;
if ( d.trend[k]>0 ) s = '+';
int prec = (i==internal->playerInfos().nbEntries() ? 1 : 0);
- _trends[k]->setText(s + QString::number(d.trend[k], 'f', prec));
+ _trends[k]->setText(s + TQString::number(d.trend[k], 'f', prec));
}
}
//-----------------------------------------------------------------------------
-HistogramTab::HistogramTab(QWidget *parent)
+HistogramTab::HistogramTab(TQWidget *parent)
: AdditionalTab(parent, "histogram_tab")
{
// construct GUI
- QVBoxLayout *top = static_cast<QVBoxLayout *>(layout());
+ TQVBoxLayout *top = static_cast<TQVBoxLayout *>(layout());
_list = new KListView(this);
- _list->setSelectionMode(QListView::NoSelection);
+ _list->setSelectionMode(TQListView::NoSelection);
_list->setItemMargin(3);
_list->setAllColumnsShowFocus(true);
_list->setSorting(-1);
@@ -225,14 +225,14 @@ HistogramTab::HistogramTab(QWidget *parent)
_list->addColumn(i18n("Count"));
_list->addColumn(i18n("Percent"));
for (uint i=0; i<4; i++) _list->setColumnAlignment(i, AlignRight);
- _list->addColumn(QString::null);
+ _list->addColumn(TQString::null);
const Item *sitem = internal->scoreInfos().item("score")->item();
const PlayerInfos &pi = internal->playerInfos();
- const QMemArray<uint> &sh = pi.histogram();
+ const TQMemArray<uint> &sh = pi.histogram();
for (uint k=1; k<pi.histoSize(); k++) {
- QString s1 = sitem->pretty(0, sh[k-1]);
- QString s2;
+ TQString s1 = sitem->pretty(0, sh[k-1]);
+ TQString s2;
if ( k==sh.size() ) s2 = "...";
else if ( sh[k]!=sh[k-1]+1 ) s2 = sitem->pretty(0, sh[k]);
(void)new KListViewItem(_list, s1, s2);
@@ -264,14 +264,14 @@ void HistogramTab::load()
void HistogramTab::display(uint i)
{
const PlayerInfos &pi = internal->playerInfos();
- QListViewItem *item = _list->firstChild();
+ TQListViewItem *item = _list->firstChild();
uint s = pi.histoSize() - 1;
for (int k=s-1; k>=0; k--) {
uint nb = _counts[i*s + k];
- item->setText(2, QString::number(nb));
+ item->setText(2, TQString::number(nb));
item->setText(3, percent(nb, _data[i]));
uint width = (_data[i]==0 ? 0 : qRound(150.0 * nb / _data[i]));
- QPixmap pixmap(width, 10);
+ TQPixmap pixmap(width, 10);
pixmap.fill(blue);
item->setPixmap(4, pixmap);
item = item->nextSibling();
diff --git a/libkdegames/highscore/kexthighscore_tab.h b/libkdegames/highscore/kexthighscore_tab.h
index ce47a75f..3d31bc95 100644
--- a/libkdegames/highscore/kexthighscore_tab.h
+++ b/libkdegames/highscore/kexthighscore_tab.h
@@ -20,8 +20,8 @@
#ifndef KEXTHIGHSCORE_TAB_H
#define KEXTHIGHSCORE_TAB_H
-#include <qcombobox.h>
-#include <qmemarray.h>
+#include <tqcombobox.h>
+#include <tqmemarray.h>
class QLabel;
class KListView;
@@ -35,7 +35,7 @@ class PlayersCombo : public QComboBox
{
Q_OBJECT
public:
- PlayersCombo(QWidget *parent = 0, const char *name = 0);
+ PlayersCombo(TQWidget *parent = 0, const char *name = 0);
void load();
@@ -53,7 +53,7 @@ class AdditionalTab : public QWidget
{
Q_OBJECT
public:
- AdditionalTab(QWidget *parent, const char *name);
+ AdditionalTab(TQWidget *parent, const char *name);
virtual void load();
@@ -63,7 +63,7 @@ class AdditionalTab : public QWidget
protected:
void init();
- static QString percent(uint n, uint total, bool withBraces = false);
+ static TQString percent(uint n, uint total, bool withBraces = false);
virtual void display(uint i) = 0;
private:
@@ -75,7 +75,7 @@ class StatisticsTab : public AdditionalTab
{
Q_OBJECT
public:
- StatisticsTab(QWidget *parent);
+ StatisticsTab(TQWidget *parent);
void load();
@@ -88,10 +88,10 @@ class StatisticsTab : public AdditionalTab
uint count[Nb_Counts];
double trend[Nb_Trends];
};
- QMemArray<Data> _data;
- QLabel *_nbs[Nb_Counts], *_percents[Nb_Counts], *_trends[Nb_Trends];
+ TQMemArray<Data> _data;
+ TQLabel *_nbs[Nb_Counts], *_percents[Nb_Counts], *_trends[Nb_Trends];
- QString percent(const Data &, Count) const;
+ TQString percent(const Data &, Count) const;
void display(uint i);
};
@@ -100,13 +100,13 @@ class HistogramTab : public AdditionalTab
{
Q_OBJECT
public:
- HistogramTab(QWidget *parent);
+ HistogramTab(TQWidget *parent);
void load();
private:
- QMemArray<uint> _counts;
- QMemArray<uint> _data;
+ TQMemArray<uint> _counts;
+ TQMemArray<uint> _data;
KListView *_list;
void display(uint i);
diff --git a/libkdegames/highscore/khighscore.cpp b/libkdegames/highscore/khighscore.cpp
index 4e1f68e5..26bb47c3 100644
--- a/libkdegames/highscore/khighscore.cpp
+++ b/libkdegames/highscore/khighscore.cpp
@@ -46,7 +46,7 @@ class KHighscorePrivate
public:
KHighscorePrivate() {}
- QString group;
+ TQString group;
bool global;
};
@@ -56,14 +56,14 @@ static KStaticDeleter<KFileLock> lockSD;
static KStaticDeleter<KRawConfig> configSD;
-KHighscore::KHighscore(QObject* parent)
- : QObject(parent)
+KHighscore::KHighscore(TQObject* parent)
+ : TQObject(parent)
{
init(true);
}
-KHighscore::KHighscore(bool forceLocal, QObject* parent)
- : QObject(parent)
+KHighscore::KHighscore(bool forceLocal, TQObject* parent)
+ : TQObject(parent)
{
init(forceLocal);
}
@@ -95,7 +95,7 @@ void KHighscore::readCurrentConfig()
void KHighscore::init(const char *appname)
{
#ifdef HIGHSCORE_DIRECTORY
- const QString filename = QString::fromLocal8Bit("%1/%2.scores")
+ const TQString filename = TQString::fromLocal8Bit("%1/%2.scores")
.arg(HIGHSCORE_DIRECTORY).arg(appname);
int fd = open(filename.local8Bit(), O_RDWR);
if ( fd<0 ) kdFatal(11002) << "cannot open global highscore file \""
@@ -111,7 +111,7 @@ void KHighscore::init(const char *appname)
#endif
}
-bool KHighscore::lockForWriting(QWidget *widget)
+bool KHighscore::lockForWriting(TQWidget *widget)
{
if ( isLocked() ) return true;
@@ -132,7 +132,7 @@ bool KHighscore::lockForWriting(QWidget *widget)
if ( !first ) {
KGuiItem item = KStdGuiItem::cont();
item.setText(i18n("Retry"));
- int res = KMessageBox::warningContinueCancel(widget, i18n("Cannot access the highscore file. Another user is probably currently writing to it."), QString::null, item, "ask_lock_global_highscore_file");
+ int res = KMessageBox::warningContinueCancel(widget, i18n("Cannot access the highscore file. Another user is probably currently writing to it."), TQString::null, item, "ask_lock_global_highscore_file");
if ( res==KMessageBox::Cancel ) break;
} else sleep(1);
first = false;
@@ -165,90 +165,90 @@ KConfig* KHighscore::config() const
return (d->global ? _config : kapp->config());
}
-void KHighscore::writeEntry(int entry, const QString& key, const QVariant& value)
+void KHighscore::writeEntry(int entry, const TQString& key, const TQVariant& value)
{
Q_ASSERT( isLocked() );
KConfigGroupSaver cg(config(), group());
- QString confKey = QString("%1_%2").arg(entry).arg(key);
+ TQString confKey = TQString("%1_%2").arg(entry).arg(key);
cg.config()->writeEntry(confKey, value);
}
-void KHighscore::writeEntry(int entry, const QString& key, int value)
+void KHighscore::writeEntry(int entry, const TQString& key, int value)
{
Q_ASSERT( isLocked() );
KConfigGroupSaver cg(config(), group());
- QString confKey = QString("%1_%2").arg(entry).arg(key);
+ TQString confKey = TQString("%1_%2").arg(entry).arg(key);
cg.config()->writeEntry(confKey, value);
}
-void KHighscore::writeEntry(int entry, const QString& key, const QString &value)
+void KHighscore::writeEntry(int entry, const TQString& key, const TQString &value)
{
Q_ASSERT (isLocked() );
KConfigGroupSaver cg(config(), group());
- QString confKey = QString("%1_%2").arg(entry).arg(key);
+ TQString confKey = TQString("%1_%2").arg(entry).arg(key);
cg.config()->writeEntry(confKey, value);
}
-QVariant KHighscore::readPropertyEntry(int entry, const QString& key, const QVariant& pDefault) const
+TQVariant KHighscore::readPropertyEntry(int entry, const TQString& key, const TQVariant& pDefault) const
{
KConfigGroupSaver cg(config(), group());
- QString confKey = QString("%1_%2").arg(entry).arg(key);
+ TQString confKey = TQString("%1_%2").arg(entry).arg(key);
return cg.config()->readPropertyEntry(confKey, pDefault);
}
-QString KHighscore::readEntry(int entry, const QString& key, const QString& pDefault) const
+TQString KHighscore::readEntry(int entry, const TQString& key, const TQString& pDefault) const
{
KConfigGroupSaver cg(config(), group());
- QString confKey = QString("%1_%2").arg(entry).arg(key);
+ TQString confKey = TQString("%1_%2").arg(entry).arg(key);
return cg.config()->readEntry(confKey, pDefault);
}
-int KHighscore::readNumEntry(int entry, const QString& key, int pDefault) const
+int KHighscore::readNumEntry(int entry, const TQString& key, int pDefault) const
{
KConfigGroupSaver cg(config(), group());
- QString confKey = QString("%1_%2").arg(entry).arg(key);
+ TQString confKey = TQString("%1_%2").arg(entry).arg(key);
return cg.config()->readNumEntry(confKey, pDefault);
}
-bool KHighscore::hasEntry(int entry, const QString& key) const
+bool KHighscore::hasEntry(int entry, const TQString& key) const
{
KConfigGroupSaver cg(config(), group());
- QString confKey = QString("%1_%2").arg(entry).arg(key);
+ TQString confKey = TQString("%1_%2").arg(entry).arg(key);
return cg.config()->hasKey(confKey);
}
-QStringList KHighscore::readList(const QString& key, int lastEntry) const
+TQStringList KHighscore::readList(const TQString& key, int lastEntry) const
{
- QStringList list;
+ TQStringList list;
for (int i = 1; hasEntry(i, key) && ((lastEntry > 0) ? (i <= lastEntry) : true); i++) {
list.append(readEntry(i, key));
}
return list;
}
-void KHighscore::writeList(const QString& key, const QStringList& list)
+void KHighscore::writeList(const TQString& key, const TQStringList& list)
{
for (int unsigned i = 1; i <= list.count(); i++) {
writeEntry(i, key, list[i - 1]);
}
}
-void KHighscore::setHighscoreGroup(const QString& group)
+void KHighscore::setHighscoreGroup(const TQString& group)
{
d->group = group;
}
-const QString& KHighscore::highscoreGroup() const
+const TQString& KHighscore::highscoreGroup() const
{
return d->group;
}
-QString KHighscore::group() const
+TQString KHighscore::group() const
{
if ( highscoreGroup().isNull() )
- return (d->global ? QString::null : GROUP);
+ return (d->global ? TQString::null : GROUP);
return (d->global ? highscoreGroup()
- : QString("%1_%2").arg(GROUP).arg(highscoreGroup()));
+ : TQString("%1_%2").arg(GROUP).arg(highscoreGroup()));
}
bool KHighscore::hasTable() const
diff --git a/libkdegames/highscore/khighscore.h b/libkdegames/highscore/khighscore.h
index b1e3d25f..42c9fcda 100644
--- a/libkdegames/highscore/khighscore.h
+++ b/libkdegames/highscore/khighscore.h
@@ -23,8 +23,8 @@
#ifndef __KHIGHSCORE_H__
#define __KHIGHSCORE_H__
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include <kdemacros.h>
class KConfig;
class KFileLock;
@@ -67,7 +67,7 @@ class KHighscorePrivate;
* single player, so the "best times" of a player. To write highscores for a
* specific player in a specific level you will have to use a more complex way:
* \code
- * QString group = QString("%1_%2").arg(player).arg(level);
+ * TQString group = TQString("%1_%2").arg(player).arg(level);
* table->setGroup(group);
* writeHighscore(table, player, level);
* \endcode
@@ -76,7 +76,7 @@ class KHighscorePrivate;
* don't use i18n() for the keys or groups! Here is the code to read the above
* written entry:
* \code
- * QString firstName = highscore->readEntry(0, "name");
+ * TQString firstName = highscore->readEntry(0, "name");
* \endcode
* Easy, what?
* @author Andreas Beckermann <[email protected]>
@@ -89,7 +89,7 @@ public:
* Constructor. The highscore file is forced to be local to support
* games using the old behaviour.
*/
- KHighscore(QObject* parent = 0);
+ KHighscore(TQObject* parent = 0);
/**
* Constructor.
@@ -100,7 +100,7 @@ public:
* @param parent parent widget for this widget
* @since 3.2
*/
- KHighscore(bool forceLocal, QObject *parent);
+ KHighscore(bool forceLocal, TQObject *parent);
/**
* Read the current state of the highscore file. Remember that when
@@ -137,7 +137,7 @@ public:
* @return false on error or if the config file is locked by another
* process. In such case, the config stays read-only.
*/
- bool lockForWriting(QWidget *widget = 0);
+ bool lockForWriting(TQWidget *widget = 0);
/**
* Effectively write and unlock the system-wide highscore file
@@ -167,20 +167,20 @@ public:
* are prefixed with the entry number
* @param value The value of this entry
**/
- void writeEntry(int entry, const QString& key, const QString& value);
+ void writeEntry(int entry, const TQString& key, const TQString& value);
/**
* This is an overloaded member function, provided for convenience.
* It differs from the above function only in what argument(s) it accepts.
**/
- void writeEntry(int entry, const QString& key, int value);
+ void writeEntry(int entry, const TQString& key, int value);
/**
* This is an overloaded member function, provided for convenience.
* It differs from the above function only in what argument(s) it accepts.
- * See KConfigBase documentation for allowed QVariant::Type.
+ * See KConfigBase documentation for allowed TQVariant::Type.
**/
- void writeEntry(int entry, const QString& key, const QVariant &value);
+ void writeEntry(int entry, const TQString& key, const TQVariant &value);
/**
* Reads an entry from the highscore table.
@@ -193,7 +193,7 @@ public:
* @return The value of this entry+key pair or pDefault if the entry+key
* pair doesn't exist
**/
- QString readEntry(int entry, const QString& key, const QString& pDefault = QString::null) const;
+ TQString readEntry(int entry, const TQString& key, const TQString& pDefault = TQString::null) const;
/**
* Read a numeric value.
@@ -206,22 +206,22 @@ public:
* @return The value of this entry+key pair or pDefault if the entry+key
* pair doesn't exist
**/
- int readNumEntry(int entry, const QString& key, int pDefault = -1) const;
+ int readNumEntry(int entry, const TQString& key, int pDefault = -1) const;
/**
- * Read a QVariant entry.
- * See KConfigBase documentation for allowed QVariant::Type.
+ * Read a TQVariant entry.
+ * See KConfigBase documentation for allowed TQVariant::Type.
*
* @return the value of this entry+key pair or pDefault if the entry+key
* pair doesn't exist or
*/
- QVariant readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const;
+ TQVariant readPropertyEntry(int entry, const TQString &key, const TQVariant &pDefault) const;
/**
* @return True if the highscore table conatins the entry/key pair,
* otherwise false
**/
- bool hasEntry(int entry, const QString& key) const;
+ bool hasEntry(int entry, const TQString& key) const;
/**
* Reads a list of entries from the highscore table starting at 1 until
@@ -240,7 +240,7 @@ public:
* 20 entries. If lastEntry is <= 0 then rading is only stopped when when an
* entry does not exist.
**/
- QStringList readList(const QString& key, int lastEntry = 20) const;
+ TQStringList readList(const TQString& key, int lastEntry = 20) const;
/**
* Writes a list of entries to the highscore table.
@@ -253,7 +253,7 @@ public:
* are prefixed with the entry number
* @param list The list of values
**/
- void writeList(const QString& key, const QStringList& list);
+ void writeList(const TQString& key, const TQStringList& list);
/**
* @return Whether a highscore table exists. You can use this
@@ -273,24 +273,24 @@ public:
* Set the new highscore group. The group is being prefixed with
* "KHighscore_" in the table.
* @param groupname The new groupname. E.g. use "easy" for the easy
- * level of your game. If you use QString::null (the default) the
+ * level of your game. If you use TQString::null (the default) the
* default group is used.
**/
- void setHighscoreGroup(const QString& groupname = QString::null);
+ void setHighscoreGroup(const TQString& groupname = TQString::null);
/**
* @return The currently used group. This doesn't contain the prefix
* ("KHighscore_") but the same as setHighscoreGroup uses. The
- * default is QString::null
+ * default is TQString::null
**/
- const QString& highscoreGroup() const;
+ const TQString& highscoreGroup() const;
protected:
/**
* @return A groupname to be used in KConfig. Used internally to
* prefix the value from highscoreGroup() with "KHighscore_"
**/
- QString group() const;
+ TQString group() const;
/**
* @return A pointer to the KConfig object to be used. This is
diff --git a/libkdegames/highscore/kscoredialog.cpp b/libkdegames/highscore/kscoredialog.cpp
index 37155650..7bed0c6b 100644
--- a/libkdegames/highscore/kscoredialog.cpp
+++ b/libkdegames/highscore/kscoredialog.cpp
@@ -24,13 +24,13 @@ this software.
#include "config.h"
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qwidgetstack.h>
-#include <qtimer.h>
-#include <qevent.h>
-#include <qptrvector.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqwidgetstack.h>
+#include <tqtimer.h>
+#include <tqevent.h>
+#include <tqptrvector.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -42,29 +42,29 @@ this software.
class KScoreDialog::KScoreDialogPrivate
{
public:
- QPtrList<FieldInfo> scores;
- QWidget *page;
- QGridLayout *layout;
- QLineEdit *edit;
- QPtrVector<QWidgetStack> stack;
- QPtrVector<QLabel> labels;
- QLabel *commentLabel;
- QString comment;
+ TQPtrList<FieldInfo> scores;
+ TQWidget *page;
+ TQGridLayout *layout;
+ TQLineEdit *edit;
+ TQPtrVector<TQWidgetStack> stack;
+ TQPtrVector<TQLabel> labels;
+ TQLabel *commentLabel;
+ TQString comment;
int fields;
int newName;
int latest;
int nrCols;
bool loaded;
- QString configGroup;
+ TQString configGroup;
- QMap<int, int> col;
- QMap<int, QString> header;
- QMap<int, QString> key;
- QString player;
+ TQMap<int, int> col;
+ TQMap<int, TQString> header;
+ TQMap<int, TQString> key;
+ TQString player;
};
-KScoreDialog::KScoreDialog(int fields, QWidget *parent, const char *oname)
+KScoreDialog::KScoreDialog(int fields, TQWidget *parent, const char *oname)
: KDialogBase(parent, oname, true, i18n("High Scores"), Ok, Ok, true)
{
d = new KScoreDialogPrivate();
@@ -90,7 +90,7 @@ KScoreDialog::KScoreDialog(int fields, QWidget *parent, const char *oname)
d->key[Score] = "Score";
d->page = makeMainWidget();
- connect(this, SIGNAL(okClicked()), SLOT(slotGotName()));
+ connect(this, TQT_SIGNAL(okClicked()), TQT_SLOT(slotGotName()));
}
KScoreDialog::~KScoreDialog()
@@ -98,18 +98,18 @@ KScoreDialog::~KScoreDialog()
delete d;
}
-void KScoreDialog::setConfigGroup(const QString &group)
+void KScoreDialog::setConfigGroup(const TQString &group)
{
d->configGroup = group;
d->loaded = false;
}
-void KScoreDialog::setComment(const QString &comment)
+void KScoreDialog::setComment(const TQString &comment)
{
d->comment = comment;
}
-void KScoreDialog::addField(int field, const QString &header, const QString &key)
+void KScoreDialog::addField(int field, const TQString &header, const TQString &key)
{
d->fields |= field;
d->header[field] = header;
@@ -126,19 +126,19 @@ void KScoreDialog::setupDialog()
d->col[field] = d->nrCols++;
}
- d->layout = new QGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint());
+ d->layout = new TQGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint());
d->layout->addRowSpacing(4, 15);
- d->commentLabel = new QLabel(d->page);
+ d->commentLabel = new TQLabel(d->page);
d->commentLabel->setAlignment(AlignVCenter | AlignHCenter);
d->layout->addMultiCellWidget(d->commentLabel, 1, 1, 0, d->nrCols-1);
- QFont bold = font();
+ TQFont bold = font();
bold.setBold(true);
- QLabel *label;
+ TQLabel *label;
d->layout->addColSpacing(0, 50);
- label = new QLabel(i18n("Rank"), d->page);
+ label = new TQLabel(i18n("Rank"), d->page);
d->layout->addWidget(label, 3, 0);
label->setFont(bold);
@@ -148,7 +148,7 @@ void KScoreDialog::setupDialog()
{
d->layout->addColSpacing(d->col[field], 50);
- label = new QLabel(d->header[field], d->page);
+ label = new TQLabel(d->header[field], d->page);
d->layout->addWidget(label, 3, d->col[field], field <= Name ? AlignLeft : AlignRight);
label->setFont(bold);
}
@@ -160,19 +160,19 @@ void KScoreDialog::setupDialog()
d->labels.resize(d->nrCols * 10);
d->stack.resize(10);
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
- QLabel *label;
+ TQLabel *label;
num.setNum(i);
- label = new QLabel(i18n("#%1").arg(num), d->page);
+ label = new TQLabel(i18n("#%1").arg(num), d->page);
d->labels.insert((i-1)*d->nrCols + 0, label);
d->layout->addWidget(label, i+4, 0);
if (d->fields & Name)
{
- QWidgetStack *stack = new QWidgetStack(d->page);
+ TQWidgetStack *stack = new TQWidgetStack(d->page);
d->stack.insert(i-1, stack);
d->layout->addWidget(stack, i+4, d->col[Name]);
- label = new QLabel(d->page);
+ label = new TQLabel(d->page);
d->labels.insert((i-1)*d->nrCols + d->col[Name], label);
stack->addWidget(label);
stack->raiseWidget(label);
@@ -181,7 +181,7 @@ void KScoreDialog::setupDialog()
{
if (d->fields & field)
{
- label = new QLabel(d->page);
+ label = new TQLabel(d->page);
d->labels.insert((i-1)*d->nrCols + d->col[field], label);
d->layout->addWidget(label, i+4, d->col[field], AlignRight);
}
@@ -200,7 +200,7 @@ void KScoreDialog::aboutToShow()
d->commentLabel->setText(d->comment);
if (d->comment.isEmpty())
{
- d->commentLabel->setMinimumSize(QSize(1,1));
+ d->commentLabel->setMinimumSize(TQSize(1,1));
d->commentLabel->hide();
d->layout->addRowSpacing(0, -15);
d->layout->addRowSpacing(2, -15);
@@ -212,15 +212,15 @@ void KScoreDialog::aboutToShow()
d->layout->addRowSpacing(0, -10);
d->layout->addRowSpacing(2, 10);
}
- d->comment = QString::null;
+ d->comment = TQString::null;
- QFont normal = font();
- QFont bold = normal;
+ TQFont normal = font();
+ TQFont bold = normal;
bold.setBold(true);
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
- QLabel *label;
+ TQLabel *label;
num.setNum(i);
FieldInfo *score = d->scores.at(i-1);
label = d->labels[(i-1)*d->nrCols + 0];
@@ -233,14 +233,14 @@ void KScoreDialog::aboutToShow()
{
if (d->newName == i)
{
- QWidgetStack *stack = d->stack[i-1];
- d->edit = new QLineEdit(d->player, stack);
+ TQWidgetStack *stack = d->stack[i-1];
+ d->edit = new TQLineEdit(d->player, stack);
d->edit->setMinimumWidth(40);
stack->addWidget(d->edit);
stack->raiseWidget(d->edit);
d->edit->setFocus();
- connect(d->edit, SIGNAL(returnPressed()),
- this, SLOT(slotGotReturn()));
+ connect(d->edit, TQT_SIGNAL(returnPressed()),
+ this, TQT_SLOT(slotGotReturn()));
}
else
{
@@ -272,14 +272,14 @@ void KScoreDialog::aboutToShow()
void KScoreDialog::loadScores()
{
- QString key, value;
+ TQString key, value;
d->loaded = true;
d->scores.clear();
KConfigGroup config(kapp->config(), d->configGroup.utf8());
d->player = config.readEntry("LastPlayer");
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
num.setNum(i);
FieldInfo *score = new FieldInfo();
@@ -297,12 +297,12 @@ void KScoreDialog::loadScores()
void KScoreDialog::saveScores()
{
- QString key, value;
+ TQString key, value;
KConfigGroup config(kapp->config(), d->configGroup.utf8());
config.writeEntry("LastPlayer", d->player);
- QString num;
+ TQString num;
for (int i = 1; i <= 10; ++i) {
num.setNum(i);
FieldInfo *score = d->scores.at(i-1);
@@ -365,7 +365,7 @@ void KScoreDialog::show()
void KScoreDialog::slotGotReturn()
{
- QTimer::singleShot(0, this, SLOT(slotGotName()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotGotName()));
}
void KScoreDialog::slotGotName()
@@ -377,10 +377,10 @@ void KScoreDialog::slotGotName()
(*d->scores.at(d->newName-1))[Name] = d->player;
saveScores();
- QFont bold = font();
+ TQFont bold = font();
bold.setBold(true);
- QLabel *label = d->labels[(d->newName-1)*d->nrCols + d->col[Name]];
+ TQLabel *label = d->labels[(d->newName-1)*d->nrCols + d->col[Name]];
label->setFont(bold);
label->setText(d->player);
d->stack[(d->newName-1)]->raiseWidget(label);
@@ -397,7 +397,7 @@ int KScoreDialog::highScore()
return (*d->scores.first())[Score].toInt();
}
-void KScoreDialog::keyPressEvent( QKeyEvent *ev)
+void KScoreDialog::keyPressEvent( TQKeyEvent *ev)
{
if ((d->newName != -1) && (ev->key() == Key_Return))
{
diff --git a/libkdegames/highscore/kscoredialog.h b/libkdegames/highscore/kscoredialog.h
index 4d4a76db..50424caa 100644
--- a/libkdegames/highscore/kscoredialog.h
+++ b/libkdegames/highscore/kscoredialog.h
@@ -25,8 +25,8 @@ this software.
#ifndef KSCOREDIALOG_H
#define KSCOREDIALOG_H
-#include <qmap.h>
-#include <qptrlist.h>
+#include <tqmap.h>
+#include <tqptrlist.h>
#include <kdialogbase.h>
#include <kdemacros.h>
@@ -52,14 +52,14 @@ public:
Time = 1 << 28,
Score = 1 << 29 };
- typedef QMap<int, QString> FieldInfo;
+ typedef TQMap<int, TQString> FieldInfo;
/**
* @param fields Which fields should be listed.
- * @param parent passed to parent QWidget constructor
- * @param name passed to parent QWidget constructor
+ * @param parent passed to parent TQWidget constructor
+ * @param name passed to parent TQWidget constructor
*/
- KScoreDialog(int fields, QWidget *parent=0, const char *name=0);
+ KScoreDialog(int fields, TQWidget *parent=0, const char *name=0);
~KScoreDialog();
@@ -67,13 +67,13 @@ public:
* @param group to use for reading/writing highscores from/to. By default
* the class will use "High Score"
*/
- void setConfigGroup(const QString &group);
+ void setConfigGroup(const TQString &group);
/**
* @param comment to add when showing high-scores.
* The comment is only used once.
*/
- void setComment(const QString &comment);
+ void setComment(const TQString &comment);
/**
* Define an extra FieldInfo entry.
@@ -81,7 +81,7 @@ public:
* @param header Header shown in the dialog for this field
* @param key used to store this field with.
*/
- void addField(int field, const QString &header, const QString &key);
+ void addField(int field, const TQString &header, const TQString &key);
/**
* Adds a new score to the list.
@@ -115,7 +115,7 @@ private:
void aboutToShow();
void setupDialog();
- void keyPressEvent( QKeyEvent *ev);
+ void keyPressEvent( TQKeyEvent *ev);
private:
class KScoreDialogPrivate;
diff --git a/libkdegames/kcanvasrootpixmap.cpp b/libkdegames/kcanvasrootpixmap.cpp
index 14592c66..5e036740 100644
--- a/libkdegames/kcanvasrootpixmap.cpp
+++ b/libkdegames/kcanvasrootpixmap.cpp
@@ -19,18 +19,18 @@
#include "kcanvasrootpixmap.h"
-#include <qcanvas.h>
+#include <tqcanvas.h>
-KCanvasRootPixmap::KCanvasRootPixmap(QCanvasView *view, const char *name)
+KCanvasRootPixmap::KCanvasRootPixmap(TQCanvasView *view, const char *name)
: KRootPixmap(view, name), _view(view)
{
setCustomPainting(true);
- connect(this, SIGNAL(backgroundUpdated(const QPixmap &)),
- SLOT(backgroundUpdatedSlot(const QPixmap &)));
+ connect(this, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)),
+ TQT_SLOT(backgroundUpdatedSlot(const TQPixmap &)));
}
-void KCanvasRootPixmap::backgroundUpdatedSlot(const QPixmap &pixmap)
+void KCanvasRootPixmap::backgroundUpdatedSlot(const TQPixmap &pixmap)
{
if ( _view && _view->canvas() )
_view->canvas()->setBackgroundPixmap(pixmap);
diff --git a/libkdegames/kcanvasrootpixmap.h b/libkdegames/kcanvasrootpixmap.h
index 3eedb7e1..2da77746 100644
--- a/libkdegames/kcanvasrootpixmap.h
+++ b/libkdegames/kcanvasrootpixmap.h
@@ -26,13 +26,13 @@
class QCanvasView;
/**
- * Implement KRootPixmap for a QCanvasView.
+ * Implement KRootPixmap for a TQCanvasView.
*
* The pixmap will be set as the background of the
- * QCanvas associated with the view :
+ * TQCanvas associated with the view :
* <ul>
* <li>for correct positioning of the background pixmap, the given
- * QCanvasView should be positioned at the origin of the canvas.</li>
+ * TQCanvasView should be positioned at the origin of the canvas.</li>
* <li>no other view of the same canvas should use KCanvasRootPixmap.</li>
* <li>other views of the canvas will have the same background pixmap.</li>
* </ul>
@@ -45,13 +45,13 @@ class KDE_EXPORT KCanvasRootPixmap : public KRootPixmap
/**
* Constructor.
*/
- KCanvasRootPixmap(QCanvasView *view, const char *name = 0);
+ KCanvasRootPixmap(TQCanvasView *view, const char *name = 0);
private slots:
- void backgroundUpdatedSlot(const QPixmap &);
+ void backgroundUpdatedSlot(const TQPixmap &);
private:
- QCanvasView *_view;
+ TQCanvasView *_view;
class KCanvasRootPixmapPrivate;
KCanvasRootPixmapPrivate *d;
diff --git a/libkdegames/kcarddialog.cpp b/libkdegames/kcarddialog.cpp
index a4d2ac20..73011c9a 100644
--- a/libkdegames/kcarddialog.cpp
+++ b/libkdegames/kcarddialog.cpp
@@ -23,13 +23,13 @@
#include <stdio.h>
#include <assert.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qslider.h>
-#include <qwmatrix.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqslider.h>
+#include <tqwmatrix.h>
#include <kapplication.h>
#include <klocale.h>
@@ -38,12 +38,12 @@
#include <ksimpleconfig.h>
#include "kcarddialog.h"
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include <kdebug.h>
-#define KCARD_DEFAULTDECK QString::fromLatin1("deck0.png")
-#define KCARD_DEFAULTCARD QString::fromLatin1("11.png")
-#define KCARD_DEFAULTCARDDIR QString::fromLatin1("cards-default/")
+#define KCARD_DEFAULTDECK TQString::fromLatin1("deck0.png")
+#define KCARD_DEFAULTCARD TQString::fromLatin1("11.png")
+#define KCARD_DEFAULTCARDDIR TQString::fromLatin1("cards-default/")
// values for the resize slider
#define SLIDER_MIN 400
@@ -51,19 +51,19 @@
// KConfig entries
#define CONF_GROUP "KCardDialog"
-#define CONF_RANDOMDECK QString::fromLatin1("RandomDeck")
-#define CONF_DECK QString::fromLatin1("Deck")
-#define CONF_CARDDIR QString::fromLatin1("CardDir")
-#define CONF_RANDOMCARDDIR QString::fromLatin1("RandomCardDir")
-#define CONF_USEGLOBALDECK QString::fromLatin1("GlobalDeck")
-#define CONF_USEGLOBALCARDDIR QString::fromLatin1("GlobalCardDir")
-#define CONF_SCALE QString::fromLatin1("Scale")
+#define CONF_RANDOMDECK TQString::fromLatin1("RandomDeck")
+#define CONF_DECK TQString::fromLatin1("Deck")
+#define CONF_CARDDIR TQString::fromLatin1("CardDir")
+#define CONF_RANDOMCARDDIR TQString::fromLatin1("RandomCardDir")
+#define CONF_USEGLOBALDECK TQString::fromLatin1("GlobalDeck")
+#define CONF_USEGLOBALCARDDIR TQString::fromLatin1("GlobalCardDir")
+#define CONF_SCALE TQString::fromLatin1("Scale")
-#define CONF_GLOBAL_GROUP QString::fromLatin1("KCardDialog Settings")
-#define CONF_GLOBAL_DECK QString::fromLatin1("GlobalDeck")
-#define CONF_GLOBAL_CARDDIR QString::fromLatin1("GlobalCardDir")
-#define CONF_GLOBAL_RANDOMDECK QString::fromLatin1("GlobalRandomDeck")
-#define CONF_GLOBAL_RANDOMCARDDIR QString::fromLatin1("GlobalRandomCardDir")
+#define CONF_GLOBAL_GROUP TQString::fromLatin1("KCardDialog Settings")
+#define CONF_GLOBAL_DECK TQString::fromLatin1("GlobalDeck")
+#define CONF_GLOBAL_CARDDIR TQString::fromLatin1("GlobalCardDir")
+#define CONF_GLOBAL_RANDOMDECK TQString::fromLatin1("GlobalRandomDeck")
+#define CONF_GLOBAL_RANDOMCARDDIR TQString::fromLatin1("GlobalRandomCardDir")
class KCardDialogPrivate
@@ -85,31 +85,31 @@ public:
cScale = 1;
}
- QLabel* deckLabel;
- QLabel* cardLabel;
+ TQLabel* deckLabel;
+ TQLabel* cardLabel;
KIconView* deckIconView;
KIconView* cardIconView;
- QCheckBox* randomDeck;
- QCheckBox* randomCardDir;
- QCheckBox* globalDeck;
- QCheckBox* globalCardDir;
+ TQCheckBox* randomDeck;
+ TQCheckBox* randomCardDir;
+ TQCheckBox* globalDeck;
+ TQCheckBox* globalCardDir;
- QSlider* scaleSlider;
- QPixmap cPreviewPix;
- QLabel* cPreview;
+ TQSlider* scaleSlider;
+ TQPixmap cPreviewPix;
+ TQLabel* cPreview;
- QMap<QIconViewItem*, QString> deckMap;
- QMap<QIconViewItem*, QString> cardMap;
- QMap<QString, QString> helpMap;
+ TQMap<TQIconViewItem*, TQString> deckMap;
+ TQMap<TQIconViewItem*, TQString> cardMap;
+ TQMap<TQString, TQString> helpMap;
//set query variables
KCardDialog::CardFlags cFlags;
- QString cDeck;
- QString cCardDir;
+ TQString cDeck;
+ TQString cCardDir;
double cScale;
};
-int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent,
+int KCardDialog::getCardDeck(TQString &pDeck, TQString &pCardDir, TQWidget *pParent,
CardFlags pFlags, bool* pRandomDeck, bool* pRandomCardDir,
double* pScale, KConfig* pConf)
{
@@ -123,14 +123,14 @@ int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent
dlg.showRandomDeckBox(pRandomDeck != 0);
dlg.showRandomCardDirBox(pRandomCardDir != 0);
int result=dlg.exec();
- if (result==QDialog::Accepted)
+ if (result==TQDialog::Accepted)
{
// TODO check for global cards/decks!!!!
pDeck=dlg.deck();
pCardDir=dlg.cardDir();
- if (!pCardDir.isNull() && pCardDir.right(1)!=QString::fromLatin1("/"))
+ if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::fromLatin1("/"))
{
- pCardDir+=QString::fromLatin1("/");
+ pCardDir+=TQString::fromLatin1("/");
}
if (pRandomDeck)
{
@@ -176,13 +176,13 @@ int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent
return result;
}
-void KCardDialog::getConfigCardDeck(KConfig* conf, QString &pDeck, QString &pCardDir, double& pScale)
+void KCardDialog::getConfigCardDeck(KConfig* conf, TQString &pDeck, TQString &pCardDir, double& pScale)
{
// TODO check for global cards/decks!!!!
if (!conf) {
return;
}
- QString origGroup = conf->group();
+ TQString origGroup = conf->group();
conf->setGroup(CONF_GROUP);
if (conf->readBoolEntry(CONF_RANDOMDECK) || !conf->hasKey(CONF_DECK)) {
@@ -215,39 +215,39 @@ void KCardDialog::getConfigCardDeck(KConfig* conf, QString &pDeck, QString &pCar
conf->setGroup(origGroup);
}
-QString KCardDialog::getDefaultDeck()
+TQString KCardDialog::getDefaultDeck()
{
KCardDialog::init();
- return locate("cards", QString::fromLatin1("decks/") + KCARD_DEFAULTDECK);
+ return locate("cards", TQString::fromLatin1("decks/") + KCARD_DEFAULTDECK);
}
-QString KCardDialog::getDefaultCardDir()
+TQString KCardDialog::getDefaultCardDir()
{
KCardDialog::init();
- QString file = KCARD_DEFAULTCARDDIR + KCARD_DEFAULTCARD;
+ TQString file = KCARD_DEFAULTCARDDIR + KCARD_DEFAULTCARD;
return KGlobal::dirs()->findResourceDir("cards",file) + KCARD_DEFAULTCARDDIR;
}
-QString KCardDialog::getCardPath(const QString &carddir, int index)
+TQString KCardDialog::getCardPath(const TQString &carddir, int index)
{
KCardDialog::init();
- QString entry = carddir + QString::number(index);
- if (KStandardDirs::exists(entry + QString::fromLatin1(".png")))
- return entry + QString::fromLatin1(".png");
+ TQString entry = carddir + TQString::number(index);
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".png")))
+ return entry + TQString::fromLatin1(".png");
// rather theoretical
- if (KStandardDirs::exists(entry + QString::fromLatin1(".xpm")))
- return entry + QString::fromLatin1(".xpm");
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm")))
+ return entry + TQString::fromLatin1(".xpm");
- return QString::null;
+ return TQString::null;
}
-const QString& KCardDialog::deck() const { return d->cDeck; }
-void KCardDialog::setDeck(const QString& file) { d->cDeck=file; }
-const QString& KCardDialog::cardDir() const { return d->cCardDir; }
-void KCardDialog::setCardDir(const QString& dir) { d->cCardDir=dir; }
+const TQString& KCardDialog::deck() const { return d->cDeck; }
+void KCardDialog::setDeck(const TQString& file) { d->cDeck=file; }
+const TQString& KCardDialog::cardDir() const { return d->cCardDir; }
+void KCardDialog::setCardDir(const TQString& dir) { d->cCardDir=dir; }
KCardDialog::CardFlags KCardDialog::flags() const { return d->cFlags; }
double KCardDialog::cardScale() const { return d->cScale; }
bool KCardDialog::isRandomDeck() const
@@ -261,20 +261,20 @@ bool KCardDialog::isGlobalCardDir() const
void KCardDialog::setupDialog(bool showResizeBox)
{
- QHBoxLayout* topLayout = new QHBoxLayout(plainPage(), spacingHint());
- QVBoxLayout* cardLayout = new QVBoxLayout(topLayout);
- QString path, file;
- QWMatrix m;
+ TQHBoxLayout* topLayout = new TQHBoxLayout(plainPage(), spacingHint());
+ TQVBoxLayout* cardLayout = new TQVBoxLayout(topLayout);
+ TQString path, file;
+ TQWMatrix m;
m.scale(0.8,0.8);
- setInitialSize(QSize(600,400));
+ setInitialSize(TQSize(600,400));
if (! (flags() & NoDeck))
{
- QHBoxLayout* layout = new QHBoxLayout(cardLayout);
+ TQHBoxLayout* layout = new TQHBoxLayout(cardLayout);
// Deck iconview
- QGroupBox* grp1 = new QGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage());
+ TQGroupBox* grp1 = new TQGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage());
layout->addWidget(grp1);
d->deckIconView = new KIconView(grp1,"decks");
@@ -285,48 +285,48 @@ void KCardDialog::setupDialog(bool showResizeBox)
*/
d->deckIconView->setGridX(82);
d->deckIconView->setGridY(106);
- d->deckIconView->setSelectionMode(QIconView::Single);
- d->deckIconView->setResizeMode(QIconView::Adjust);
+ d->deckIconView->setSelectionMode(TQIconView::Single);
+ d->deckIconView->setResizeMode(TQIconView::Adjust);
d->deckIconView->setMinimumWidth(360);
d->deckIconView->setMinimumHeight(170);
d->deckIconView->setWordWrapIconText(false);
d->deckIconView->showToolTips();
// deck select
- QVBoxLayout* l = new QVBoxLayout(layout);
- QGroupBox* grp3 = new QGroupBox(i18n("Backside"), plainPage());
+ TQVBoxLayout* l = new TQVBoxLayout(layout);
+ TQGroupBox* grp3 = new TQGroupBox(i18n("Backside"), plainPage());
grp3->setFixedSize(100, 130);
l->addWidget(grp3, 0, AlignTop|AlignHCenter);
- d->deckLabel = new QLabel(grp3);
+ d->deckLabel = new TQLabel(grp3);
d->deckLabel->setText(i18n("empty"));
d->deckLabel->setAlignment(AlignHCenter|AlignVCenter);
d->deckLabel->setGeometry(10, 20, 80, 90);
- d->randomDeck = new QCheckBox(plainPage());
+ d->randomDeck = new TQCheckBox(plainPage());
d->randomDeck->setChecked(false);
- connect(d->randomDeck, SIGNAL(toggled(bool)), this,
- SLOT(slotRandomDeckToggled(bool)));
+ connect(d->randomDeck, TQT_SIGNAL(toggled(bool)), this,
+ TQT_SLOT(slotRandomDeckToggled(bool)));
d->randomDeck->setText(i18n("Random backside"));
l->addWidget(d->randomDeck, 0, AlignTop|AlignHCenter);
- d->globalDeck = new QCheckBox(plainPage());
+ d->globalDeck = new TQCheckBox(plainPage());
d->globalDeck->setChecked(false);
d->globalDeck->setText(i18n("Use global backside"));
l->addWidget(d->globalDeck, 0, AlignTop|AlignHCenter);
- QPushButton* b = new QPushButton(i18n("Make Backside Global"), plainPage());
- connect(b, SIGNAL(pressed()), this, SLOT(slotSetGlobalDeck()));
+ TQPushButton* b = new TQPushButton(i18n("Make Backside Global"), plainPage());
+ connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotSetGlobalDeck()));
l->addWidget(b, 0, AlignTop|AlignHCenter);
- connect(d->deckIconView,SIGNAL(clicked(QIconViewItem *)),
- this,SLOT(slotDeckClicked(QIconViewItem *)));
+ connect(d->deckIconView,TQT_SIGNAL(clicked(TQIconViewItem *)),
+ this,TQT_SLOT(slotDeckClicked(TQIconViewItem *)));
}
if (! (flags() & NoCards))
{
// Cards iconview
- QHBoxLayout* layout = new QHBoxLayout(cardLayout);
- QGroupBox* grp2 = new QGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage());
+ TQHBoxLayout* layout = new TQHBoxLayout(cardLayout);
+ TQGroupBox* grp2 = new TQGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage());
layout->addWidget(grp2);
d->cardIconView =new KIconView(grp2,"cards");
@@ -336,40 +336,40 @@ void KCardDialog::setupDialog(bool showResizeBox)
*/
d->cardIconView->setGridX(82);
d->cardIconView->setGridY(106);
- d->cardIconView->setResizeMode(QIconView::Adjust);
+ d->cardIconView->setResizeMode(TQIconView::Adjust);
d->cardIconView->setMinimumWidth(360);
d->cardIconView->setMinimumHeight(170);
d->cardIconView->setWordWrapIconText(false);
d->cardIconView->showToolTips();
// Card select
- QVBoxLayout* l = new QVBoxLayout(layout);
- QGroupBox* grp4 = new QGroupBox(i18n("Frontside"), plainPage());
+ TQVBoxLayout* l = new TQVBoxLayout(layout);
+ TQGroupBox* grp4 = new TQGroupBox(i18n("Frontside"), plainPage());
grp4->setFixedSize(100, 130);
l->addWidget(grp4, 0, AlignTop|AlignHCenter);
- d->cardLabel = new QLabel(grp4);
+ d->cardLabel = new TQLabel(grp4);
d->cardLabel->setText(i18n("empty"));
d->cardLabel->setAlignment(AlignHCenter|AlignVCenter);
d->cardLabel->setGeometry(10, 20, 80, 90 );
- d->randomCardDir = new QCheckBox(plainPage());
+ d->randomCardDir = new TQCheckBox(plainPage());
d->randomCardDir->setChecked(false);
- connect(d->randomCardDir, SIGNAL(toggled(bool)), this,
- SLOT(slotRandomCardDirToggled(bool)));
+ connect(d->randomCardDir, TQT_SIGNAL(toggled(bool)), this,
+ TQT_SLOT(slotRandomCardDirToggled(bool)));
d->randomCardDir->setText(i18n("Random frontside"));
l->addWidget(d->randomCardDir, 0, AlignTop|AlignHCenter);
- d->globalCardDir = new QCheckBox(plainPage());
+ d->globalCardDir = new TQCheckBox(plainPage());
d->globalCardDir->setChecked(false);
d->globalCardDir->setText(i18n("Use global frontside"));
l->addWidget(d->globalCardDir, 0, AlignTop|AlignHCenter);
- QPushButton* b = new QPushButton(i18n("Make Frontside Global"), plainPage());
- connect(b, SIGNAL(pressed()), this, SLOT(slotSetGlobalCardDir()));
+ TQPushButton* b = new TQPushButton(i18n("Make Frontside Global"), plainPage());
+ connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotSetGlobalCardDir()));
l->addWidget(b, 0, AlignTop|AlignHCenter);
- connect(d->cardIconView,SIGNAL(clicked(QIconViewItem *)),
- this,SLOT(slotCardClicked(QIconViewItem *)));
+ connect(d->cardIconView,TQT_SIGNAL(clicked(TQIconViewItem *)),
+ this,TQT_SLOT(slotCardClicked(TQIconViewItem *)));
}
// Insert deck icons
@@ -383,10 +383,10 @@ void KCardDialog::setupDialog(bool showResizeBox)
if (!deck().isNull())
{
file=deck();
- QPixmap pixmap(file);
+ TQPixmap pixmap(file);
pixmap=pixmap.xForm(m);
d->deckLabel->setPixmap(pixmap);
- QToolTip::add(d->deckLabel,d->helpMap[file]);
+ TQToolTip::add(d->deckLabel,d->helpMap[file]);
}
}
@@ -400,10 +400,10 @@ void KCardDialog::setupDialog(bool showResizeBox)
if (!cardDir().isNull())
{
file = cardDir() + KCARD_DEFAULTCARD;
- QPixmap pixmap(file);
+ TQPixmap pixmap(file);
pixmap = pixmap.xForm(m);
d->cardLabel->setPixmap(pixmap);
- QToolTip::add(d->cardLabel,d->helpMap[cardDir()]);
+ TQToolTip::add(d->cardLabel,d->helpMap[cardDir()]);
}
}
@@ -414,36 +414,36 @@ void KCardDialog::setupDialog(bool showResizeBox)
// i'm sure there is a cleaner way but i cannot find it.
// whenever the pixmap is resized (aka scaled) the box is resized, too. This
// leads to an always resizing dialog which is *very* ugly. i worked around
- // this by using a QWidget which is the only child widget of the group box.
- // The other widget are managed inside this QWidget - a stretch area on the
+ // this by using a TQWidget which is the only child widget of the group box.
+ // The other widget are managed inside this TQWidget - a stretch area on the
// right ensures that the KIconViews are not resized...
// note that the dialog is still resized if you you scale the pixmap very
// large. This is desired behaviour as i don't want to make the box even
// larger but i want the complete pixmap to be displayed. the dialog is not
// resized if you make the pixmap smaller again.
- QVBoxLayout* layout = new QVBoxLayout(topLayout);
- QGroupBox* grp = new QGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage());
- layout->setResizeMode(QLayout::Fixed);
+ TQVBoxLayout* layout = new TQVBoxLayout(topLayout);
+ TQGroupBox* grp = new TQGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage());
+ layout->setResizeMode(TQLayout::Fixed);
layout->addWidget(grp);
- QWidget* box = new QWidget(grp);
- QHBoxLayout* hbox = new QHBoxLayout(box, 0, spacingHint());
- QVBoxLayout* boxLayout = new QVBoxLayout(hbox);
+ TQWidget* box = new TQWidget(grp);
+ TQHBoxLayout* hbox = new TQHBoxLayout(box, 0, spacingHint());
+ TQVBoxLayout* boxLayout = new TQVBoxLayout(hbox);
hbox->addStretch(0);
- d->scaleSlider = new QSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box);
+ d->scaleSlider = new TQSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box);
d->scaleSlider->setMinValue(SLIDER_MIN);
- connect(d->scaleSlider, SIGNAL(valueChanged(int)), this, SLOT(slotCardResized(int)));
+ connect(d->scaleSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotCardResized(int)));
boxLayout->addWidget(d->scaleSlider, 0, AlignLeft);
- QPushButton* b = new QPushButton(i18n("Default Size"), box);
- connect(b, SIGNAL(pressed()), this, SLOT(slotDefaultSize()));
+ TQPushButton* b = new TQPushButton(i18n("Default Size"), box);
+ connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotDefaultSize()));
boxLayout->addWidget(b, 0, AlignLeft);
- QLabel* l = new QLabel(i18n("Preview:"), box);
+ TQLabel* l = new TQLabel(i18n("Preview:"), box);
boxLayout->addWidget(l);
d->cPreviewPix.load(getDefaultDeck());
- d->cPreview = new QLabel(box);
+ d->cPreview = new TQLabel(box);
boxLayout->addWidget(d->cPreview, 0, AlignCenter|AlignVCenter);
slotCardResized(d->scaleSlider->value());
@@ -452,29 +452,29 @@ void KCardDialog::setupDialog(bool showResizeBox)
void KCardDialog::insertCardIcons()
{
- QStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop", false, true);
+ TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop", false, true);
// kdDebug(11000) << "insert " << list.count() << endl;
if (list.isEmpty())
return;
// We shrink the icons a little
//
- QWMatrix m;
+ TQWMatrix m;
m.scale(0.8,0.8);
- for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
{
KSimpleConfig cfg(*it);
- cfg.setGroup(QString::fromLatin1("KDE Backdeck"));
- QString path = (*it).left((*it).findRev('/') + 1);
+ cfg.setGroup(TQString::fromLatin1("KDE Backdeck"));
+ TQString path = (*it).left((*it).findRev('/') + 1);
assert(path[path.length() - 1] == '/');
- QPixmap pixmap(path + cfg.readEntry("Preview", "12c.png"));
+ TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png"));
if (pixmap.isNull())
continue;
- QString name=cfg.readEntry("Name", i18n("unnamed"));
- QIconViewItem *item= new QIconViewItem(d->cardIconView, name, pixmap);
+ TQString name=cfg.readEntry("Name", i18n("unnamed"));
+ TQIconViewItem *item= new TQIconViewItem(d->cardIconView, name, pixmap);
item->setDragEnabled(false);
item->setDropEnabled(false);
@@ -488,28 +488,28 @@ void KCardDialog::insertCardIcons()
void KCardDialog::insertDeckIcons()
{
- QStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop", false, true);
+ TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop", false, true);
if (list.isEmpty())
return;
- QString label;
+ TQString label;
// We shrink the icons a little
- QWMatrix m;
+ TQWMatrix m;
m.scale(0.8,0.8);
- for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
{
KSimpleConfig cfg(*it);
- QPixmap pixmap(getDeckName(*it));
+ TQPixmap pixmap(getDeckName(*it));
if (pixmap.isNull())
continue;
// pixmap=pixmap.xForm(m);
- cfg.setGroup(QString::fromLatin1("KDE Cards"));
- QString name=cfg.readEntry("Name", i18n("unnamed"));
- QIconViewItem *item= new QIconViewItem(d->deckIconView,name, pixmap);
+ cfg.setGroup(TQString::fromLatin1("KDE Cards"));
+ TQString name=cfg.readEntry("Name", i18n("unnamed"));
+ TQIconViewItem *item= new TQIconViewItem(d->deckIconView,name, pixmap);
item->setDragEnabled(false);
item->setDropEnabled(false);
@@ -528,7 +528,7 @@ KCardDialog::~KCardDialog()
// Create the dialog
-KCardDialog::KCardDialog( QWidget *parent, const char *name, CardFlags mFlags)
+KCardDialog::KCardDialog( TQWidget *parent, const char *name, CardFlags mFlags)
: KDialogBase( Plain, i18n("Carddeck Selection"), Ok|Cancel, Ok, parent, name, true, true)
{
KCardDialog::init();
@@ -537,62 +537,62 @@ KCardDialog::KCardDialog( QWidget *parent, const char *name, CardFlags mFlags)
d->cFlags = mFlags;
}
-void KCardDialog::slotDeckClicked(QIconViewItem *item)
+void KCardDialog::slotDeckClicked(TQIconViewItem *item)
{
if (item && item->pixmap())
{
d->deckLabel->setPixmap(* (item->pixmap()));
- QToolTip::remove( d->deckLabel );
- QToolTip::add(d->deckLabel,d->helpMap[d->deckMap[item]]);
+ TQToolTip::remove( d->deckLabel );
+ TQToolTip::add(d->deckLabel,d->helpMap[d->deckMap[item]]);
setDeck(d->deckMap[item]);
}
}
-void KCardDialog::slotCardClicked(QIconViewItem *item)
+void KCardDialog::slotCardClicked(TQIconViewItem *item)
{
if (item && item->pixmap())
{
d->cardLabel->setPixmap(* (item->pixmap()));
- QString path = d->cardMap[item];
- QToolTip::remove( d->deckLabel );
- QToolTip::add(d->cardLabel,d->helpMap[path]);
+ TQString path = d->cardMap[item];
+ TQToolTip::remove( d->deckLabel );
+ TQToolTip::add(d->cardLabel,d->helpMap[path]);
setCardDir(path);
}
}
-QString KCardDialog::getDeckName(const QString &desktop)
+TQString KCardDialog::getDeckName(const TQString &desktop)
{
- QString entry = desktop.left(desktop.length() - strlen(".desktop"));
- if (KStandardDirs::exists(entry + QString::fromLatin1(".png")))
- return entry + QString::fromLatin1(".png");
+ TQString entry = desktop.left(desktop.length() - strlen(".desktop"));
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".png")))
+ return entry + TQString::fromLatin1(".png");
// rather theoretical
- if (KStandardDirs::exists(entry + QString::fromLatin1(".xpm")))
- return entry + QString::fromLatin1(".xpm");
- return QString::null;
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm")))
+ return entry + TQString::fromLatin1(".xpm");
+ return TQString::null;
}
-QString KCardDialog::getRandomDeck()
+TQString KCardDialog::getRandomDeck()
{
KCardDialog::init();
- QStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop");
+ TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop");
if (list.isEmpty())
- return QString::null;
+ return TQString::null;
int d = KApplication::random() % list.count();
return getDeckName(*list.at(d));
}
-QString KCardDialog::getRandomCardDir()
+TQString KCardDialog::getRandomCardDir()
{
KCardDialog::init();
- QStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop");
+ TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop");
if (list.isEmpty())
- return QString::null;
+ return TQString::null;
int d = KApplication::random() % list.count();
- QString entry = *list.at(d);
+ TQString entry = *list.at(d);
return entry.left(entry.length() - strlen("index.desktop"));
}
@@ -634,8 +634,8 @@ void KCardDialog::slotRandomCardDirToggled(bool on)
if (on) {
d->cardLabel->setText("random");
setCardDir(getRandomCardDir());
- if (cardDir().length()>0 && cardDir().right(1)!=QString::fromLatin1("/")) {
- setCardDir(cardDir() + QString::fromLatin1("/"));
+ if (cardDir().length()>0 && cardDir().right(1)!=TQString::fromLatin1("/")) {
+ setCardDir(cardDir() + TQString::fromLatin1("/"));
}
} else {
d->cardLabel->setText("empty");
@@ -649,7 +649,7 @@ void KCardDialog::loadConfig(KConfig* conf)
return;
}
- QString origGroup = conf->group();
+ TQString origGroup = conf->group();
conf->setGroup(CONF_GROUP);
if (! (flags() & NoDeck)) {
@@ -701,10 +701,10 @@ void KCardDialog::slotCardResized(int s)
s *= -1;
s += (SLIDER_MIN + SLIDER_MAX);
- QWMatrix m;
+ TQWMatrix m;
double scale = (double)1000/s;
m.scale(scale, scale);
- QPixmap pix = d->cPreviewPix.xForm(m);
+ TQPixmap pix = d->cPreviewPix.xForm(m);
d->cPreview->setPixmap(pix);
d->cScale = scale;
}
@@ -722,7 +722,7 @@ void KCardDialog::saveConfig(KConfig* conf)
if (!conf) {
return;
}
- QString origGroup = conf->group();
+ TQString origGroup = conf->group();
conf->setGroup(CONF_GROUP);
if (! (flags() & NoDeck)) {
@@ -742,7 +742,7 @@ void KCardDialog::saveConfig(KConfig* conf)
void KCardDialog::slotSetGlobalDeck()
{
- KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), false);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false);
conf->setGroup(CONF_GLOBAL_GROUP);
conf->writeEntry(CONF_GLOBAL_DECK, deck());
@@ -753,7 +753,7 @@ void KCardDialog::slotSetGlobalDeck()
void KCardDialog::slotSetGlobalCardDir()
{
- KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), false);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false);
conf->setGroup(CONF_GLOBAL_GROUP);
conf->writePathEntry(CONF_GLOBAL_CARDDIR, cardDir());
@@ -762,9 +762,9 @@ void KCardDialog::slotSetGlobalCardDir()
delete conf;
}
-void KCardDialog::getGlobalDeck(QString& deck, bool& random)
+void KCardDialog::getGlobalDeck(TQString& deck, bool& random)
{
- KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), true);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true);
conf->setGroup(CONF_GLOBAL_GROUP);
if (!conf->hasKey(CONF_GLOBAL_DECK) || conf->readBoolEntry(CONF_GLOBAL_RANDOMDECK, false)) {
@@ -778,9 +778,9 @@ void KCardDialog::getGlobalDeck(QString& deck, bool& random)
delete conf;
}
-void KCardDialog::getGlobalCardDir(QString& dir, bool& random)
+void KCardDialog::getGlobalCardDir(TQString& dir, bool& random)
{
- KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), true);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true);
conf->setGroup(CONF_GLOBAL_GROUP);
if (!conf->hasKey(CONF_GLOBAL_CARDDIR) || conf->readBoolEntry(CONF_GLOBAL_RANDOMCARDDIR, false)) {
@@ -799,7 +799,7 @@ void KCardDialog::init()
static bool _inited = false;
if (_inited)
return;
- KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + QString::fromLatin1("carddecks/"));
+ KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::fromLatin1("carddecks/"));
KGlobal::locale()->insertCatalogue("libkdegames");
_inited = true;
diff --git a/libkdegames/kcarddialog.h b/libkdegames/kcarddialog.h
index b32fd636..fae37b97 100644
--- a/libkdegames/kcarddialog.h
+++ b/libkdegames/kcarddialog.h
@@ -19,9 +19,9 @@
#ifndef __KCARDDIALOG_H_
#define __KCARDDIALOG_H_
-#include <qstring.h>
+#include <tqstring.h>
#include <kdialogbase.h>
-#include <qmap.h> // TODO: remove - it is in kcarddialog.cpp now; left here for source compatibility
+#include <tqmap.h> // TODO: remove - it is in kcarddialog.cpp now; left here for source compatibility
#include <kdemacros.h>
class QIconViewItem;
@@ -48,7 +48,7 @@ class KCardDialogPrivate;
* Example:
*
* \code
- * QString deck,card;
+ * TQString deck,card;
* int result = KCardDialog::getCardDeck(deck,card );
* if ( result == KCardDialog::Accepted )
* ...
@@ -75,10 +75,10 @@ class KCardDialogPrivate;
* Another Parameter for KCardDialog::getCardDeck is scale. This pointer
* to a double variable contains the scaling factor the user has chosen in the
* dialog (the scale box won't be shown if you don't provide this parameter).
- * You might want to check out QPixmap::xFrom which gives you access to
+ * You might want to check out TQPixmap::xFrom which gives you access to
* scaling. You can e.g. use
* \code
- * QWMatrix m;
+ * TQWMatrix m;
* m.scale(s,s);
* pixmap.xForm(m);
* \endcode
@@ -107,7 +107,7 @@ public:
* @param name The name of the dialog.
* @param flags Specifies whether the dialog is modal or not.
*/
- KCardDialog (QWidget* parent = NULL,const char* name = NULL,
+ KCardDialog (TQWidget* parent = NULL,const char* name = NULL,
CardFlags flags = Both);
/**
* Destructs a card deck selection dialog.
@@ -151,9 +151,9 @@ public:
* parameters randomDeck and randomCardDir overwrite the initial settings from the
* config file.
*
- * @return QDialog::result().
+ * @return TQDialog::result().
*/
- static int getCardDeck(QString &deck,QString &carddir, QWidget *parent=0,
+ static int getCardDeck(TQString &deck,TQString &carddir, TQWidget *parent=0,
CardFlags flags=Both, bool* randomDeck=0,
bool* randomCardDir=0, double* scale=0, KConfig* conf=0);
@@ -172,7 +172,7 @@ public:
* random cardDir if this is desired according to the config)
* @param scale The scaling factor (usually 1)
**/
- static void getConfigCardDeck(KConfig* conf, QString& deck, QString& cardDir, double& scale);
+ static void getConfigCardDeck(KConfig* conf, TQString& deck, TQString& cardDir, double& scale);
/**
* Returns the default path to the card deck backsides. You want
@@ -185,7 +185,7 @@ public:
*
* @return The default path
*/
- static QString getDefaultDeck();
+ static TQString getDefaultDeck();
/**
* Returns the default path to the card frontsides. You want
@@ -198,7 +198,7 @@ public:
*
* @return returns the path to the card directory
*/
- static QString getDefaultCardDir();
+ static TQString getDefaultCardDir();
/**
* Returns the path to the card frontside specified in dir carddir
@@ -207,19 +207,19 @@ public:
* @param carddir The carddir which's path shall be searched for
* @return returns the path to the card
*/
- static QString getCardPath(const QString &carddir, int index);
+ static TQString getCardPath(const TQString &carddir, int index);
/**
* Returns a random deck in deckPath()
* @return A random deck
**/
- static QString getRandomDeck();
+ static TQString getRandomDeck();
/**
* Returns a random directory of cards
* @return A random card dir
**/
- static QString getRandomCardDir();
+ static TQString getRandomCardDir();
/**
* Show or hides the "random backside" checkbox
@@ -238,24 +238,24 @@ public:
*
* @return The deck
*/
- const QString& deck() const;
+ const TQString& deck() const;
/**
* Sets the default deck.
* @param file The full path to an image file
*/
- void setDeck(const QString& file);
+ void setDeck(const TQString& file);
/**
* @return The chosen card directory
*/
- const QString& cardDir() const;
+ const TQString& cardDir() const;
/**
* Sets the default card directory.
* @param dir The full path to an card directory
*/
- void setCardDir(const QString& dir);
+ void setCardDir(const TQString& dir);
/**
* @return the flags set to the dialog
@@ -315,20 +315,20 @@ protected:
void insertCardIcons();
void insertDeckIcons();
- static void getGlobalDeck(QString& cardDir, bool& random);
- static void getGlobalCardDir(QString& deck, bool& random);
+ static void getGlobalDeck(TQString& cardDir, bool& random);
+ static void getGlobalCardDir(TQString& deck, bool& random);
- static QString getDeckName(const QString& desktop);
+ static TQString getDeckName(const TQString& desktop);
/**
* @return the groupname used by functions like @ref saveConfig and @ref
* loadConfig.
**/
- static QString group();
+ static TQString group();
protected slots:
- void slotDeckClicked(QIconViewItem *);
- void slotCardClicked(QIconViewItem *);
+ void slotDeckClicked(TQIconViewItem *);
+ void slotCardClicked(TQIconViewItem *);
void slotRandomCardDirToggled(bool on);
void slotRandomDeckToggled(bool on);
void slotCardResized(int);
diff --git a/libkdegames/kchat.cpp b/libkdegames/kchat.cpp
index d4ffd7ec..2a9c3913 100644
--- a/libkdegames/kchat.cpp
+++ b/libkdegames/kchat.cpp
@@ -31,12 +31,12 @@ public:
bool mAutoAddMessages;
- QMap<int, QString> mPlayerMap;
+ TQMap<int, TQString> mPlayerMap;
int mPlayerId;
int mFromId;
};
-KChat::KChat(QWidget* parent, bool twoPlayerGame) : KChatBase(parent, twoPlayerGame)
+KChat::KChat(TQWidget* parent, bool twoPlayerGame) : KChatBase(parent, twoPlayerGame)
{
init();
}
@@ -56,9 +56,9 @@ void KChat::init()
d->mFromId = 1;
}
-void KChat::setFromNickname(const QString& n)
+void KChat::setFromNickname(const TQString& n)
{ d->mFromId = addPlayer(n); }
-const QString& KChat::fromName() const
+const TQString& KChat::fromName() const
{ return player(fromId()); }
void KChat::setAutoAddMessages(bool add)
{ d->mAutoAddMessages = add; }
@@ -68,10 +68,10 @@ int KChat::uniqueId()
{ return d->mPlayerId++; }
int KChat::fromId() const
{ return d->mFromId; }
-const QString& KChat::player(int id) const
+const TQString& KChat::player(int id) const
{ return d->mPlayerMap[id]; }
-void KChat::returnPressed(const QString& text)
+void KChat::returnPressed(const TQString& text)
{
int id = fromId();
if (id < 0) {
@@ -80,7 +80,7 @@ void KChat::returnPressed(const QString& text)
}
emit signalSendMessage(id, text);
if (autoAddMessages()) {
- QString p = player(id);
+ TQString p = player(id);
if (p.isNull()) {
p = i18n("Unknown");
}
@@ -89,7 +89,7 @@ void KChat::returnPressed(const QString& text)
}
}
-int KChat::addPlayer(const QString& nickname)
+int KChat::addPlayer(const TQString& nickname)
{
int id = uniqueId();
d->mPlayerMap.insert(id, nickname);
@@ -101,9 +101,9 @@ void KChat::removePlayer(int id)
d->mPlayerMap.remove(id);
}
-void KChat::removePlayer(const QString& nickname)
+void KChat::removePlayer(const TQString& nickname)
{
- QMap<int, QString>::Iterator it;
+ TQMap<int, TQString>::Iterator it;
for (it = d->mPlayerMap.begin(); it != d->mPlayerMap.end(); ++it) {
if (it.data() == nickname) {
d->mPlayerMap.remove(it);
diff --git a/libkdegames/kchat.h b/libkdegames/kchat.h
index db479bc0..5eabb9d3 100644
--- a/libkdegames/kchat.h
+++ b/libkdegames/kchat.h
@@ -19,7 +19,7 @@
#ifndef __KCHAT_H__
#define __KCHAT_H__
-#include <qstring.h>
+#include <tqstring.h>
#include "kchatbase.h"
#include <kdemacros.h>
@@ -43,7 +43,7 @@ public:
* choose to send to a single player or to all players will not be added
* as you will hardly need it in 2-player games.
**/
- KChat(QWidget* parent, bool twoPlayerGame = false);
+ KChat(TQWidget* parent, bool twoPlayerGame = false);
virtual ~KChat();
@@ -52,23 +52,23 @@ public:
* @return The name that will be shown for messages from this widget.
* That is the string from @ref setFromNickname
**/
- virtual const QString& fromName() const;
+ virtual const TQString& fromName() const;
/**
* This sets the name that will be shown on all chat widgets if this
* widget sends a message. See signalSendMessage
* @param name The name of the player owning this widget
**/
- void setFromNickname(const QString& name);
+ void setFromNickname(const TQString& name);
// TODO:
-// void setPlayerList(QIntDict<QString>);// use this for non-KGame use
+// void setPlayerList(TQIntDict<TQString>);// use this for non-KGame use
/**
* Adds a player nickname.
* @return The unique ID of the player
**/
- int addPlayer(const QString& nick);
+ int addPlayer(const TQString& nick);
/**
* Removes all players with this nickname. Better don't use this as it
@@ -76,7 +76,7 @@ public:
* call removePlayer(id)
* @param nick The nickname of the removed players
**/
- void removePlayer(const QString& nick);
+ void removePlayer(const TQString& nick);
/**
* Removes the player with this id, as returned by @ref addPlayer
@@ -105,7 +105,7 @@ public:
/**
* @return The nickname of the player which belongs to this id
**/
- const QString& player(int id) const;
+ const TQString& player(int id) const;
/**
* @return The ID that belongs to the local player.
@@ -124,14 +124,14 @@ signals:
* setFromNickname and player
* @param msg The message itself
**/
- void signalSendMessage(int id, const QString& msg);
+ void signalSendMessage(int id, const TQString& msg);
protected:
/**
* This emits @ref signalSendMessage and, if @ref autoAddMessages is
* true, calls @ref KChatBase::addMessage
**/
- virtual void returnPressed(const QString&);
+ virtual void returnPressed(const TQString&);
/**
* The Id of the next player. Incremented after every call.
diff --git a/libkdegames/kchatbase.cpp b/libkdegames/kchatbase.cpp
index 4ccd7b08..421e0224 100644
--- a/libkdegames/kchatbase.cpp
+++ b/libkdegames/kchatbase.cpp
@@ -26,9 +26,9 @@
#include <kapplication.h>
#include <kdebug.h>
-#include <qlayout.h>
-#include <qcombobox.h>
-#include <qpainter.h>
+#include <tqlayout.h>
+#include <tqcombobox.h>
+#include <tqpainter.h>
class KChatBaseTextPrivate
{
@@ -39,22 +39,22 @@ public:
mMessageFont = 0;
}
- QString mName;
- QString mMessage;
+ TQString mName;
+ TQString mMessage;
- const QFont* mNameFont;
- const QFont* mMessageFont;
+ const TQFont* mNameFont;
+ const TQFont* mMessageFont;
};
-KChatBaseText::KChatBaseText(const QString& name, const QString& message) : QListBoxText()
+KChatBaseText::KChatBaseText(const TQString& name, const TQString& message) : TQListBoxText()
{
init();
setName(name);
setMessage(message);
}
-KChatBaseText::KChatBaseText(const QString& message) : QListBoxText()
+KChatBaseText::KChatBaseText(const TQString& message) : TQListBoxText()
{
init();
setMessage(message);
@@ -70,88 +70,88 @@ void KChatBaseText::init()
d = new KChatBaseTextPrivate;
}
-void KChatBaseText::setName(const QString& n)
+void KChatBaseText::setName(const TQString& n)
{
// d->mName = n;
- d->mName = QString("%1: ").arg(n);
- setText(QString("%1: %2").arg(name()).arg(message())); // esp. for sorting
+ d->mName = TQString("%1: ").arg(n);
+ setText(TQString("%1: %2").arg(name()).arg(message())); // esp. for sorting
}
-void KChatBaseText::setMessage(const QString& m)
+void KChatBaseText::setMessage(const TQString& m)
{
d->mMessage = m;
- setText(QString("%1: %2").arg(name()).arg(message())); // esp. for sorting
+ setText(TQString("%1: %2").arg(name()).arg(message())); // esp. for sorting
}
-const QString& KChatBaseText::name() const
+const TQString& KChatBaseText::name() const
{ return d->mName; }
-const QString& KChatBaseText::message() const
+const TQString& KChatBaseText::message() const
{ return d->mMessage; }
-QFont KChatBaseText::nameFont() const
+TQFont KChatBaseText::nameFont() const
{
if (d->mNameFont) {
return *d->mNameFont;
} else if (listBox()) {
return listBox()->font();
} else {
- return QFont();
+ return TQFont();
}
}
-QFont KChatBaseText::messageFont() const
+TQFont KChatBaseText::messageFont() const
{
if (d->mMessageFont) {
return *d->mMessageFont;
} else if (listBox()) {
return listBox()->font();
} else {
- return QFont();
+ return TQFont();
}
}
-void KChatBaseText::setNameFont(const QFont* f)
+void KChatBaseText::setNameFont(const TQFont* f)
{ d->mNameFont = f; }
-void KChatBaseText::setMessageFont(const QFont* f)
+void KChatBaseText::setMessageFont(const TQFont* f)
{ d->mMessageFont = f; }
-void KChatBaseText::paint(QPainter* painter)
+void KChatBaseText::paint(TQPainter* painter)
{
- QFontMetrics fm = painter->fontMetrics();
+ TQFontMetrics fm = painter->fontMetrics();
painter->setFont(nameFont());
painter->drawText(3, fm.ascent() + fm.leading()/2, name());
painter->setFont(messageFont());
- painter->drawText(3 + QFontMetrics(nameFont()).width(name()), fm.ascent() + fm.leading()/2, message());
+ painter->drawText(3 + TQFontMetrics(nameFont()).width(name()), fm.ascent() + fm.leading()/2, message());
}
-int KChatBaseText::width(QListBox* lb) const
+int KChatBaseText::width(TQListBox* lb) const
{
int w = 0;
if (lb) {
w += 6;
- w += QFontMetrics(nameFont()).width(name());
- w += QFontMetrics(messageFont()).width(message());
+ w += TQFontMetrics(nameFont()).width(name());
+ w += TQFontMetrics(messageFont()).width(message());
}
// int w = lb ? lb->fontMetrics().width( text() ) + 6 : 0; // QT orig
- return QMAX(w, QApplication::globalStrut().width());
+ return QMAX(w, TQApplication::globalStrut().width());
}
-int KChatBaseText::height(QListBox* lb) const
+int KChatBaseText::height(TQListBox* lb) const
{
int h = 0;
if (lb) {
h += 2;
// AB: is lineSpacing still correct?
- if (QFontMetrics(nameFont()).lineSpacing() > QFontMetrics(messageFont()).lineSpacing()) {
- h += QFontMetrics(nameFont()).lineSpacing();
+ if (TQFontMetrics(nameFont()).lineSpacing() > TQFontMetrics(messageFont()).lineSpacing()) {
+ h += TQFontMetrics(nameFont()).lineSpacing();
} else {
- h += QFontMetrics(messageFont()).lineSpacing();
+ h += TQFontMetrics(messageFont()).lineSpacing();
}
}
// int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; // QT orig
- return QMAX(h, QApplication::globalStrut().height());
+ return QMAX(h, TQApplication::globalStrut().height());
}
@@ -168,21 +168,21 @@ public:
mAcceptMessage = true;
mMaxItems = -1;
}
- QListBox* mBox;
+ TQListBox* mBox;
KLineEdit* mEdit;
- QComboBox* mCombo;
+ TQComboBox* mCombo;
bool mAcceptMessage;
int mMaxItems;
- QValueList<int> mIndex2Id;
+ TQValueList<int> mIndex2Id;
- QFont mNameFont;
- QFont mMessageFont;
- QFont mSystemNameFont;
- QFont mSystemMessageFont;
+ TQFont mNameFont;
+ TQFont mMessageFont;
+ TQFont mSystemNameFont;
+ TQFont mSystemMessageFont;
};
-KChatBase::KChatBase(QWidget* parent, bool noComboBox) : QFrame(parent)
+KChatBase::KChatBase(TQWidget* parent, bool noComboBox) : TQFrame(parent)
{
init(noComboBox);
}
@@ -203,31 +203,31 @@ void KChatBase::init(bool noComboBox)
setMinimumWidth(100);
setMinimumHeight(150);
- QVBoxLayout* l = new QVBoxLayout(this);
+ TQVBoxLayout* l = new TQVBoxLayout(this);
- d->mBox = new QListBox(this);
- connect(d->mBox, SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)),
- this, SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)));
+ d->mBox = new TQListBox(this);
+ connect(d->mBox, TQT_SIGNAL(rightButtonClicked(TQListBoxItem*, const TQPoint&)),
+ this, TQT_SIGNAL(rightButtonClicked(TQListBoxItem*, const TQPoint&)));
l->addWidget(d->mBox);
- d->mBox->setVScrollBarMode(QScrollView::AlwaysOn);
- d->mBox->setHScrollBarMode(QScrollView::AlwaysOff);
- d->mBox->setFocusPolicy(QWidget::NoFocus);
-// d->mBox->setSelectionMode(QListBox::NoSelection);
- d->mBox->setSelectionMode(QListBox::Single);
+ d->mBox->setVScrollBarMode(TQScrollView::AlwaysOn);
+ d->mBox->setHScrollBarMode(TQScrollView::AlwaysOff);
+ d->mBox->setFocusPolicy(TQWidget::NoFocus);
+// d->mBox->setSelectionMode(TQListBox::NoSelection);
+ d->mBox->setSelectionMode(TQListBox::Single);
l->addSpacing(5);
- QHBoxLayout* h = new QHBoxLayout(l);
+ TQHBoxLayout* h = new TQHBoxLayout(l);
d->mEdit = new KLineEdit(this);
d->mEdit->setHandleSignals(false);
d->mEdit->setTrapReturnKey(true);
d->mEdit->completionObject(); // add the completion object
d->mEdit->setCompletionMode(KGlobalSettings::CompletionNone);
- connect(d->mEdit, SIGNAL(returnPressed(const QString&)), this, SLOT(slotReturnPressed(const QString&)));
+ connect(d->mEdit, TQT_SIGNAL(returnPressed(const TQString&)), this, TQT_SLOT(slotReturnPressed(const TQString&)));
h->addWidget(d->mEdit);
if (!noComboBox) {
- d->mCombo = new QComboBox(this);
+ d->mCombo = new TQComboBox(this);
h->addWidget(d->mCombo);
addSendingEntry(i18n("Send to All Players"), SendToAll);//FIXME: where to put the id?
}
@@ -247,7 +247,7 @@ bool KChatBase::acceptMessage() const
void KChatBase::setAcceptMessage(bool a)
{ d->mAcceptMessage = a; }
-bool KChatBase::addSendingEntry(const QString& text, int id)
+bool KChatBase::addSendingEntry(const TQString& text, int id)
{
//FIXME: is ID used correctly?
// do we need ID at all?
@@ -256,7 +256,7 @@ bool KChatBase::addSendingEntry(const QString& text, int id)
return insertSendingEntry(text, id);
}
-bool KChatBase::insertSendingEntry(const QString& text, int id, int index)
+bool KChatBase::insertSendingEntry(const TQString& text, int id, int index)
{
if (!d->mCombo) {
kdWarning(11000) << "KChatBase: Cannot add an entry to the combo box" << endl;
@@ -303,7 +303,7 @@ void KChatBase::removeSendingEntry(int id)
d->mIndex2Id.remove(id);
}
-void KChatBase::changeSendingEntry(const QString& text, int id)
+void KChatBase::changeSendingEntry(const TQString& text, int id)
{
if (!d->mCombo) {
kdWarning(11000) << "KChatBase: Cannot change an entry in the combo box" << endl;
@@ -336,7 +336,7 @@ int KChatBase::nextId() const
return i;
}
-void KChatBase::addItem(const QListBoxItem* text)
+void KChatBase::addItem(const TQListBoxItem* text)
{
d->mBox->insertItem(text);
int index = d->mBox->count() -1;
@@ -346,40 +346,40 @@ void KChatBase::addItem(const QListBoxItem* text)
}
}
-void KChatBase::addMessage(const QString& fromName, const QString& text)
+void KChatBase::addMessage(const TQString& fromName, const TQString& text)
{
//maybe "%1 says: %2" or so
addItem(layoutMessage(fromName, text));
}
-void KChatBase::addSystemMessage(const QString& fromName, const QString& text)
+void KChatBase::addSystemMessage(const TQString& fromName, const TQString& text)
{
addItem(layoutSystemMessage(fromName, text));
}
-QListBoxItem* KChatBase::layoutMessage(const QString& fromName, const QString& text)
+TQListBoxItem* KChatBase::layoutMessage(const TQString& fromName, const TQString& text)
{
//TODO: KChatBaseConfigure? - e.g. color
- QListBoxItem* message;
+ TQListBoxItem* message;
if (text.startsWith("/me ")) {
// replace "/me" by a nice star. leave one space after the star
- QPixmap pix;
- pix.load(locate("data", QString::fromLatin1("kdegames/pics/star.png")));
+ TQPixmap pix;
+ pix.load(locate("data", TQString::fromLatin1("kdegames/pics/star.png")));
//TODO KChatBasePixmap? Should change the font here!
- message = (QListBoxItem*)new QListBoxPixmap(pix, i18n("%1 %2").arg(fromName).arg(text.mid(3)));
+ message = (TQListBoxItem*)new TQListBoxPixmap(pix, i18n("%1 %2").arg(fromName).arg(text.mid(3)));
} else {
// the text is not edited in any way. just return an item
KChatBaseText* m = new KChatBaseText(fromName, text);
m->setNameFont(&d->mNameFont);
m->setMessageFont(&d->mMessageFont);
- message = (QListBoxItem*)m;
+ message = (TQListBoxItem*)m;
}
return message;
}
-QListBoxItem* KChatBase::layoutSystemMessage(const QString& fromName, const QString& text)
+TQListBoxItem* KChatBase::layoutSystemMessage(const TQString& fromName, const TQString& text)
{
//TODO: KChatBaseConfigure? - e.g. color
@@ -387,10 +387,10 @@ QListBoxItem* KChatBase::layoutSystemMessage(const QString& fromName, const QStr
KChatBaseText* m = new KChatBaseText(i18n("--- %1").arg(fromName), text);
m->setNameFont(&d->mSystemNameFont);
m->setMessageFont(&d->mSystemMessageFont);
- return (QListBoxItem*)m;
+ return (TQListBoxItem*)m;
}
-void KChatBase::slotReturnPressed(const QString& text)
+void KChatBase::slotReturnPressed(const TQString& text)
{
if (text.length() <= 0) {
// no text entered - probably hit return by accident
@@ -399,12 +399,12 @@ void KChatBase::slotReturnPressed(const QString& text)
return;
}
d->mEdit->completionObject()->addItem(text);
-// connect(d->mEdit, SIGNAL(returnPressed(const QString&)), comp, SLOT(addItem(const QString&)));
+// connect(d->mEdit, TQT_SIGNAL(returnPressed(const TQString&)), comp, TQT_SLOT(addItem(const TQString&)));
d->mEdit->clear();
returnPressed(text);
}
-QString KChatBase::comboBoxItem(const QString& name) const
+TQString KChatBase::comboBoxItem(const TQString& name) const
{ // TODO: such a function for "send to all" and "send to my group"
return i18n("Send to %1").arg(name);
}
@@ -417,57 +417,57 @@ void KChatBase::slotClear()
void KChatBase::setCompletionMode(KGlobalSettings::Completion mode)
{ d->mEdit->setCompletionMode(mode); }
-void KChatBase::setNameFont(const QFont& font)
+void KChatBase::setNameFont(const TQFont& font)
{
d->mNameFont = font;
d->mBox->triggerUpdate(false);
}
-void KChatBase::setMessageFont(const QFont& font)
+void KChatBase::setMessageFont(const TQFont& font)
{
d->mMessageFont = font;
d->mBox->triggerUpdate(false);
}
-void KChatBase::setBothFont(const QFont& font)
+void KChatBase::setBothFont(const TQFont& font)
{
setNameFont(font);
setMessageFont(font);
}
-const QFont& KChatBase::nameFont() const
+const TQFont& KChatBase::nameFont() const
{ return d->mNameFont; }
-const QFont& KChatBase::messageFont() const
+const TQFont& KChatBase::messageFont() const
{ return d->mMessageFont; }
-void KChatBase::setSystemNameFont(const QFont& font)
+void KChatBase::setSystemNameFont(const TQFont& font)
{
d->mSystemNameFont = font;
d->mBox->triggerUpdate(false);
}
-void KChatBase::setSystemMessageFont(const QFont& font)
+void KChatBase::setSystemMessageFont(const TQFont& font)
{
d->mSystemMessageFont = font;
d->mBox->triggerUpdate(false);
}
-void KChatBase::setSystemBothFont(const QFont& font)
+void KChatBase::setSystemBothFont(const TQFont& font)
{
setSystemNameFont(font);
setSystemMessageFont(font);
}
-const QFont& KChatBase::systemNameFont() const
+const TQFont& KChatBase::systemNameFont() const
{ return d->mSystemNameFont; }
-const QFont& KChatBase::systemMessageFont() const
+const TQFont& KChatBase::systemMessageFont() const
{ return d->mSystemMessageFont; }
void KChatBase::saveConfig(KConfig* conf)
{
- QString oldGroup;
+ TQString oldGroup;
if (!conf) {
conf = kapp->config();
oldGroup = conf->group();
@@ -487,7 +487,7 @@ void KChatBase::saveConfig(KConfig* conf)
void KChatBase::readConfig(KConfig* conf)
{
- QString oldGroup;
+ TQString oldGroup;
if (!conf) {
conf = kapp->config();
oldGroup = conf->group();
diff --git a/libkdegames/kchatbase.h b/libkdegames/kchatbase.h
index 07f786f9..e808dd1d 100644
--- a/libkdegames/kchatbase.h
+++ b/libkdegames/kchatbase.h
@@ -19,9 +19,9 @@
#ifndef __KCHATBASE_H__
#define __KCHATBASE_H__
-#include <qframe.h>
-#include <qstring.h>
-#include <qlistbox.h>
+#include <tqframe.h>
+#include <tqstring.h>
+#include <tqlistbox.h>
#include <kglobalsettings.h>
#include <kdemacros.h>
@@ -33,7 +33,7 @@ class KConfig;
class KChatBaseTextPrivate;
/**
- * A QListBoxText implementation for KChatBase.
+ * A TQListBoxText implementation for KChatBase.
*
* It supports different colors, text fonts, ...
*
@@ -53,12 +53,12 @@ public:
/**
* Constructs a KChatBaseText object with the player and text part
**/
- KChatBaseText(const QString& player, const QString& text);
+ KChatBaseText(const TQString& player, const TQString& text);
/**
* Constructs a KChatBaseText object without player part
**/
- KChatBaseText(const QString& text);
+ KChatBaseText(const TQString& text);
/**
* Destruct a KChatBaseText object.
@@ -72,7 +72,7 @@ public:
* @see setMessage
* @param name The name of the sender (e.g. the player)
**/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* Set the text part of a message. A message is usually shown like
@@ -81,33 +81,33 @@ public:
* See also setName
* @param message The message that has been sent
**/
- void setMessage(const QString& message);
+ void setMessage(const TQString& message);
/**
* @return The name part of a message.
* @see setName
**/
- const QString& name() const;
+ const TQString& name() const;
/**
* @return The message text.
* @see setMessage
**/
- const QString& message() const;
+ const TQString& message() const;
/**
* You can set the font of the sender name independently of the message
* itself. This font is used as the "name: " part of the message.
* @return The font that is used for the name
**/
- QFont nameFont() const;
+ TQFont nameFont() const;
/**
* You can set the font of the message independently of the sender name.
* This font is used as the text part of the message.
* @return The font thaz is used for message text
**/
- QFont messageFont() const;
+ TQFont messageFont() const;
/**
* Set the font for the name.
@@ -116,7 +116,7 @@ public:
* don't delete the object. This way there is only one object for a lot
* of messages in memory.
**/
- void setNameFont(const QFont* font);
+ void setNameFont(const TQFont* font);
/**
* Set the font for the message text.
@@ -125,20 +125,20 @@ public:
* don't delete the object! This way there is only one object for a lot
* of messages in memory.
**/
- void setMessageFont(const QFont* font);
+ void setMessageFont(const TQFont* font);
/**
**/
- virtual int width(QListBox* ) const;
+ virtual int width(TQListBox* ) const;
/**
**/
- virtual int height(QListBox* ) const;
+ virtual int height(TQListBox* ) const;
protected:
/**
**/
- virtual void paint(QPainter*);
+ virtual void paint(TQPainter*);
private:
void init();
@@ -191,7 +191,7 @@ public:
* choose where to send messages to (either globally or just to some
* players) will not be added.
**/
- KChatBase(QWidget* parent, bool noComboBox = false);
+ KChatBase(TQWidget* parent, bool noComboBox = false);
/**
* Destruct the KChatBase object
@@ -209,7 +209,7 @@ public:
* string that was set by setFromName or the name of the player
* that was set by setFromPlayer
**/
- virtual const QString& fromName() const = 0;
+ virtual const TQString& fromName() const = 0;
/**
* Adds a new entry in the combo box. The default is "send to all
@@ -222,7 +222,7 @@ public:
* combo box. See nextId
* @return True if successful, otherwise false (e.g. if the id is already used)
**/
- bool addSendingEntry(const QString& text, int id);
+ bool addSendingEntry(const TQString& text, int id);
/**
* Inserts a new entry in the combo box.
@@ -235,14 +235,14 @@ public:
* at the bottom
* @return True if successful, otherwise false (e.g. if the id is already used)
**/
- bool insertSendingEntry(const QString& text, int id, int index = -1);
+ bool insertSendingEntry(const TQString& text, int id, int index = -1);
/**
* This changes a combo box entry.
* @param text The new text of the entry
* @param id The ID of the item to be changed
**/
- void changeSendingEntry(const QString& text, int id);
+ void changeSendingEntry(const TQString& text, int id);
/**
* This selects a combo box entry.
@@ -295,13 +295,13 @@ public:
* Set the font that used used for the name part of a message. See also
* nameFont and setBothFont
**/
- void setNameFont(const QFont& font);
+ void setNameFont(const TQFont& font);
/**
* Set the font that used used for the message part of a message.
* @see messageFont, setBothFont
**/
- void setMessageFont(const QFont& font);
+ void setMessageFont(const TQFont& font);
/**
* This sets both - nameFont and messageFont to font. You
@@ -309,25 +309,25 @@ public:
* these parts of a message.
* @param font A font used for both nameFont and messageFont
**/
- void setBothFont(const QFont& font);
+ void setBothFont(const TQFont& font);
/**
* Same as setNameFont but applies only to system messages.
* @see layoutSystemMessage
**/
- void setSystemNameFont(const QFont& font);
+ void setSystemNameFont(const TQFont& font);
/**
* Same as setMessageFont but applies only to system messages.
* @see layoutSystemMessage
**/
- void setSystemMessageFont(const QFont& font);
+ void setSystemMessageFont(const TQFont& font);
/**
* Same as setBothFont but applies only to system messages.
* @see layoutSystemMessage
**/
- void setSystemBothFont(const QFont& font);
+ void setSystemBothFont(const TQFont& font);
/**
* This font should be used for the name (the "from: " part) of a
@@ -336,7 +336,7 @@ public:
* layoutMessage you should do this yourself.
* @return The font that is used for the name part of the message.
**/
- const QFont& nameFont() const;
+ const TQFont& nameFont() const;
/**
* This font should be used for a message. layoutMessage sets the
@@ -345,19 +345,19 @@ public:
* messageFont() yourself.
* @return The font that is used for a message
**/
- const QFont& messageFont() const;
+ const TQFont& messageFont() const;
/**
* Same as systemNameFont but applies only to system messages.
* @see layoutSystemMessage
**/
- const QFont& systemNameFont() const;
+ const TQFont& systemNameFont() const;
/**
* Same as systemMessageFont but applies only to system messages.
* @see layoutSystemMessage
**/
- const QFont& systemMessageFont() const;
+ const TQFont& systemMessageFont() const;
/**
* Save the configuration of the dialog to a KConfig object. If
@@ -410,7 +410,7 @@ public slots:
* @param fromName The player who sent this message
* @param text The text to be added
**/
- virtual void addMessage(const QString& fromName, const QString& text);
+ virtual void addMessage(const TQString& fromName, const TQString& text);
/**
* This works just like addMessage but adds a system message.
@@ -419,7 +419,7 @@ public slots:
*
* You may wish to use this to display status information from your game.
**/
- virtual void addSystemMessage(const QString& fromName, const QString& text);
+ virtual void addSystemMessage(const TQString& fromName, const TQString& text);
/**
* This member function is mainly internally used to add a message. It
@@ -429,9 +429,9 @@ public slots:
*
* But you may want to replace this in a derived class to create a
* non-default (maybe nicer ;-) ) behaviour
- * @param item The QListBoxItem that is being added
+ * @param item The TQListBoxItem that is being added
**/
- virtual void addItem(const QListBoxItem* item);
+ virtual void addItem(const TQListBoxItem* item);
/**
@@ -449,9 +449,9 @@ public slots:
signals:
/**
* Emitted when the user right-clicks on a list item.
- * @see QListBox::rightButtonClicked
+ * @see TQListBox::rightButtonClicked
**/
- void rightButtonClicked(QListBoxItem*, const QPoint&);
+ void rightButtonClicked(TQListBoxItem*, const TQPoint&);
protected:
/**
@@ -465,7 +465,7 @@ protected:
* Must be implemented in derived classes
* @param text The message to be sent
**/
- virtual void returnPressed(const QString& text) = 0;
+ virtual void returnPressed(const TQString& text) = 0;
/**
* Replace to customise the combo box.
@@ -474,24 +474,24 @@ protected:
* @param name The name of the player
* @return The string as it will be shown in the combo box
**/
- virtual QString comboBoxItem(const QString& name) const;
+ virtual TQString comboBoxItem(const TQString& name) const;
/**
- * Create a QListBoxItem for this message. This function is not yet
+ * Create a TQListBoxItem for this message. This function is not yet
* written usefully - currently just a QListBoxTex object is
* created which shows the message in this format: "fromName: text".
* This should fit most peoples needs but needs further improvements.
**/
- virtual QListBoxItem* layoutMessage(const QString& fromName, const QString& text);
+ virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text);
/**
- * Create a QListBoxItem for this message. This does the same as
+ * Create a TQListBoxItem for this message. This does the same as
* layoutMessage but generates a system message. You might want to
* use such a message to display e.g. status information from your game.
*
* The default implementation just prepends "--- ".
**/
- virtual QListBoxItem* layoutSystemMessage(const QString& fromName, const QString& text);
+ virtual TQListBoxItem* layoutSystemMessage(const TQString& fromName, const TQString& text);
private slots:
/**
@@ -499,7 +499,7 @@ private slots:
* Then add the message to the KCompletion object of the KLineEdit
* widget and call returnPressed
**/
- void slotReturnPressed(const QString&);
+ void slotReturnPressed(const TQString&);
private:
void init(bool noComboBox);
diff --git a/libkdegames/kchatdialog.cpp b/libkdegames/kchatdialog.cpp
index bd196e7c..9cfbefff 100644
--- a/libkdegames/kchatdialog.cpp
+++ b/libkdegames/kchatdialog.cpp
@@ -24,9 +24,9 @@
#include <klocale.h>
#include <kfontdialog.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
class KChatDialogPrivate
{
@@ -43,19 +43,19 @@ class KChatDialogPrivate
mChat = 0;
}
- QFrame* mTextPage;
+ TQFrame* mTextPage;
- QLabel* mNamePreview;
- QLabel* mTextPreview;
- QLabel* mSystemNamePreview;
- QLabel* mSystemTextPreview;
+ TQLabel* mNamePreview;
+ TQLabel* mTextPreview;
+ TQLabel* mSystemNamePreview;
+ TQLabel* mSystemTextPreview;
- QLineEdit* mMaxMessages;
+ TQLineEdit* mMaxMessages;
KChatBase* mChat;
};
-KChatDialog::KChatDialog(KChatBase* chat, QWidget* parent, bool modal)
+KChatDialog::KChatDialog(KChatBase* chat, TQWidget* parent, bool modal)
// : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true)
: KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true)
{
@@ -63,7 +63,7 @@ KChatDialog::KChatDialog(KChatBase* chat, QWidget* parent, bool modal)
plugChatWidget(chat);
}
-KChatDialog::KChatDialog(QWidget* parent, bool modal)
+KChatDialog::KChatDialog(TQWidget* parent, bool modal)
// : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true)
: KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true)
{
@@ -80,100 +80,100 @@ void KChatDialog::init()
d = new KChatDialogPrivate;
// d->mTextPage = addPage(i18n("&Messages"));// not a good name - game Messages?
d->mTextPage = plainPage();
- QGridLayout* layout = new QGridLayout(d->mTextPage, 7, 2, KDialog::marginHint(), KDialog::spacingHint());
+ TQGridLayout* layout = new TQGridLayout(d->mTextPage, 7, 2, KDialog::marginHint(), KDialog::spacingHint());
// General fonts
- QPushButton* nameFont = new QPushButton(i18n("Name Font..."), d->mTextPage);
- connect(nameFont, SIGNAL(pressed()), this, SLOT(slotGetNameFont()));
+ TQPushButton* nameFont = new TQPushButton(i18n("Name Font..."), d->mTextPage);
+ connect(nameFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetNameFont()));
layout->addWidget(nameFont, 0, 0);
- QPushButton* textFont = new QPushButton(i18n("Text Font..."), d->mTextPage);
- connect(textFont, SIGNAL(pressed()), this, SLOT(slotGetTextFont()));
+ TQPushButton* textFont = new TQPushButton(i18n("Text Font..."), d->mTextPage);
+ connect(textFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetTextFont()));
layout->addWidget(textFont, 0, 1);
- QFrame* messagePreview = new QFrame(d->mTextPage);
- messagePreview->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
- QHBoxLayout* messageLayout = new QHBoxLayout(messagePreview);
+ TQFrame* messagePreview = new TQFrame(d->mTextPage);
+ messagePreview->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken);
+ TQHBoxLayout* messageLayout = new TQHBoxLayout(messagePreview);
layout->addMultiCellWidget(messagePreview, 1, 1, 0, 1);
- d->mNamePreview = new QLabel(i18n("Player: "), messagePreview);
+ d->mNamePreview = new TQLabel(i18n("Player: "), messagePreview);
messageLayout->addWidget(d->mNamePreview, 0);
- d->mTextPreview = new QLabel(i18n("This is a player message"), messagePreview);
+ d->mTextPreview = new TQLabel(i18n("This is a player message"), messagePreview);
messageLayout->addWidget(d->mTextPreview, 1);
layout->addRowSpacing(2, 10);
// System Message fonts
- QLabel* systemMessages = new QLabel(i18n("System Messages - Messages directly sent from the game"), d->mTextPage);
+ TQLabel* systemMessages = new TQLabel(i18n("System Messages - Messages directly sent from the game"), d->mTextPage);
layout->addMultiCellWidget(systemMessages, 3, 3, 0, 1);
- QPushButton* systemNameFont = new QPushButton(i18n("Name Font..."), d->mTextPage);
- connect(systemNameFont, SIGNAL(pressed()), this, SLOT(slotGetSystemNameFont()));
+ TQPushButton* systemNameFont = new TQPushButton(i18n("Name Font..."), d->mTextPage);
+ connect(systemNameFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetSystemNameFont()));
layout->addWidget(systemNameFont, 4, 0);
- QPushButton* systemTextFont = new QPushButton(i18n("Text Font..."), d->mTextPage);
- connect(systemTextFont, SIGNAL(pressed()), this, SLOT(slotGetSystemTextFont()));
+ TQPushButton* systemTextFont = new TQPushButton(i18n("Text Font..."), d->mTextPage);
+ connect(systemTextFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetSystemTextFont()));
layout->addWidget(systemTextFont, 4, 1);
- QFrame* systemMessagePreview = new QFrame(d->mTextPage);
- systemMessagePreview->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
- QHBoxLayout* systemMessageLayout = new QHBoxLayout(systemMessagePreview);
+ TQFrame* systemMessagePreview = new TQFrame(d->mTextPage);
+ systemMessagePreview->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken);
+ TQHBoxLayout* systemMessageLayout = new TQHBoxLayout(systemMessagePreview);
layout->addMultiCellWidget(systemMessagePreview, 5, 5, 0, 1);
- d->mSystemNamePreview = new QLabel(i18n("--- Game: "), systemMessagePreview);
+ d->mSystemNamePreview = new TQLabel(i18n("--- Game: "), systemMessagePreview);
systemMessageLayout->addWidget(d->mSystemNamePreview, 0);
- d->mSystemTextPreview = new QLabel(i18n("This is a system message"), systemMessagePreview);
+ d->mSystemTextPreview = new TQLabel(i18n("This is a system message"), systemMessagePreview);
systemMessageLayout->addWidget(d->mSystemTextPreview, 1);
// message count
- QLabel* maxMessages = new QLabel(i18n("Maximal number of messages (-1 = unlimited):"), d->mTextPage);
+ TQLabel* maxMessages = new TQLabel(i18n("Maximal number of messages (-1 = unlimited):"), d->mTextPage);
layout->addWidget(maxMessages, 6, 0);
- d->mMaxMessages = new QLineEdit(d->mTextPage);
- d->mMaxMessages->setText(QString::number(-1));
+ d->mMaxMessages = new TQLineEdit(d->mTextPage);
+ d->mMaxMessages->setText(TQString::number(-1));
layout->addWidget(d->mMaxMessages, 6, 1);
}
void KChatDialog::slotGetNameFont()
{
- QFont font = nameFont();
+ TQFont font = nameFont();
KFontDialog::getFont(font);
setNameFont(font);
}
void KChatDialog::slotGetTextFont()
{
- QFont font = textFont();
+ TQFont font = textFont();
KFontDialog::getFont(font);
setTextFont(font);
}
void KChatDialog::slotGetSystemNameFont()
{
- QFont font = systemNameFont();
+ TQFont font = systemNameFont();
KFontDialog::getFont(font);
setSystemNameFont(font);
}
void KChatDialog::slotGetSystemTextFont()
{
- QFont font = systemTextFont();
+ TQFont font = systemTextFont();
KFontDialog::getFont(font);
setSystemTextFont(font);
}
-QFont KChatDialog::nameFont() const
+TQFont KChatDialog::nameFont() const
{
return d->mNamePreview->font();
}
-QFont KChatDialog::textFont() const
+TQFont KChatDialog::textFont() const
{
return d->mTextPreview->font();
}
-QFont KChatDialog::systemNameFont() const
+TQFont KChatDialog::systemNameFont() const
{
return d->mSystemNamePreview->font();
}
-QFont KChatDialog::systemTextFont() const
+TQFont KChatDialog::systemTextFont() const
{
return d->mSystemTextPreview->font();
}
@@ -215,29 +215,29 @@ void KChatDialog::slotApply()
configureChatWidget(d->mChat);
}
-void KChatDialog::setNameFont(QFont f)
+void KChatDialog::setNameFont(TQFont f)
{
d->mNamePreview->setFont(f);
}
-void KChatDialog::setTextFont(QFont f)
+void KChatDialog::setTextFont(TQFont f)
{
d->mTextPreview->setFont(f);
}
-void KChatDialog::setSystemNameFont(QFont f)
+void KChatDialog::setSystemNameFont(TQFont f)
{
d->mSystemNamePreview->setFont(f);
}
-void KChatDialog::setSystemTextFont(QFont f)
+void KChatDialog::setSystemTextFont(TQFont f)
{
d->mSystemTextPreview->setFont(f);
}
void KChatDialog::setMaxMessages(int max)
{
- d->mMaxMessages->setText(QString::number(max));
+ d->mMaxMessages->setText(TQString::number(max));
}
int KChatDialog::maxMessages() const
diff --git a/libkdegames/kchatdialog.h b/libkdegames/kchatdialog.h
index 96b3eef2..853dd94a 100644
--- a/libkdegames/kchatdialog.h
+++ b/libkdegames/kchatdialog.h
@@ -34,14 +34,14 @@ public:
/**
* Construct a KChatDialog widget
**/
- KChatDialog(QWidget* parent, bool modal = false);
+ KChatDialog(TQWidget* parent, bool modal = false);
/**
* Construct a KChatDialog widget which automatically configures the
* @ref KChatBase widget. You probably want to use this as you don't
* have to care about the configuration stuff yourself.
**/
- KChatDialog(KChatBase* chatWidget, QWidget* parent, bool modal = false);
+ KChatDialog(KChatBase* chatWidget, TQWidget* parent, bool modal = false);
/**
* Destruct the dialog
@@ -52,23 +52,23 @@ public:
* @return The font that shall be used as the "name: " part of a normal
* message.
**/
- QFont nameFont() const;
+ TQFont nameFont() const;
/**
* @return The font that shall be used for normal messages.
**/
- QFont textFont() const;
+ TQFont textFont() const;
/**
* @return The font that shall be used as the "name: " part of a system
* (game) message.
**/
- QFont systemNameFont() const;
+ TQFont systemNameFont() const;
/**
* @return The font that shall be used for a system (game) message.
**/
- QFont systemTextFont() const;
+ TQFont systemTextFont() const;
/**
* Set the widget that will be configured by the dialog. Use this if you
@@ -103,10 +103,10 @@ protected slots:
virtual void slotOk();
private:
- void setNameFont(QFont);
- void setTextFont(QFont);
- void setSystemNameFont(QFont);
- void setSystemTextFont(QFont);
+ void setNameFont(TQFont);
+ void setTextFont(TQFont);
+ void setSystemNameFont(TQFont);
+ void setSystemTextFont(TQFont);
void setMaxMessages(int max);
private:
diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp
index 4d2d90e0..575b3090 100644
--- a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp
+++ b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp
@@ -24,15 +24,15 @@
#include <knuminput.h>
#include <klocale.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qvbuttongroup.h>
-#include <qlayout.h>
-#include <qradiobutton.h>
-#include <qlabel.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqvbuttongroup.h>
+#include <tqlayout.h>
+#include <tqradiobutton.h>
+#include <tqlabel.h>
#include <dnssd/servicebrowser.h>
-#include <qpushbutton.h>
-#include <qgrid.h>
+#include <tqpushbutton.h>
+#include <tqgrid.h>
class KGameConnectWidgetPrivate
{
@@ -46,42 +46,42 @@ class KGameConnectWidgetPrivate
}
KIntNumInput* mPort;
- QLineEdit* mHost; //KLineEdit?
- QVButtonGroup* mButtonGroup;
- QComboBox *mClientName;
- QLabel *mClientNameLabel;
+ TQLineEdit* mHost; //KLineEdit?
+ TQVButtonGroup* mButtonGroup;
+ TQComboBox *mClientName;
+ TQLabel *mClientNameLabel;
DNSSD::ServiceBrowser *mBrowser;
- QLabel *mServerNameLabel;
- QLineEdit *mServerName;
- QString mType;
+ TQLabel *mServerNameLabel;
+ TQLineEdit *mServerName;
+ TQString mType;
};
-KGameConnectWidget::KGameConnectWidget(QWidget* parent) : QWidget(parent)
+KGameConnectWidget::KGameConnectWidget(TQWidget* parent) : TQWidget(parent)
{
d = new KGameConnectWidgetPrivate;
- QVBoxLayout* vb = new QVBoxLayout(this, KDialog::spacingHint());
- d->mButtonGroup = new QVButtonGroup(this);
+ TQVBoxLayout* vb = new TQVBoxLayout(this, KDialog::spacingHint());
+ d->mButtonGroup = new TQVButtonGroup(this);
vb->addWidget(d->mButtonGroup);
- connect(d->mButtonGroup, SIGNAL(clicked(int)), this, SLOT(slotTypeChanged(int)));
- (void)new QRadioButton(i18n("Create a network game"), d->mButtonGroup);
- (void)new QRadioButton(i18n("Join a network game"), d->mButtonGroup);
+ connect(d->mButtonGroup, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slotTypeChanged(int)));
+ (void)new TQRadioButton(i18n("Create a network game"), d->mButtonGroup);
+ (void)new TQRadioButton(i18n("Join a network game"), d->mButtonGroup);
- QGrid* g = new QGrid(2, this);
+ TQGrid* g = new TQGrid(2, this);
vb->addWidget(g);
g->setSpacing(KDialog::spacingHint());
- d->mServerNameLabel = new QLabel(i18n("Game name:"), g);
- d->mServerName = new QLineEdit(g);
- d->mClientNameLabel = new QLabel(i18n("Network games:"), g);
- d->mClientName = new QComboBox(g);
- connect(d->mClientName,SIGNAL(activated(int)),SLOT(slotGameSelected(int)));
- (void)new QLabel(i18n("Port to connect to:"), g);
+ d->mServerNameLabel = new TQLabel(i18n("Game name:"), g);
+ d->mServerName = new TQLineEdit(g);
+ d->mClientNameLabel = new TQLabel(i18n("Network games:"), g);
+ d->mClientName = new TQComboBox(g);
+ connect(d->mClientName,TQT_SIGNAL(activated(int)),TQT_SLOT(slotGameSelected(int)));
+ (void)new TQLabel(i18n("Port to connect to:"), g);
d->mPort = new KIntNumInput(g);
- (void)new QLabel(i18n("Host to connect to:"), g);
- d->mHost = new QLineEdit(g);
+ (void)new TQLabel(i18n("Host to connect to:"), g);
+ d->mHost = new TQLineEdit(g);
- QPushButton *button=new QPushButton(i18n("&Start Network"), this);
- connect(button, SIGNAL(clicked()), this, SIGNAL(signalNetworkSetup()));
+ TQPushButton *button=new TQPushButton(i18n("&Start Network"), this);
+ connect(button, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(signalNetworkSetup()));
vb->addWidget(button);
// Hide until type is set
d->mClientName->hide();
@@ -107,12 +107,12 @@ void KGameConnectWidget::showDnssdControls()
}
}
-void KGameConnectWidget::setType(const QString& type)
+void KGameConnectWidget::setType(const TQString& type)
{
d->mType = type;
delete d->mBrowser;
d->mBrowser = new DNSSD::ServiceBrowser(type);
- connect(d->mBrowser,SIGNAL(finished()),SLOT(slotGamesFound()));
+ connect(d->mBrowser,TQT_SIGNAL(finished()),TQT_SLOT(slotGamesFound()));
d->mBrowser->startBrowse();
showDnssdControls();
}
@@ -122,25 +122,25 @@ void KGameConnectWidget::slotGamesFound()
bool autoselect=false;
if (!d->mClientName->count()) autoselect=true;
d->mClientName->clear();
- QStringList names;
- QValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = d->mBrowser->services().end();
- for (QValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = d->mBrowser->services().begin();
+ TQStringList names;
+ TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = d->mBrowser->services().end();
+ for (TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = d->mBrowser->services().begin();
it!=itEnd; ++it) names << (*it)->serviceName();
d->mClientName->insertStringList(names);
if (autoselect && d->mClientName->count()) slotGameSelected(0);
}
-void KGameConnectWidget::setName(const QString& name)
+void KGameConnectWidget::setName(const TQString& name)
{
d->mServerName->setText(name);
}
-QString KGameConnectWidget::gameName() const
+TQString KGameConnectWidget::gameName() const
{
return d->mServerName->text();
}
-QString KGameConnectWidget::type() const
+TQString KGameConnectWidget::type() const
{
return d->mType;
}
@@ -160,12 +160,12 @@ KGameConnectWidget::~KGameConnectWidget()
delete d;
}
-QString KGameConnectWidget::host() const
+TQString KGameConnectWidget::host() const
{
if (d->mHost->isEnabled()) {
return d->mHost->text();
} else {
- return QString::null;
+ return TQString::null;
}
}
@@ -174,7 +174,7 @@ unsigned short int KGameConnectWidget::port() const
return d->mPort->value();
}
-void KGameConnectWidget::setHost(const QString& host)
+void KGameConnectWidget::setHost(const TQString& host)
{
d->mHost->setText(host);
}
@@ -213,11 +213,11 @@ class KGameConnectDialogPrivate
};
// buttonmask =Ok|Cancel
-KGameConnectDialog::KGameConnectDialog(QWidget* parent,int buttonmask) : KDialogBase(Plain,
+KGameConnectDialog::KGameConnectDialog(TQWidget* parent,int buttonmask) : KDialogBase(Plain,
i18n("Network Game"),buttonmask , Ok, parent, 0, true, buttonmask!=0)
{
d = new KGameConnectDialogPrivate;
- QVBoxLayout* vb = new QVBoxLayout(plainPage(), spacingHint());
+ TQVBoxLayout* vb = new TQVBoxLayout(plainPage(), spacingHint());
d->mConnect = new KGameConnectWidget(plainPage());
vb->addWidget(d->mConnect);
}
@@ -228,7 +228,7 @@ KGameConnectDialog::~KGameConnectDialog()
}
int KGameConnectDialog::initConnection( unsigned short int& port,
- QString& host, QWidget* parent, bool server)
+ TQString& host, TQWidget* parent, bool server)
{
KGameConnectDialog d(parent);
d.setHost(host);
@@ -240,14 +240,14 @@ int KGameConnectDialog::initConnection( unsigned short int& port,
}
int result = d.exec();
- if (result == QDialog::Accepted) {
+ if (result == TQDialog::Accepted) {
host = d.host();
port = d.port();
}
return result;
}
-QString KGameConnectDialog::host() const
+TQString KGameConnectDialog::host() const
{
return d->mConnect->host();
}
@@ -257,7 +257,7 @@ unsigned short int KGameConnectDialog::port() const
return d->mConnect->port();
}
-void KGameConnectDialog::setHost(const QString& host)
+void KGameConnectDialog::setHost(const TQString& host)
{
d->mConnect->setHost(host);
}
diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.h b/libkdegames/kgame/dialogs/kgameconnectdialog.h
index acbf21d2..fdb0be4f 100644
--- a/libkdegames/kgame/dialogs/kgameconnectdialog.h
+++ b/libkdegames/kgame/dialogs/kgameconnectdialog.h
@@ -30,19 +30,19 @@ class KGameConnectWidget : public QWidget
{
Q_OBJECT
public:
- KGameConnectWidget(QWidget* parent);
+ KGameConnectWidget(TQWidget* parent);
virtual ~KGameConnectWidget();
/**
* @param host The host to connect to by default
**/
- void setHost(const QString& host);
+ void setHost(const TQString& host);
/**
- * @return The host to connect to or QString::null if the user wants to
+ * @return The host to connect to or TQString::null if the user wants to
* be the MASTER
**/
- QString host() const;
+ TQString host() const;
/**
* @param port The port that will be shown by default
@@ -66,24 +66,24 @@ public:
* It should be unique for application.
* @since 3.4
**/
- void setType(const QString& type);
+ void setType(const TQString& type);
/**
* @return service type
*/
- QString type() const;
+ TQString type() const;
/**
* Set game name for publishing.
* @param name Game name. Important only for server mode. If not
* set hostname will be used. In case of name conflict -2, -3 and so on will be added to name.
*/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* @return game name.
*/
- QString gameName() const;
+ TQString gameName() const;
protected slots:
/**
@@ -108,7 +108,7 @@ private:
* @short Dialog to ask for host and port
*
* This Dialog is used to create a game. You call initConnection(port,
- * QString::null, parent, true) to create a network game (as a server)
+ * TQString::null, parent, true) to create a network game (as a server)
* or initConnection(port, host, parent) to join a network game.
*
* @author Andreas Beckermann <[email protected]>
@@ -117,7 +117,7 @@ class KGameConnectDialog : public KDialogBase
{
Q_OBJECT
public:
- KGameConnectDialog(QWidget* parent = 0,int buttonmask=Ok|Cancel);
+ KGameConnectDialog(TQWidget* parent = 0,int buttonmask=Ok|Cancel);
virtual ~KGameConnectDialog();
/**
@@ -125,23 +125,23 @@ public:
* server game, depending on user's choice.
* @param port The port the user wants to connect to.
* @param host The host the user wants to connect to. Will be
- * QString::null if server game is chosen
+ * TQString::null if server game is chosen
* @param parent The parent of the dialog
* @param server True to create a network game per default, false to
* join a game by default
**/
- static int initConnection(unsigned short int& port, QString& host, QWidget* parent, bool server = false);
+ static int initConnection(unsigned short int& port, TQString& host, TQWidget* parent, bool server = false);
/**
* @param host The host to connect to by default
**/
- void setHost(const QString& host);
+ void setHost(const TQString& host);
/**
- * @return The host to connect to or QString::null if the user wants to
+ * @return The host to connect to or TQString::null if the user wants to
* be the MASTER
**/
- QString host() const;
+ TQString host() const;
/**
* @param port The port that will be shown by default
diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
index b112b04c..09a35e56 100644
--- a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
+++ b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
@@ -32,11 +32,11 @@
#include <kpushbutton.h>
#include <kstdguiitem.h>
-#include <qlayout.h>
-#include <qstring.h>
-#include <qintdict.h>
-#include <qlabel.h>
-#include <qdatetime.h>
+#include <tqlayout.h>
+#include <tqstring.h>
+#include <tqintdict.h>
+#include <tqlabel.h>
+#include <tqdatetime.h>
#include <typeinfo>
@@ -85,42 +85,42 @@ public:
const KGame* mGame;
- QFrame* mGamePage;
+ TQFrame* mGamePage;
KListView* mGameProperties;
- QListViewItem* mGameAddress;
- QListViewItem* mGameId;
- QListViewItem* mGameCookie;
- QListViewItem* mGameMaster;
- QListViewItem* mGameAdmin;
- QListViewItem* mGameOffering;
- QListViewItem* mGameStatus;
- QListViewItem* mGameRunning;
- QListViewItem* mGameMaxPlayers;
- QListViewItem* mGameMinPlayers;
- QListViewItem* mGamePlayerCount;
+ TQListViewItem* mGameAddress;
+ TQListViewItem* mGameId;
+ TQListViewItem* mGameCookie;
+ TQListViewItem* mGameMaster;
+ TQListViewItem* mGameAdmin;
+ TQListViewItem* mGameOffering;
+ TQListViewItem* mGameStatus;
+ TQListViewItem* mGameRunning;
+ TQListViewItem* mGameMaxPlayers;
+ TQListViewItem* mGameMinPlayers;
+ TQListViewItem* mGamePlayerCount;
- QFrame* mPlayerPage;
+ TQFrame* mPlayerPage;
KListBox* mPlayerList;
KListView* mPlayerProperties;
- QListViewItem* mPlayerAddress;
- QListViewItem* mPlayerId;
- QListViewItem* mPlayerName;
- QListViewItem* mPlayerGroup;
- QListViewItem* mPlayerUserId;
- QListViewItem* mPlayerMyTurn;
- QListViewItem* mPlayerAsyncInput;
- QListViewItem* mPlayerKGameAddress;
- QListViewItem* mPlayerVirtual;
- QListViewItem* mPlayerActive;
- QListViewItem* mPlayerRtti;
- QListViewItem* mPlayerNetworkPriority;
-
- QFrame* mMessagePage;
+ TQListViewItem* mPlayerAddress;
+ TQListViewItem* mPlayerId;
+ TQListViewItem* mPlayerName;
+ TQListViewItem* mPlayerGroup;
+ TQListViewItem* mPlayerUserId;
+ TQListViewItem* mPlayerMyTurn;
+ TQListViewItem* mPlayerAsyncInput;
+ TQListViewItem* mPlayerKGameAddress;
+ TQListViewItem* mPlayerVirtual;
+ TQListViewItem* mPlayerActive;
+ TQListViewItem* mPlayerRtti;
+ TQListViewItem* mPlayerNetworkPriority;
+
+ TQFrame* mMessagePage;
KListView* mMessageList;
KListBox* mHideIdList;
};
-KGameDebugDialog::KGameDebugDialog(KGame* g, QWidget* parent, bool modal) :
+KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* parent, bool modal) :
KDialogBase(Tabbed, i18n("KGame Debug Dialog"), Close, Close,
parent, 0, modal, true)
{
@@ -141,8 +141,8 @@ KGameDebugDialog::~KGameDebugDialog()
void KGameDebugDialog::initGamePage()
{
d->mGamePage = addPage(i18n("Debug &KGame"));
- QVBoxLayout* topLayout = new QVBoxLayout(d->mGamePage, marginHint(), spacingHint());
- QHBoxLayout* layout = new QHBoxLayout(topLayout);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(d->mGamePage, marginHint(), spacingHint());
+ TQHBoxLayout* layout = new TQHBoxLayout(topLayout);
KListView* v = new KListView(d->mGamePage);
v->addColumn(i18n("Data"));
@@ -155,38 +155,38 @@ void KGameDebugDialog::initGamePage()
d->mGameProperties->addColumn(i18n("Policy"));
layout->addWidget(d->mGameProperties);
- QPushButton* b = new QPushButton(i18n("Update"), d->mGamePage);
- connect(b, SIGNAL(pressed()), this, SLOT(slotUpdateGameData()));
+ TQPushButton* b = new TQPushButton(i18n("Update"), d->mGamePage);
+ connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateGameData()));
topLayout->addWidget(b);
// game data
- d->mGameAddress = new QListViewItem(v, i18n("KGame Pointer"));
- d->mGameId = new QListViewItem(v, i18n("Game ID"));
- d->mGameCookie = new QListViewItem(v, i18n("Game Cookie"));
- d->mGameMaster = new QListViewItem(v, i18n("Is Master"));
- d->mGameAdmin = new QListViewItem(v, i18n("Is Admin"));
- d->mGameOffering = new QListViewItem(v, i18n("Is Offering Connections"));
- d->mGameStatus = new QListViewItem(v, i18n("Game Status"));
- d->mGameRunning = new QListViewItem(v, i18n("Game is Running"));
- d->mGameMaxPlayers = new QListViewItem(v, i18n("Maximal Players"));
- d->mGameMinPlayers = new QListViewItem(v, i18n("Minimal Players"));
- d->mGamePlayerCount = new QListViewItem(v, i18n("Players"));
+ d->mGameAddress = new TQListViewItem(v, i18n("KGame Pointer"));
+ d->mGameId = new TQListViewItem(v, i18n("Game ID"));
+ d->mGameCookie = new TQListViewItem(v, i18n("Game Cookie"));
+ d->mGameMaster = new TQListViewItem(v, i18n("Is Master"));
+ d->mGameAdmin = new TQListViewItem(v, i18n("Is Admin"));
+ d->mGameOffering = new TQListViewItem(v, i18n("Is Offering Connections"));
+ d->mGameStatus = new TQListViewItem(v, i18n("Game Status"));
+ d->mGameRunning = new TQListViewItem(v, i18n("Game is Running"));
+ d->mGameMaxPlayers = new TQListViewItem(v, i18n("Maximal Players"));
+ d->mGameMinPlayers = new TQListViewItem(v, i18n("Minimal Players"));
+ d->mGamePlayerCount = new TQListViewItem(v, i18n("Players"));
}
void KGameDebugDialog::initPlayerPage()
{
d->mPlayerPage = addPage(i18n("Debug &Players"));
- QVBoxLayout* topLayout = new QVBoxLayout(d->mPlayerPage, marginHint(), spacingHint());
- QHBoxLayout* layout = new QHBoxLayout(topLayout);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(d->mPlayerPage, marginHint(), spacingHint());
+ TQHBoxLayout* layout = new TQHBoxLayout(topLayout);
//TODO: connect to the KGame signals for joined/removed players!!!
- QVBoxLayout* listLayout = new QVBoxLayout(layout);
- QLabel* listLabel = new QLabel(i18n("Available Players"), d->mPlayerPage);
+ TQVBoxLayout* listLayout = new TQVBoxLayout(layout);
+ TQLabel* listLabel = new TQLabel(i18n("Available Players"), d->mPlayerPage);
listLayout->addWidget(listLabel);
d->mPlayerList = new KListBox(d->mPlayerPage);
- connect(d->mPlayerList, SIGNAL(executed(QListBoxItem*)), this, SLOT(slotUpdatePlayerData(QListBoxItem*)));
+ connect(d->mPlayerList, TQT_SIGNAL(executed(TQListBoxItem*)), this, TQT_SLOT(slotUpdatePlayerData(TQListBoxItem*)));
listLayout->addWidget(d->mPlayerList);
- d->mPlayerList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
+ d->mPlayerList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
KListView* v = new KListView(d->mPlayerPage);
layout->addWidget(v);
@@ -199,28 +199,28 @@ void KGameDebugDialog::initPlayerPage()
d->mPlayerProperties->addColumn(i18n("Policy"));
layout->addWidget(d->mPlayerProperties);
- QPushButton* b = new QPushButton(i18n("Update"), d->mPlayerPage);
- connect(b, SIGNAL(pressed()), this, SLOT(slotUpdatePlayerList()));
+ TQPushButton* b = new TQPushButton(i18n("Update"), d->mPlayerPage);
+ connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdatePlayerList()));
topLayout->addWidget(b);
- d->mPlayerAddress = new QListViewItem(v, i18n("Player Pointer"));
- d->mPlayerId = new QListViewItem(v, i18n("Player ID"));
- d->mPlayerName = new QListViewItem(v, i18n("Player Name"));
- d->mPlayerGroup = new QListViewItem(v, i18n("Player Group"));
- d->mPlayerUserId = new QListViewItem(v, i18n("Player User ID"));
- d->mPlayerMyTurn = new QListViewItem(v, i18n("My Turn"));
- d->mPlayerAsyncInput = new QListViewItem(v, i18n("Async Input"));
- d->mPlayerKGameAddress = new QListViewItem(v, i18n("KGame Address"));
- d->mPlayerVirtual = new QListViewItem(v, i18n("Player is Virtual"));
- d->mPlayerActive = new QListViewItem(v, i18n("Player is Active"));
- d->mPlayerRtti = new QListViewItem(v, i18n("RTTI"));
- d->mPlayerNetworkPriority = new QListViewItem(v, i18n("Network Priority"));
+ d->mPlayerAddress = new TQListViewItem(v, i18n("Player Pointer"));
+ d->mPlayerId = new TQListViewItem(v, i18n("Player ID"));
+ d->mPlayerName = new TQListViewItem(v, i18n("Player Name"));
+ d->mPlayerGroup = new TQListViewItem(v, i18n("Player Group"));
+ d->mPlayerUserId = new TQListViewItem(v, i18n("Player User ID"));
+ d->mPlayerMyTurn = new TQListViewItem(v, i18n("My Turn"));
+ d->mPlayerAsyncInput = new TQListViewItem(v, i18n("Async Input"));
+ d->mPlayerKGameAddress = new TQListViewItem(v, i18n("KGame Address"));
+ d->mPlayerVirtual = new TQListViewItem(v, i18n("Player is Virtual"));
+ d->mPlayerActive = new TQListViewItem(v, i18n("Player is Active"));
+ d->mPlayerRtti = new TQListViewItem(v, i18n("RTTI"));
+ d->mPlayerNetworkPriority = new TQListViewItem(v, i18n("Network Priority"));
}
void KGameDebugDialog::initMessagePage()
{
d->mMessagePage = addPage(i18n("Debug &Messages"));
- QGridLayout* layout = new QGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint());
+ TQGridLayout* layout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint());
d->mMessageList = new KListView(d->mMessagePage);
layout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3);
d->mMessageList->addColumn(i18n("Time"));
@@ -229,21 +229,21 @@ void KGameDebugDialog::initMessagePage()
d->mMessageList->addColumn(i18n("Sender"));
d->mMessageList->addColumn(i18n("ID - Text"));
- QPushButton* hide = new QPushButton(i18n("&>>"), d->mMessagePage);
- connect(hide, SIGNAL(pressed()), this, SLOT(slotHideId()));
+ TQPushButton* hide = new TQPushButton(i18n("&>>"), d->mMessagePage);
+ connect(hide, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotHideId()));
layout->addWidget(hide, 4, 4);
- QPushButton* show = new QPushButton(i18n("&<<"), d->mMessagePage);
- connect(show, SIGNAL(pressed()), this, SLOT(slotShowId()));
+ TQPushButton* show = new TQPushButton(i18n("&<<"), d->mMessagePage);
+ connect(show, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotShowId()));
layout->addWidget(show, 6, 4);
- QLabel* l = new QLabel(i18n("Do not show IDs:"), d->mMessagePage);
+ TQLabel* l = new TQLabel(i18n("Do not show IDs:"), d->mMessagePage);
layout->addMultiCellWidget(l, 0, 0, 5, 6);
d->mHideIdList = new KListBox(d->mMessagePage);
layout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6);
- QPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage);
- connect(clear, SIGNAL(pressed()), this, SLOT(slotClearMessages()));
+ TQPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage);
+ connect(clear, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearMessages()));
layout->addMultiCellWidget(clear, 10, 10, 0, 6);
//TODO: "show all but..." and "show nothing but..."
}
@@ -292,12 +292,12 @@ void KGameDebugDialog::slotUpdatePlayerData()
void KGameDebugDialog::slotUpdatePlayerList()
{
- QListBoxItem* i = d->mPlayerList->firstItem();
+ TQListBoxItem* i = d->mPlayerList->firstItem();
for (; i; i = d->mPlayerList->firstItem()) {
removePlayer(i);
}
- QPtrList<KPlayer> list = *d->mGame->playerList();
+ TQPtrList<KPlayer> list = *d->mGame->playerList();
for (KPlayer* p = list.first(); p; p = list.next()) {
addPlayer(p);
}
@@ -312,26 +312,26 @@ void KGameDebugDialog::slotUpdateGameData()
clearGameData();
- QString buf;
+ TQString buf;
buf.sprintf("%p", d->mGame);
d->mGameAddress->setText(1, buf);
- d->mGameId->setText(1, QString::number(d->mGame->gameId()));
- d->mGameCookie->setText(1, QString::number(d->mGame->cookie()));
+ d->mGameId->setText(1, TQString::number(d->mGame->gameId()));
+ d->mGameCookie->setText(1, TQString::number(d->mGame->cookie()));
d->mGameMaster->setText(1, d->mGame->isMaster() ? i18n("True") : i18n("False"));
d->mGameAdmin->setText(1, d->mGame->isAdmin() ? i18n("True") : i18n("False"));
d->mGameOffering->setText(1, d->mGame->isOfferingConnections() ? i18n("True") : i18n("False"));
- d->mGameStatus->setText(1, QString::number(d->mGame->gameStatus()));
+ d->mGameStatus->setText(1, TQString::number(d->mGame->gameStatus()));
d->mGameRunning->setText(1, d->mGame->isRunning() ? i18n("True") : i18n("False"));
- d->mGameMaxPlayers->setText(1, QString::number(d->mGame->maxPlayers()));
- d->mGameMinPlayers->setText(1, QString::number(d->mGame->minPlayers()));
- d->mGamePlayerCount->setText(1, QString::number(d->mGame->playerCount()));
+ d->mGameMaxPlayers->setText(1, TQString::number(d->mGame->maxPlayers()));
+ d->mGameMinPlayers->setText(1, TQString::number(d->mGame->minPlayers()));
+ d->mGamePlayerCount->setText(1, TQString::number(d->mGame->playerCount()));
//TODO ios
KGamePropertyHandler* handler = d->mGame->dataHandler();
- QIntDictIterator<KGamePropertyBase> it(handler->dict());
+ TQIntDictIterator<KGamePropertyBase> it(handler->dict());
while (it.current()) {
- QString policy;
+ TQString policy;
switch (it.current()->policy()) {
case KGamePropertyBase::PolicyClean:
policy = i18n("Clean");
@@ -347,7 +347,7 @@ void KGameDebugDialog::slotUpdateGameData()
policy = i18n("Undefined");
break;
}
- (void) new QListViewItem(d->mGameProperties,
+ (void) new TQListViewItem(d->mGameProperties,
handler->propertyName(it.current()->id()),
handler->propertyValue(it.current()),
policy);
@@ -356,7 +356,7 @@ void KGameDebugDialog::slotUpdateGameData()
}
}
-void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item)
+void KGameDebugDialog::slotUpdatePlayerData(TQListBoxItem* item)
{
if (!item || !d->mGame) {
return;
@@ -371,29 +371,29 @@ void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item)
clearPlayerData();
- QString buf;
+ TQString buf;
buf.sprintf("%p", p);
d->mPlayerAddress->setText(1, buf);
- d->mPlayerId->setText(1, QString::number(p->id()));
+ d->mPlayerId->setText(1, TQString::number(p->id()));
d->mPlayerName->setText(1, p->name());
d->mPlayerGroup->setText(1, p->group());
- d->mPlayerUserId->setText(1, QString::number(p->userId()));
+ d->mPlayerUserId->setText(1, TQString::number(p->userId()));
d->mPlayerMyTurn->setText(1, p->myTurn() ? i18n("True") : i18n("False"));
d->mPlayerAsyncInput->setText(1, p->asyncInput() ? i18n("True") : i18n("False"));
buf.sprintf("%p", p->game());
d->mPlayerKGameAddress->setText(1, buf);
d->mPlayerVirtual->setText(1, p->isVirtual() ? i18n("True") : i18n("False"));
d->mPlayerActive->setText(1, p->isActive() ? i18n("True") : i18n("False"));
- d->mPlayerRtti->setText(1, QString::number(p->rtti()));
- d->mPlayerNetworkPriority->setText(1, QString::number(p->networkPriority()));
+ d->mPlayerRtti->setText(1, TQString::number(p->rtti()));
+ d->mPlayerNetworkPriority->setText(1, TQString::number(p->networkPriority()));
//TODO ios
// Properties
KGamePropertyHandler * handler = p->dataHandler();
- QIntDictIterator<KGamePropertyBase> it((handler->dict()));
+ TQIntDictIterator<KGamePropertyBase> it((handler->dict()));
while (it.current()) {
- QString policy;
+ TQString policy;
switch (it.current()->policy()) {
case KGamePropertyBase::PolicyClean:
policy = i18n("Clean");
@@ -409,7 +409,7 @@ void KGameDebugDialog::slotUpdatePlayerData(QListBoxItem* item)
policy = i18n("Undefined");
break;
}
- (void)new QListViewItem(d->mPlayerProperties,
+ (void)new TQListViewItem(d->mPlayerProperties,
handler->propertyName(it.current()->id()),
handler->propertyValue(it.current()),
policy);
@@ -431,17 +431,17 @@ void KGameDebugDialog::setKGame(const KGame* g)
d->mGame = g;
if (g) {
//TODO: connect to the KGame signals for joined/removed players!!!
- connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame()));
+ connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame()));
// connect();
- QPtrList<KPlayer> list = *d->mGame->playerList();
+ TQPtrList<KPlayer> list = *d->mGame->playerList();
for (KPlayer* p = list.first(); p; p = list.next()) {
addPlayer(p);
}
slotUpdateGameData();
- connect(d->mGame, SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32)));
+ connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32)));
}
}
@@ -461,11 +461,11 @@ void KGameDebugDialog::addPlayer(KPlayer* p)
return;
}
- (void) new QListBoxText(d->mPlayerList, QString::number(p->id()));
+ (void) new TQListBoxText(d->mPlayerList, TQString::number(p->id()));
//TODO connect to signals, like deleted/removed, ...
}
-void KGameDebugDialog::removePlayer(QListBoxItem* i)
+void KGameDebugDialog::removePlayer(TQListBoxItem* i)
{
if (!i || !d->mGame) {
return;
@@ -486,7 +486,7 @@ void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32
if (!showId(msgid)) {
return;
}
- QString msgidText = KGameMessage::messageId2Text(msgid);
+ TQString msgidText = KGameMessage::messageId2Text(msgid);
if (msgidText.isNull()) {
if (msgid > KGameMessage::IdUser) {
emit signalRequestIdName(msgid-KGameMessage::IdUser, true, msgidText);
@@ -497,9 +497,9 @@ void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32
msgidText = i18n("Unknown");
}
}
- (void) new QListViewItem( d->mMessageList, QTime::currentTime().toString(),
- QString::number(msgid), QString::number(receiver),
- QString::number(sender), msgidText);
+ (void) new TQListViewItem( d->mMessageList, TQTime::currentTime().toString(),
+ TQString::number(msgid), TQString::number(receiver),
+ TQString::number(sender), msgidText);
}
void KGameDebugDialog::slotClearMessages()
@@ -509,7 +509,7 @@ void KGameDebugDialog::slotClearMessages()
void KGameDebugDialog::slotShowId()
{
-/* QListBoxItem* i = d->mHideIdList->firstItem();
+/* TQListBoxItem* i = d->mHideIdList->firstItem();
for (; i; i = i->next()) {
if (i->selected()) {
d->mHideIdList->removeItem(i->);
@@ -530,12 +530,12 @@ void KGameDebugDialog::slotHideId()
if (!showId(msgid)) {
return;
}
- (void)new QListBoxText(d->mHideIdList, QString::number(msgid));
+ (void)new TQListBoxText(d->mHideIdList, TQString::number(msgid));
}
bool KGameDebugDialog::showId(int msgid)
{
- QListBoxItem* i = d->mHideIdList->firstItem();
+ TQListBoxItem* i = d->mHideIdList->firstItem();
for (; i; i = i->next()) {
if (i->text().toInt() == msgid) {
return false;
diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.h b/libkdegames/kgame/dialogs/kgamedebugdialog.h
index 65afc92a..57f20c34 100644
--- a/libkdegames/kgame/dialogs/kgamedebugdialog.h
+++ b/libkdegames/kgame/dialogs/kgamedebugdialog.h
@@ -35,7 +35,7 @@ class KDE_EXPORT KGameDebugDialog : public KDialogBase
{
Q_OBJECT
public:
- KGameDebugDialog(KGame* g, QWidget* parent, bool modal = false);
+ KGameDebugDialog(KGame* g, TQWidget* parent, bool modal = false);
~KGameDebugDialog();
/**
@@ -89,7 +89,7 @@ signals:
* KGameMessage::GameMessageIds couldn't be found.
* @param name The name of the msgid. You have to fill this!
**/
- void signalRequestIdName(int messageid, bool userid, QString& name);
+ void signalRequestIdName(int messageid, bool userid, TQString& name);
protected:
void clearPages();
@@ -113,7 +113,7 @@ protected:
/**
* Remove a player from the list
**/
- void removePlayer(QListBoxItem* item);
+ void removePlayer(TQListBoxItem* item);
/**
* @return Whether messages with this msgid shall be displayed or not
@@ -123,10 +123,10 @@ protected:
protected slots:
/**
* Update the data of the player specified in item
- * @param item The @ref QListBoxItem of the player to be updated. Note
+ * @param item The @ref TQListBoxItem of the player to be updated. Note
* that the text of this item MUST be the ID of the player
**/
- void slotUpdatePlayerData(QListBoxItem* item);
+ void slotUpdatePlayerData(TQListBoxItem* item);
void slotShowId();
void slotHideId();
diff --git a/libkdegames/kgame/dialogs/kgamedialog.cpp b/libkdegames/kgame/dialogs/kgamedialog.cpp
index dc564b8e..c03df4ff 100644
--- a/libkdegames/kgame/dialogs/kgamedialog.cpp
+++ b/libkdegames/kgame/dialogs/kgamedialog.cpp
@@ -18,8 +18,8 @@
Boston, MA 02110-1301, USA.
*/
-#include <qlayout.h>
-#include <qvbox.h>
+#include <tqlayout.h>
+#include <tqvbox.h>
#include <klocale.h>
@@ -48,31 +48,31 @@ public:
mGame = 0;
}
- QVBox* mGamePage;
- QVBox* mNetworkPage;
- QVBox* mMsgServerPage;// unused here?
- QVBoxLayout* mTopLayout;
+ TQVBox* mGamePage;
+ TQVBox* mNetworkPage;
+ TQVBox* mMsgServerPage;// unused here?
+ TQVBoxLayout* mTopLayout;
KGameDialogNetworkConfig* mNetworkConfig;
KGameDialogGeneralConfig* mGameConfig;
// a list of all config widgets added to this dialog
- QPtrList<KGameDialogConfig> mConfigWidgets;
+ TQPtrList<KGameDialogConfig> mConfigWidgets;
// just pointers:
KPlayer* mOwner;
KGame* mGame;
};
-KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const QString& title,
- QWidget* parent, bool modal)
+KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
+ TQWidget* parent, bool modal)
: KDialogBase(Tabbed, title, Ok|Default|Apply,
Ok, parent, 0, modal, true)
{
init(g, owner);
}
-KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const QString& title,
- QWidget* parent, long initConfigs, int chatMsgId, bool modal)
+KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
+ TQWidget* parent, long initConfigs, int chatMsgId, bool modal)
: KDialogBase(Tabbed, title, Ok|Default|Apply,
Ok, parent, 0, modal, true)
{
@@ -165,7 +165,7 @@ void KGameDialog::addMsgServerConfig(KGameDialogMsgServerConfig* msgConf)
d->mMsgServerPage = addConfigPage(msgConf, i18n("&Message Server"));
}
-void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, QVBox* parent)
+void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent)
{
if (!chat) {
return;
@@ -180,7 +180,7 @@ void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, QVBox* parent)
addConfigWidget(chat, parent);
}
-void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, QVBox* parent)
+void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent)
{
if (!c) {
return;
@@ -195,9 +195,9 @@ void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, QVBox* paren
addConfigWidget(c, parent);
}
-QVBox *KGameDialog::configPage(ConfigOptions which)
+TQVBox *KGameDialog::configPage(ConfigOptions which)
{
- QVBox *box = 0;
+ TQVBox *box = 0;
switch(which)
{
case NetworkConfig:
@@ -215,18 +215,18 @@ QVBox *KGameDialog::configPage(ConfigOptions which)
return box;
}
-QVBox* KGameDialog::addConfigPage(KGameDialogConfig* widget, const QString& title)
+TQVBox* KGameDialog::addConfigPage(KGameDialogConfig* widget, const TQString& title)
{
if (!widget) {
kdError(11001) << "Cannot add NULL config widget" << endl;
return 0;
}
- QVBox* page = addVBoxPage(title);
+ TQVBox* page = addVBoxPage(title);
addConfigWidget(widget, page);
return page;
}
-void KGameDialog::addConfigWidget(KGameDialogConfig* widget, QWidget* parent)
+void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* parent)
{
if (!widget) {
kdError(11001) << "Cannot add NULL config widget" << endl;
@@ -237,9 +237,9 @@ void KGameDialog::addConfigWidget(KGameDialogConfig* widget, QWidget* parent)
return;
}
// kdDebug(11001) << "reparenting widget" << endl;
- widget->reparent(parent, QPoint(0,0));
+ widget->reparent(parent, TQPoint(0,0));
d->mConfigWidgets.append(widget);
- connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(slotRemoveConfigWidget(QObject*)));
+ connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(slotRemoveConfigWidget(TQObject*)));
if (!d->mGame) {
kdWarning(11001) << "No game has been set!" << endl;
} else {
@@ -278,7 +278,7 @@ void KGameDialog::slotDefault()
void KGameDialog::slotOk()
{
slotApply();
- QDialog::accept();
+ TQDialog::accept();
}
void KGameDialog::setOwner(KPlayer* owner)
@@ -306,9 +306,9 @@ void KGameDialog::setKGame(KGame* g)
}
if (d->mGame) {
setAdmin(d->mGame->isAdmin());
- connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame()));
- connect(d->mGame, SIGNAL(signalAdminStatusChanged(bool)),
- this, SLOT(setAdmin(bool)));
+ connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame()));
+ connect(d->mGame, TQT_SIGNAL(signalAdminStatusChanged(bool)),
+ this, TQT_SLOT(setAdmin(bool)));
}
}
@@ -340,7 +340,7 @@ void KGameDialog::submitToKGame()
}
}
-void KGameDialog::slotRemoveConfigWidget(QObject* configWidget)
+void KGameDialog::slotRemoveConfigWidget(TQObject* configWidget)
{
d->mConfigWidgets.removeRef((KGameDialogConfig*)configWidget);
}
diff --git a/libkdegames/kgame/dialogs/kgamedialog.h b/libkdegames/kgame/dialogs/kgamedialog.h
index f7a0c6e5..f3256d8a 100644
--- a/libkdegames/kgame/dialogs/kgamedialog.h
+++ b/libkdegames/kgame/dialogs/kgamedialog.h
@@ -97,8 +97,8 @@ public:
* @param parent The parent of the dialog
* @param modal Whether the dialog is modal or not
**/
- KGameDialog(KGame* g, KPlayer* owner, const QString& title,
- QWidget* parent, bool modal = false);
+ KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
+ TQWidget* parent, bool modal = false);
/**
* Create a KGameDialog with the standard configuration widgets. This
@@ -129,8 +129,8 @@ public:
* @param chatMsgId The ID of Chat messages. See KGameChat. Unused
* if initConfigs = false
**/
- KGameDialog(KGame* g, KPlayer* owner, const QString& title,
- QWidget* parent, long initConfigs = AllConfig,
+ KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
+ TQWidget* parent, long initConfigs = AllConfig,
int chatMsgId = 15432, bool modal = false);
virtual ~KGameDialog();
@@ -175,7 +175,7 @@ public:
* already added config widget. Note that the game page will be used
* if parent is 0.
**/
- void addChatWidget(KGameDialogChatConfig* chat, QVBox* parent = 0);
+ void addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent = 0);
/**
* Add a connection list to the dialog. The list consists of a
@@ -189,7 +189,7 @@ public:
* @param parent The parent of the widget. If 0 the networkConfig
* page is used.
**/
- void addConnectionList(KGameDialogConnectionConfig* c, QVBox* parent = 0);
+ void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent = 0);
/**
* Add a new page to the dialog. The page will contain you new config
@@ -201,13 +201,13 @@ public:
* @param title The title of the newly added page.
* @return The newly added page which contains your config widget.
**/
- QVBox* addConfigPage(KGameDialogConfig* widget, const QString& title);
+ TQVBox* addConfigPage(KGameDialogConfig* widget, const TQString& title);
/**
- * @return The QVBox of the given key, The key is from ConfigOptions
+ * @return The TQVBox of the given key, The key is from ConfigOptions
* Note that not all are supported yet
**/
- QVBox *configPage(ConfigOptions which);
+ TQVBox *configPage(ConfigOptions which);
/**
* @return The default netowrk config. Note that this always returns 0 if
@@ -227,7 +227,7 @@ public:
* it to the same page. Just use the returned page of
* addConfigPage.
**/
- void addConfigWidget(KGameDialogConfig* widget, QWidget* parent);
+ void addConfigWidget(KGameDialogConfig* widget, TQWidget* parent);
/**
* Used to add the main network config widget in a new page. Use this to
@@ -275,7 +275,7 @@ protected:
protected slots:
/**
* Called when the user clicks on Ok. Calls slotApply and
- * QDialog::accept()
+ * TQDialog::accept()
**/
virtual void slotOk();
@@ -306,9 +306,9 @@ protected slots:
/**
* Remove a config widget from the widget list.
- * @see QObject::destroyed
+ * @see TQObject::destroyed
**/
- void slotRemoveConfigWidget(QObject* configWidget);
+ void slotRemoveConfigWidget(TQObject* configWidget);
private:
void init(KGame*, KPlayer*);
diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp
index 27f91cd1..44eaa3c7 100644
--- a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp
+++ b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp
@@ -31,13 +31,13 @@
#include <klistbox.h>
#include <kmessagebox.h>
-#include <qlayout.h>
-#include <qhgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include <qvbox.h>
-#include <qptrdict.h>
+#include <tqlayout.h>
+#include <tqhgroupbox.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqvbox.h>
+#include <tqptrdict.h>
#include "kgamedialogconfig.moc"
@@ -57,7 +57,7 @@ public:
KPlayer* mOwner;
};
-KGameDialogConfig::KGameDialogConfig(QWidget* parent) : QWidget(parent)
+KGameDialogConfig::KGameDialogConfig(TQWidget* parent) : TQWidget(parent)
{
d = new KGameDialogConfigPrivate;
}
@@ -104,42 +104,42 @@ public:
}
- // QPushButton* mInitConnection;
- QHGroupBox* mInitConnection;
- QLabel* mNetworkLabel;
- QPushButton *mDisconnectButton;
+ // TQPushButton* mInitConnection;
+ TQHGroupBox* mInitConnection;
+ TQLabel* mNetworkLabel;
+ TQPushButton *mDisconnectButton;
bool mDefaultServer;
- QString mDefaultHost;
+ TQString mDefaultHost;
unsigned short int mDefaultPort;
KGameConnectWidget *mConnect;
};
-KGameDialogNetworkConfig::KGameDialogNetworkConfig(QWidget* parent)
+KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* parent)
: KGameDialogConfig(parent)
{
// kdDebug(11001) << k_funcinfo << ": this=" << this << endl;
d = new KGameDialogNetworkConfigPrivate();
- QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout");
+ TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout");
- QHBoxLayout *hb = new QHBoxLayout(topLayout, KDialog::spacingHint());
+ TQHBoxLayout *hb = new TQHBoxLayout(topLayout, KDialog::spacingHint());
- d->mNetworkLabel = new QLabel(this);
+ d->mNetworkLabel = new TQLabel(this);
hb->addWidget(d->mNetworkLabel);
- d->mDisconnectButton=new QPushButton(i18n("Disconnect"),this);
- connect(d->mDisconnectButton, SIGNAL(clicked()), this, SLOT(slotExitConnection()));
+ d->mDisconnectButton=new TQPushButton(i18n("Disconnect"),this);
+ connect(d->mDisconnectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExitConnection()));
hb->addWidget(d->mDisconnectButton);
- d->mInitConnection = new QHGroupBox(i18n("Network Configuration"), this);
+ d->mInitConnection = new TQHGroupBox(i18n("Network Configuration"), this);
topLayout->addWidget(d->mInitConnection);
d->mConnect = new KGameConnectWidget(d->mInitConnection);
- connect(d->mConnect, SIGNAL(signalNetworkSetup()), this, SLOT(slotInitConnection()));
- connect(d->mConnect, SIGNAL(signalServerTypeChanged(int)),
- this, SIGNAL(signalServerTypeChanged(int)));
+ connect(d->mConnect, TQT_SIGNAL(signalNetworkSetup()), this, TQT_SLOT(slotInitConnection()));
+ connect(d->mConnect, TQT_SIGNAL(signalServerTypeChanged(int)),
+ this, TQT_SIGNAL(signalServerTypeChanged(int)));
// Needs to be AFTER the creation of the dialogs
setConnected(false);
@@ -165,7 +165,7 @@ void KGameDialogNetworkConfig::slotInitConnection()
bool connected = false;
bool master = true;
unsigned short int port = d->mConnect->port();
- QString host = d->mConnect->host();
+ TQString host = d->mConnect->host();
if (host.isNull()) {
master = true;
@@ -180,8 +180,8 @@ void KGameDialogNetworkConfig::slotInitConnection()
}
// We need to learn about failed connections
if (game()) {
- connect(game(), SIGNAL(signalConnectionBroken()),
- this, SLOT(slotConnectionBroken()));
+ connect(game(), TQT_SIGNAL(signalConnectionBroken()),
+ this, TQT_SLOT(slotConnectionBroken()));
}
}
setConnected(connected, master);
@@ -225,7 +225,7 @@ void KGameDialogNetworkConfig::setKGame(KGame* g)
setConnected(game()->isNetwork(), game()->isMaster());
}
-void KGameDialogNetworkConfig::setDefaultNetworkInfo(const QString& host, unsigned short int port,bool server)
+void KGameDialogNetworkConfig::setDefaultNetworkInfo(const TQString& host, unsigned short int port,bool server)
{
d->mDefaultPort = port;
d->mDefaultHost = host;
@@ -240,7 +240,7 @@ void KGameDialogNetworkConfig::setDefaultNetworkInfo(const QString& host, unsign
}
}
-void KGameDialogNetworkConfig::setDiscoveryInfo(const QString& type, const QString& name)
+void KGameDialogNetworkConfig::setDiscoveryInfo(const TQString& type, const TQString& name)
{
d->mConnect->setType(type);
d->mConnect->setName(name);
@@ -256,26 +256,26 @@ public:
mName = 0;
}
- QLineEdit* mName;
+ TQLineEdit* mName;
- QVBoxLayout* mTopLayout;
+ TQVBoxLayout* mTopLayout;
};
-KGameDialogGeneralConfig::KGameDialogGeneralConfig(QWidget* parent, bool initializeGUI)
+KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* parent, bool initializeGUI)
: KGameDialogConfig(parent)
{
// kdDebug(11001) << k_funcinfo << ": this=" << this << endl;
d = new KGameDialogGeneralConfigPrivate;
if (initializeGUI) {
- d->mTopLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ d->mTopLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
d->mTopLayout->setAutoAdd(true);
- QWidget* nameWidget = new QWidget(this);
- QHBoxLayout* l = new QHBoxLayout(nameWidget);
- QLabel* nameLabel = new QLabel(i18n("Your name:"), nameWidget);
+ TQWidget* nameWidget = new TQWidget(this);
+ TQHBoxLayout* l = new TQHBoxLayout(nameWidget);
+ TQLabel* nameLabel = new TQLabel(i18n("Your name:"), nameWidget);
l->addWidget(nameLabel);
- d->mName = new QLineEdit(nameWidget);
+ d->mName = new TQLineEdit(nameWidget);
l->addWidget(d->mName);
}
}
@@ -286,16 +286,16 @@ KGameDialogGeneralConfig::~KGameDialogGeneralConfig()
delete d;
}
-void KGameDialogGeneralConfig::setPlayerName(const QString& name)
+void KGameDialogGeneralConfig::setPlayerName(const TQString& name)
{
if (d->mName) {
d->mName->setText(name);
}
}
-QString KGameDialogGeneralConfig::playerName() const
+TQString KGameDialogGeneralConfig::playerName() const
{
- return d->mName ? d->mName->text() : QString::null;
+ return d->mName ? d->mName->text() : TQString::null;
}
void KGameDialogGeneralConfig::setOwner(KPlayer* p)
@@ -309,8 +309,8 @@ void KGameDialogGeneralConfig::setOwner(KPlayer* p)
// maybe call hide()
return;
}
- connect(owner(), SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
- this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
+ connect(owner(), TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
+ this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
setPlayerName(p->name());
//TODO: connect signalPropertyChanged and check for playername changes!
}
@@ -373,29 +373,29 @@ public:
noMaster = 0;
}
- QVBoxLayout* senderLayout;
- QHBoxLayout* localLayout;
+ TQVBoxLayout* senderLayout;
+ TQHBoxLayout* localLayout;
- QPushButton* changeMaxClients;
- QPushButton* changeAdmin;
- QPushButton* removeClient;
- QLabel* noAdmin;
+ TQPushButton* changeMaxClients;
+ TQPushButton* changeAdmin;
+ TQPushButton* removeClient;
+ TQLabel* noAdmin;
- QLabel* noMaster;
+ TQLabel* noMaster;
};
// TODO: change ADMIN ID, remove CLIENTS, change MAXCLIENTS
// we do everything here with QPushButtons as we want to wait a moment before
// continuing - the message must be sent over network first
-KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(QWidget* parent)
+KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* parent)
: KGameDialogConfig(parent)
{
d = new KGameDialogMsgServerConfigPrivate;
- QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
- d->senderLayout = new QVBoxLayout(topLayout);
- d->localLayout = new QHBoxLayout(topLayout);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ d->senderLayout = new TQVBoxLayout(topLayout);
+ d->localLayout = new TQHBoxLayout(topLayout);
}
KGameDialogMsgServerConfig::~KGameDialogMsgServerConfig()
@@ -408,7 +408,7 @@ void KGameDialogMsgServerConfig::setKGame(KGame* g)
{
KGameDialogConfig::setKGame(g);
//TODO display the ID of the admin if we aren't
- // connect(g, SIGNAL(signalAdminChanged(int)), this, SLOT(slotChangeIsAdmin(int)));//TODO
+ // connect(g, TQT_SIGNAL(signalAdminChanged(int)), this, TQT_SLOT(slotChangeIsAdmin(int)));//TODO
if (!game()) {
// we cannot do anything without a KGame object!
setAdmin(false);
@@ -430,17 +430,17 @@ void KGameDialogMsgServerConfig::slotChangeMaxClients()
return;
}
int max;
-// edit->setText(QString::number()); // current max clients! //TODO
+// edit->setText(TQString::number()); // current max clients! //TODO
- QDialog* dialog = new QDialog();
+ TQDialog* dialog = new TQDialog();
dialog->setCaption(i18n("Maximal Number of Clients"));
- QHBoxLayout* l = new QHBoxLayout(dialog, KDialog::marginHint(), KDialog::spacingHint());
+ TQHBoxLayout* l = new TQHBoxLayout(dialog, KDialog::marginHint(), KDialog::spacingHint());
l->setAutoAdd(true);
- (void) new QLabel(i18n("Maximal number of clients (-1 = infinite):"), dialog);
- QLineEdit* edit = new QLineEdit(dialog);//TODO: use KIntNumInput
-// edit->setText(QString::number(max)); // current max clients! //TODO
- if (dialog->exec() == QDialog::Accepted) {
+ (void) new TQLabel(i18n("Maximal number of clients (-1 = infinite):"), dialog);
+ TQLineEdit* edit = new TQLineEdit(dialog);//TODO: use KIntNumInput
+// edit->setText(TQString::number(max)); // current max clients! //TODO
+ if (dialog->exec() == TQDialog::Accepted) {
bool ok;
max = edit->text().toInt(&ok);
if (ok) {
@@ -487,12 +487,12 @@ void KGameDialogMsgServerConfig::setAdmin(bool a)
delete d->noAdmin;
d->noAdmin = 0;
}
- d->changeMaxClients = new QPushButton(i18n("Change Maximal Number of Clients"), this);
- connect(d->changeMaxClients, SIGNAL(pressed()), this, SLOT(slotChangeMaxClients()));
- d->changeAdmin = new QPushButton(i18n("Change Admin"), this);
- connect(d->changeAdmin, SIGNAL(pressed()), this, SLOT(slotChangeAdmin()));
- d->removeClient = new QPushButton(i18n("Remove Client with All Players"), this);
- connect(d->removeClient, SIGNAL(pressed()), this, SLOT(slotRemoveClient()));
+ d->changeMaxClients = new TQPushButton(i18n("Change Maximal Number of Clients"), this);
+ connect(d->changeMaxClients, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChangeMaxClients()));
+ d->changeAdmin = new TQPushButton(i18n("Change Admin"), this);
+ connect(d->changeAdmin, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChangeAdmin()));
+ d->removeClient = new TQPushButton(i18n("Remove Client with All Players"), this);
+ connect(d->removeClient, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotRemoveClient()));
d->senderLayout->addWidget(d->changeMaxClients);
d->senderLayout->addWidget(d->changeAdmin);
d->senderLayout->addWidget(d->removeClient);
@@ -509,7 +509,7 @@ void KGameDialogMsgServerConfig::setAdmin(bool a)
delete d->removeClient;
d->removeClient = 0;
}
- d->noAdmin = new QLabel(i18n("Only the admin can configure the message server!"), this);
+ d->noAdmin = new TQLabel(i18n("Only the admin can configure the message server!"), this);
d->senderLayout->addWidget(d->noAdmin);
}
}
@@ -520,7 +520,7 @@ void KGameDialogMsgServerConfig::setHasMsgServer(bool has)
if (!has) {
// delete all inputs
if (!d->noMaster) {
- d->noMaster = new QLabel(i18n("You don't own the message server"), this);
+ d->noMaster = new TQLabel(i18n("You don't own the message server"), this);
d->localLayout->addWidget(d->noMaster);
}
return;
@@ -547,13 +547,13 @@ public:
KGameChat* mChat;
};
-KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, QWidget* parent)
+KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* parent)
: KGameDialogConfig(parent)
{
d = new KGameDialogChatConfigPrivate;
- QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
topLayout->setAutoAdd(true);
- QHGroupBox* b = new QHGroupBox(i18n("Chat"), this);
+ TQHGroupBox* b = new TQHGroupBox(i18n("Chat"), this);
d->mChat = new KGameChat(0, chatMsgId, b);
}
@@ -595,18 +595,18 @@ public:
mPlayerBox = 0;
}
- QPtrDict<KPlayer> mItem2Player;
+ TQPtrDict<KPlayer> mItem2Player;
KListBox* mPlayerBox;
};
-KGameDialogConnectionConfig::KGameDialogConnectionConfig(QWidget* parent)
+KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* parent)
: KGameDialogConfig(parent)
{
//TODO: prevent player to ban himself
d = new KGameDialogConnectionConfigPrivate;
- QVBoxLayout* topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
topLayout->setAutoAdd(true);
- QHGroupBox* b = new QHGroupBox(i18n("Connected Players"), this);
+ TQHGroupBox* b = new TQHGroupBox(i18n("Connected Players"), this);
d->mPlayerBox = new KListBox(b);
setMinimumHeight(100);
}
@@ -627,10 +627,10 @@ void KGameDialogConnectionConfig::setKGame(KGame* g)
slotClearPlayers();
if (game()) {
// react to changes in KGame::playerList()
- connect(game(), SIGNAL(signalPlayerJoinedGame(KPlayer*)),
- this, SLOT(slotPlayerJoinedGame(KPlayer*)));
- connect(game(), SIGNAL(signalPlayerLeftGame(KPlayer*)),
- this, SLOT(slotPlayerLeftGame(KPlayer*)));
+ connect(game(), TQT_SIGNAL(signalPlayerJoinedGame(KPlayer*)),
+ this, TQT_SLOT(slotPlayerJoinedGame(KPlayer*)));
+ connect(game(), TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)),
+ this, TQT_SLOT(slotPlayerLeftGame(KPlayer*)));
KGame::KGamePlayerList l = *game()->playerList();
for (KPlayer* p = l.first(); p; p = l.next()) {
@@ -650,21 +650,21 @@ void KGameDialogConnectionConfig::setAdmin(bool a)
return;
}
if (admin()) {
- disconnect(game(), SIGNAL(executed(QListBoxItem*)), this, 0);
+ disconnect(game(), TQT_SIGNAL(executed(TQListBoxItem*)), this, 0);
}
KGameDialogConfig::setAdmin(a);
if (admin()) {
- connect(d->mPlayerBox, SIGNAL(executed(QListBoxItem*)), this,
- SLOT(slotKickPlayerOut(QListBoxItem*)));
+ connect(d->mPlayerBox, TQT_SIGNAL(executed(TQListBoxItem*)), this,
+ TQT_SLOT(slotKickPlayerOut(TQListBoxItem*)));
}
}
-QListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const
+TQListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const
{
- QPtrDictIterator<KPlayer> it(d->mItem2Player);
+ TQPtrDictIterator<KPlayer> it(d->mItem2Player);
while (it.current()) {
if (it.current() == p) {
- return (QListBoxItem*)it.currentKey();
+ return (TQListBoxItem*)it.currentKey();
}
++it;
}
@@ -673,7 +673,7 @@ QListBoxItem* KGameDialogConnectionConfig::item(KPlayer* p) const
void KGameDialogConnectionConfig::slotClearPlayers()
{
- QPtrDictIterator<KPlayer> it(d->mItem2Player);
+ TQPtrDictIterator<KPlayer> it(d->mItem2Player);
while (it.current()) {
slotPlayerLeftGame(it.current());
++it;
@@ -700,12 +700,12 @@ void KGameDialogConnectionConfig::slotPlayerJoinedGame(KPlayer* p)
return;
}
kdDebug(11001) << k_funcinfo << ": add player " << p->id() << endl;
- QListBoxText* t = new QListBoxText(p->name());
+ TQListBoxText* t = new TQListBoxText(p->name());
d->mItem2Player.insert(t, p);
d->mPlayerBox->insertItem(t);
- connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
- this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
+ connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
+ this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
}
@@ -722,7 +722,7 @@ void KGameDialogConnectionConfig::slotPlayerLeftGame(KPlayer* p)
}
-void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item)
+void KGameDialogConnectionConfig::slotKickPlayerOut(TQListBoxItem* item)
{
kdDebug(11001) << "kick player out" << endl;
KPlayer* p = d->mItem2Player[item];
@@ -744,7 +744,7 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item)
}
if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").arg(
- p->name()), QString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) {
+ p->name()), TQString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) {
kdDebug(11001) << "will remove player " << p << endl;
game()->removePlayer(p);
// d->mPlayerBox->removeItem(d->mPlayerBox->index(item)); // should be done by signalPlayerLeftGame
@@ -756,15 +756,15 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(QListBoxItem* item)
void KGameDialogConnectionConfig::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player)
{
if(prop->id() == KGamePropertyBase::IdName) {
- QListBoxText* old = 0;
- QPtrDictIterator<KPlayer> it(d->mItem2Player);
+ TQListBoxText* old = 0;
+ TQPtrDictIterator<KPlayer> it(d->mItem2Player);
while (it.current() && !old) {
if (it.current() == player) {
- old = (QListBoxText*)it.currentKey();
+ old = (TQListBoxText*)it.currentKey();
}
++it;
}
- QListBoxText* t = new QListBoxText(player->name());
+ TQListBoxText* t = new TQListBoxText(player->name());
d->mPlayerBox->changeItem(t, d->mPlayerBox->index(old));
d->mItem2Player.remove(old);
d->mItem2Player.insert(t, player);
diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.h b/libkdegames/kgame/dialogs/kgamedialogconfig.h
index b7d30b23..e1b592af 100644
--- a/libkdegames/kgame/dialogs/kgamedialogconfig.h
+++ b/libkdegames/kgame/dialogs/kgamedialogconfig.h
@@ -28,7 +28,7 @@
#ifndef __KGAMEDIALOGCONFIG_H__
#define __KGAMEDIALOGCONFIG_H__
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kdemacros.h>
class QGridLayout;
@@ -52,7 +52,7 @@ class KDE_EXPORT KGameDialogConfig : public QWidget
{
Q_OBJECT
public:
- KGameDialogConfig(QWidget* parent = 0);
+ KGameDialogConfig(TQWidget* parent = 0);
virtual ~KGameDialogConfig();
/**
@@ -137,7 +137,7 @@ private:
*
* It currently contains a line edit for the name of the player only. You can
* add widgets by using the KGameDialogGeneralConfig as parent parameter as it
- * uses QLayout::autoAdd == true.
+ * uses TQLayout::autoAdd == true.
* @author Andreas Beckermann <[email protected]>
**/
class KGameDialogGeneralConfigPrivate;
@@ -151,7 +151,7 @@ public:
*
* If you just want to add more widgets you can just create your widgets
* with the KGameDialogGeneralConfig as parent as it uses
- * QLayout::setAutoAdd(true).
+ * TQLayout::setAutoAdd(true).
*
* @param parent Parent widget for this dialog.
* @param initializeGUI If you really don't want to use the
@@ -160,7 +160,7 @@ public:
* will exist anymore.
*
**/
- KGameDialogGeneralConfig(QWidget* parent = 0, bool initializeGUI = true);
+ KGameDialogGeneralConfig(TQWidget* parent = 0, bool initializeGUI = true);
virtual ~KGameDialogGeneralConfig();
/**
@@ -199,9 +199,9 @@ protected slots:
void slotPropertyChanged(KGamePropertyBase*, KPlayer*);
protected:
- void setPlayerName(const QString& name);
+ void setPlayerName(const TQString& name);
- QString playerName() const;
+ TQString playerName() const;
private:
KGameDialogGeneralConfigPrivate* d;
@@ -212,7 +212,7 @@ class KDE_EXPORT KGameDialogNetworkConfig : public KGameDialogConfig
{
Q_OBJECT
public:
- KGameDialogNetworkConfig(QWidget* parent = 0);
+ KGameDialogNetworkConfig(TQWidget* parent = 0);
virtual ~KGameDialogNetworkConfig();
@@ -238,7 +238,7 @@ public:
* @param port The default port to connect to / listen on
* @param host The default host to connect to
**/
- void setDefaultNetworkInfo(const QString& host, unsigned short int port,bool server=true);
+ void setDefaultNetworkInfo(const TQString& host, unsigned short int port,bool server=true);
/**
* Set service type that will be published or browsed for and game name that will be displayed in
@@ -248,7 +248,7 @@ public:
* @param type Service type (something like _kwin4._tcp). It should be unique for application.
* @since 3.4
**/
- void setDiscoveryInfo(const QString& type, const QString& name=QString::null);
+ void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null);
signals:
/**
@@ -278,7 +278,7 @@ class KGameDialogMsgServerConfig : public KGameDialogConfig
{
Q_OBJECT
public:
- KGameDialogMsgServerConfig(QWidget* parent = 0);
+ KGameDialogMsgServerConfig(TQWidget* parent = 0);
virtual ~KGameDialogMsgServerConfig();
virtual void submitToKGame(KGame*, KPlayer*) {}
@@ -311,7 +311,7 @@ class KGameDialogChatConfig : public KGameDialogConfig
{
Q_OBJECT
public:
- KGameDialogChatConfig(int chatMsgId, QWidget* parent = 0);
+ KGameDialogChatConfig(int chatMsgId, TQWidget* parent = 0);
virtual ~KGameDialogChatConfig();
virtual void setKGame(KGame* g);
@@ -332,7 +332,7 @@ class KGameDialogConnectionConfig : public KGameDialogConfig
{
Q_OBJECT
public:
- KGameDialogConnectionConfig(QWidget* parent = 0);
+ KGameDialogConnectionConfig(TQWidget* parent = 0);
virtual ~KGameDialogConnectionConfig();
virtual void setKGame(KGame* g);
@@ -344,12 +344,12 @@ public:
protected:
/**
* @param p A player
- * @return The QListBoxItem that belongs to the player @p p
+ * @return The TQListBoxItem that belongs to the player @p p
**/
- QListBoxItem* item(KPlayer* p) const;
+ TQListBoxItem* item(KPlayer* p) const;
protected slots:
- void slotKickPlayerOut(QListBoxItem* item);
+ void slotKickPlayerOut(TQListBoxItem* item);
void slotPropertyChanged(KGamePropertyBase* prop, KPlayer* p);
void slotPlayerLeftGame(KPlayer* p);
void slotPlayerJoinedGame(KPlayer* p);
diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.cpp b/libkdegames/kgame/dialogs/kgameerrordialog.cpp
index 1750892c..7c3b0509 100644
--- a/libkdegames/kgame/dialogs/kgameerrordialog.cpp
+++ b/libkdegames/kgame/dialogs/kgameerrordialog.cpp
@@ -37,7 +37,7 @@ public:
const KGame* mGame;
};
-KGameErrorDialog::KGameErrorDialog(QWidget* parent) : QObject(parent)
+KGameErrorDialog::KGameErrorDialog(TQWidget* parent) : TQObject(parent)
{
d = new KGameErrorDialogPrivate;
}
@@ -52,15 +52,15 @@ void KGameErrorDialog::setKGame(const KGame* g)
slotUnsetKGame();
d->mGame = g;
- connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame()));
+ connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame()));
// the error signals:
- connect(d->mGame, SIGNAL(signalNetworkErrorMessage(int, QString)),
- this, SLOT(slotError(int, QString)));
- connect(d->mGame, SIGNAL(signalConnectionBroken()),
- this, SLOT(slotServerConnectionLost()));
- connect(d->mGame, SIGNAL(signalClientDisconnected(Q_UINT32,bool)),
- this, SLOT(slotClientConnectionLost(Q_UINT32,bool)));
+ connect(d->mGame, TQT_SIGNAL(signalNetworkErrorMessage(int, TQString)),
+ this, TQT_SLOT(slotError(int, TQString)));
+ connect(d->mGame, TQT_SIGNAL(signalConnectionBroken()),
+ this, TQT_SLOT(slotServerConnectionLost()));
+ connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)),
+ this, TQT_SLOT(slotClientConnectionLost(Q_UINT32,bool)));
}
void KGameErrorDialog::slotUnsetKGame()
@@ -71,51 +71,51 @@ void KGameErrorDialog::slotUnsetKGame()
d->mGame = 0;
}
-void KGameErrorDialog::error(const QString& errorText, QWidget* parent)
+void KGameErrorDialog::error(const TQString& errorText, TQWidget* parent)
{ KMessageBox::error(parent, errorText); }
void KGameErrorDialog::slotServerConnectionLost()
{
// TODO: add IP/port of the server
- QString message = i18n("Connection to the server has been lost!");
- error(message, (QWidget*)parent());
+ TQString message = i18n("Connection to the server has been lost!");
+ error(message, (TQWidget*)parent());
}
void KGameErrorDialog::slotClientConnectionLost(Q_UINT32 /*id*/,bool)
{
//TODO: add IP/port of the client
- QString message;
+ TQString message;
// if (c) {
// message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").arg(c->id()).arg(c->IP());
// } else {
// message = i18n("Connection to client has been lost!");
// }
message = i18n("Connection to client has been lost!");
- error(message, (QWidget*)parent());
+ error(message, (TQWidget*)parent());
}
-void KGameErrorDialog::slotError(int errorNo, QString text)
+void KGameErrorDialog::slotError(int errorNo, TQString text)
{
- QString message = i18n("Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text);
- error(message, (QWidget*)parent());
+ TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text);
+ error(message, (TQWidget*)parent());
}
-void KGameErrorDialog::connectionError(QString s)
+void KGameErrorDialog::connectionError(TQString s)
{
- QString message;
+ TQString message;
if (s.isNull()) {
message = i18n("No connection could be created.");
} else {
message = i18n("No connection could be created.\nThe error message was:\n%1").arg(s);
}
- error(message, (QWidget*)parent());
+ error(message, (TQWidget*)parent());
}
// should become the real dialog - currently we just use messageboxes
// -> maybe unused forever
-KGameErrorMessageDialog::KGameErrorMessageDialog(QWidget* parent)
+KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* parent)
: KDialogBase(Plain, i18n("Error"), Ok, Ok, parent, 0, true, true)
{
}
diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.h b/libkdegames/kgame/dialogs/kgameerrordialog.h
index c1dbd1ca..3883399b 100644
--- a/libkdegames/kgame/dialogs/kgameerrordialog.h
+++ b/libkdegames/kgame/dialogs/kgameerrordialog.h
@@ -40,7 +40,7 @@ class KGameErrorDialog : public QObject
{
Q_OBJECT
public:
- KGameErrorDialog(QWidget* parent);
+ KGameErrorDialog(TQWidget* parent);
~KGameErrorDialog();
/**
@@ -55,12 +55,12 @@ public:
* KGame couldn't establish a connection. Use this if
* KGame::initConnection returns false
* @param s A string that describes the error further (like port is
- * already in use). Will be ignored if QString::null
+ * already in use). Will be ignored if TQString::null
**/
- void connectionError(QString s = QString::null);
+ void connectionError(TQString s = TQString::null);
public slots:
- void slotError(int error, QString text);
+ void slotError(int error, TQString text);
/**
* The connection to the @ref KMessageServer has been lost
@@ -87,7 +87,7 @@ public slots:
void slotUnsetKGame();
protected:
- void error(const QString& errorText, QWidget* parent = 0);
+ void error(const TQString& errorText, TQWidget* parent = 0);
private:
KGameErrorDialogPrivate* d;
@@ -104,7 +104,7 @@ class KGameErrorMessageDialog : public KDialogBase
{
Q_OBJECT
public:
- KGameErrorMessageDialog(QWidget* parent);
+ KGameErrorMessageDialog(TQWidget* parent);
~KGameErrorMessageDialog();
private:
diff --git a/libkdegames/kgame/kgame.cpp b/libkdegames/kgame/kgame.cpp
index 101dbfcc..ff215837 100644
--- a/libkdegames/kgame/kgame.cpp
+++ b/libkdegames/kgame/kgame.cpp
@@ -36,10 +36,10 @@
#include <stdio.h>
#include <assert.h>
-#include <qbuffer.h>
-#include <qtimer.h>
-#include <qptrqueue.h>
-#include <qfile.h>
+#include <tqbuffer.h>
+#include <tqtimer.h>
+#include <tqptrqueue.h>
+#include <tqfile.h>
#include <klocale.h>
#include <krandomsequence.h>
@@ -60,7 +60,7 @@ public:
}
int mUniquePlayerNumber;
- QPtrQueue<KPlayer> mAddPlayerList;// this is a list of to-be-added players. See addPlayer() docu
+ TQPtrQueue<KPlayer> mAddPlayerList;// this is a list of to-be-added players. See addPlayer() docu
KRandomSequence* mRandom;
KGame::GamePolicy mPolicy;
KGameSequence* mGameSequence;
@@ -76,12 +76,12 @@ public:
KGamePropertyInt mMaxPlayer;
KGamePropertyUInt mMinPlayer;
KGamePropertyInt mGameStatus; // Game running?
- QValueList<int> mInactiveIdList;
+ TQValueList<int> mInactiveIdList;
};
// ------------------- GAME CLASS --------------------------
-KGame::KGame(int cookie,QObject* parent) : KGameNetwork(cookie,parent)
+KGame::KGame(int cookie,TQObject* parent) : KGameNetwork(cookie,parent)
{
kdDebug(11001) << k_funcinfo << " - " << this << ", sizeof(KGame)=" << sizeof(KGame) << endl;
d = new KGamePrivate;
@@ -89,8 +89,8 @@ KGame::KGame(int cookie,QObject* parent) : KGameNetwork(cookie,parent)
d->mProperties = new KGamePropertyHandler(this);
d->mProperties->registerHandler(KGameMessage::IdGameProperty,
- this,SLOT(sendProperty(int, QDataStream&, bool* )),
- SLOT(emitSignal(KGamePropertyBase *)));
+ this,TQT_SLOT(sendProperty(int, TQDataStream&, bool* )),
+ TQT_SLOT(emitSignal(KGamePropertyBase *)));
d->mMaxPlayer.registerData(KGamePropertyBase::IdMaxPlayer, this, i18n("MaxPlayers"));
d->mMaxPlayer.setLocal(-1); // Infinite
d->mMinPlayer.registerData(KGamePropertyBase::IdMinPlayer, this, i18n("MinPlayers"));
@@ -101,20 +101,20 @@ KGame::KGame(int cookie,QObject* parent) : KGameNetwork(cookie,parent)
d->mRandom = new KRandomSequence;
d->mRandom->setSeed(0);
- connect(this, SIGNAL(signalClientConnected(Q_UINT32)),
- this, SLOT(slotClientConnected(Q_UINT32)));
- connect(this, SIGNAL(signalClientDisconnected(Q_UINT32,bool)),
- this, SLOT(slotClientDisconnected(Q_UINT32,bool)));
- connect(this, SIGNAL(signalConnectionBroken()),
- this, SLOT(slotServerDisconnected()));
+ connect(this, TQT_SIGNAL(signalClientConnected(Q_UINT32)),
+ this, TQT_SLOT(slotClientConnected(Q_UINT32)));
+ connect(this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)),
+ this, TQT_SLOT(slotClientDisconnected(Q_UINT32,bool)));
+ connect(this, TQT_SIGNAL(signalConnectionBroken()),
+ this, TQT_SLOT(slotServerDisconnected()));
setGameSequence(new KGameSequence());
// BL: FIXME This signal does no longer exist. When we are merging
// MH: super....and how do I find out about the lost conenction now?
// KGame and KGameNetwork, this could be improved!
-// connect(this,SIGNAL(signalConnectionLost(KGameClient *)),
-// this,SLOT(slotConnectionLost(KGameClient *)));
+// connect(this,TQT_SIGNAL(signalConnectionLost(KGameClient *)),
+// this,TQT_SLOT(slotConnectionLost(KGameClient *)));
}
KGame::~KGame()
@@ -159,27 +159,27 @@ void KGame::deleteInactivePlayers()
}
}
-bool KGame::load(QString filename,bool reset)
+bool KGame::load(TQString filename,bool reset)
{
if (filename.isNull())
{
return false;
}
- QFile f(filename);
+ TQFile f(filename);
if (!f.open(IO_ReadOnly))
{
return false;
}
- QDataStream s( &f );
+ TQDataStream s( &f );
load(s,reset);
f.close();
return true;
}
-bool KGame::load(QDataStream &stream,bool reset)
+bool KGame::load(TQDataStream &stream,bool reset)
{ return loadgame(stream, false,reset); }
-bool KGame::loadgame(QDataStream &stream, bool network,bool resetgame)
+bool KGame::loadgame(TQDataStream &stream, bool network,bool resetgame)
{
// Load Game Data
@@ -264,27 +264,27 @@ bool KGame::loadgame(QDataStream &stream, bool network,bool resetgame)
return true;
}
-bool KGame::save(QString filename,bool saveplayers)
+bool KGame::save(TQString filename,bool saveplayers)
{
if (filename.isNull())
{
return false;
}
- QFile f(filename);
+ TQFile f(filename);
if (!f.open(IO_WriteOnly))
{
return false;
}
- QDataStream s( &f );
+ TQDataStream s( &f );
save(s,saveplayers);
f.close();
return true;
}
-bool KGame::save(QDataStream &stream,bool saveplayers)
+bool KGame::save(TQDataStream &stream,bool saveplayers)
{ return savegame(stream, false,saveplayers); }
-bool KGame::savegame(QDataStream &stream,bool /*network*/,bool saveplayers)
+bool KGame::savegame(TQDataStream &stream,bool /*network*/,bool saveplayers)
{
// Save Game Data
@@ -320,7 +320,7 @@ bool KGame::savegame(QDataStream &stream,bool /*network*/,bool saveplayers)
return true;
}
-void KGame::savePlayer(QDataStream &stream,KPlayer* p)
+void KGame::savePlayer(TQDataStream &stream,KPlayer* p)
{
// this could be in KGameMessage as well
stream << (Q_INT32)p->rtti();
@@ -329,7 +329,7 @@ void KGame::savePlayer(QDataStream &stream,KPlayer* p)
p->save(stream);
}
-void KGame::savePlayers(QDataStream &stream, KGamePlayerList *list)
+void KGame::savePlayers(TQDataStream &stream, KGamePlayerList *list)
{
if (!list)
{
@@ -351,7 +351,7 @@ KPlayer *KGame::createPlayer(int /*rtti*/,int /*io*/,bool /*isvirtual*/)
kdWarning(11001) << " No user defined player created. Creating default KPlayer. This crashes if you have overwritten KPlayer!!!! " << endl;
return new KPlayer;
}
-KPlayer *KGame::loadPlayer(QDataStream& stream,bool isvirtual)
+KPlayer *KGame::loadPlayer(TQDataStream& stream,bool isvirtual)
{
Q_INT32 rtti,id,iovalue;
stream >> rtti >> id >> iovalue;
@@ -385,14 +385,14 @@ KPlayer *KGame::loadPlayer(QDataStream& stream,bool isvirtual)
KPlayer * KGame::findPlayer(Q_UINT32 id) const
{
- for (QPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it)
+ for (TQPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it)
{
if (it.current()->id() == id)
{
return it.current();
}
}
- for (QPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it)
+ for (TQPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it)
{
if (it.current()->id() == id)
{
@@ -438,8 +438,8 @@ void KGame::addPlayer(KPlayer* newplayer)
kdDebug(11001) << k_funcinfo << "player " << newplayer << " already has an id: " << newplayer->id() << endl;
}
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
// We distinguis here what policy we have
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
@@ -706,7 +706,7 @@ KRandomSequence* KGame::random() const
{ return d->mRandom; }
-bool KGame::sendPlayerInput(QDataStream &msg, KPlayer *player, Q_UINT32 sender)
+bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender)
{
if (!player)
{
@@ -724,7 +724,7 @@ bool KGame::sendPlayerInput(QDataStream &msg, KPlayer *player, Q_UINT32 sender)
return true;
}
-bool KGame::systemPlayerInput(QDataStream &msg, KPlayer *player, Q_UINT32 sender)
+bool KGame::systemPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender)
{
if (!player)
{
@@ -780,7 +780,7 @@ KPlayer * KGame::playerInputFinished(KPlayer *player)
player->setTurn(false); // in turn based games we have to switch off input now
if (gameSequence())
{
- QTimer::singleShot(0,this,SLOT(prepareNext()));
+ TQTimer::singleShot(0,this,TQT_SLOT(prepareNext()));
}
}
return player;
@@ -840,7 +840,7 @@ void KGame::setGameStatus(int status)
d->mGameStatus = status;
}
-void KGame::networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 /*clientID*/)
+void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 /*clientID*/)
{//clientID is unused
// message targets a playerobject. If we find it we forward the message to the
// player. Otherwise we proceed here and hope the best that the user processes
@@ -1033,7 +1033,7 @@ void KGame::networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receive
<< endl;
}
kdDebug(11001) << k_funcinfo << ": User data msgid " << msgid << endl;
- emit signalNetworkData(msgid - KGameMessage::IdUser,((QBuffer*)stream.device())->readAll(),receiver,sender);
+ emit signalNetworkData(msgid - KGameMessage::IdUser,((TQBuffer*)stream.device())->readAll(),receiver,sender);
}
break;
}
@@ -1043,14 +1043,14 @@ void KGame::networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receive
// called by the IdSetupGameContinue Message - MASTER SIDE
// Here the master needs to decide which players can take part at the game
// and which will be deactivated
-void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender)
+void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender)
{
KPlayer *player;
Q_INT32 cnt;
int i;
stream >> cnt;
- QValueList<int> inactivateIds;
+ TQValueList<int> inactivateIds;
KGamePlayerList newPlayerList;
newPlayerList.setAutoDelete(true);
@@ -1135,7 +1135,7 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender)
kdDebug(11001) << "Alltogether deactivated " << inactivateIds.count() << " players" << endl;
- QValueList<int>::Iterator it;
+ TQValueList<int>::Iterator it;
for ( it = inactivateIds.begin(); it != inactivateIds.end(); ++it )
{
int pid=*it;
@@ -1143,7 +1143,7 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender)
}
// Now deactivate the network players from the inactivateId list
- //QValueList<int>::Iterator it;
+ //TQValueList<int>::Iterator it;
for ( it = inactivateIds.begin(); it != inactivateIds.end(); ++it )
{
int pid=*it;
@@ -1182,8 +1182,8 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender)
}
// Save the game over the network
- QByteArray bufferS;
- QDataStream streamS(bufferS,IO_WriteOnly);
+ TQByteArray bufferS;
+ TQDataStream streamS(bufferS,IO_WriteOnly);
// Save game over netowrk and save players
savegame(streamS,true,true);
sendSystemMessage(streamS,KGameMessage::IdGameLoad,sender);
@@ -1197,8 +1197,8 @@ void KGame::setupGameContinue(QDataStream& stream, Q_UINT32 sender)
// Client needs to prepare for network transfer
void KGame::setupGame(Q_UINT32 sender)
{
- QByteArray bufferS;
- QDataStream streamS(bufferS,IO_WriteOnly);
+ TQByteArray bufferS;
+ TQDataStream streamS(bufferS,IO_WriteOnly);
// Deactivate all players
KGamePlayerList mTmpList(d->mPlayerList); // we need copy otherwise the removal crashes
@@ -1207,7 +1207,7 @@ void KGame::setupGame(Q_UINT32 sender)
streamS << cnt;
- QPtrListIterator<KPlayer> it(mTmpList);
+ TQPtrListIterator<KPlayer> it(mTmpList);
KPlayer *player;
while (it.current())
{
@@ -1356,7 +1356,7 @@ void KGame::slotClientDisconnected(Q_UINT32 clientID,bool /*broken*/) // server
// TODO remove players from removed game
for (unsigned int idx=0;idx<d->mInactiveIdList.count();idx++)
{
- QValueList<int>::Iterator it1 = d->mInactiveIdList.at(idx);
+ TQValueList<int>::Iterator it1 = d->mInactiveIdList.at(idx);
player = findPlayer(*it1);
if (((int)playerCount() < maxPlayers() || maxPlayers() < 0) && player && KGameMessage::rawGameId(*it1) != clientID)
{
@@ -1382,8 +1382,8 @@ void KGame::negotiateNetworkGame(Q_UINT32 clientID)
return ;
}
- QByteArray buffer;
- QDataStream streamGS(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream streamGS(buffer,IO_WriteOnly);
// write Game setup specific data
//streamGS << (Q_INT32)maxPlayers();
@@ -1396,7 +1396,7 @@ void KGame::negotiateNetworkGame(Q_UINT32 clientID)
sendSystemMessage(streamGS, KGameMessage::IdSetupGame, clientID);
}
-bool KGame::sendGroupMessage(const QByteArray &msg, int msgid, Q_UINT32 sender, const QString& group)
+bool KGame::sendGroupMessage(const TQByteArray &msg, int msgid, Q_UINT32 sender, const TQString& group)
{
// AB: group must not be i18n'ed!! we should better use an id for group and use
// a groupName() for the name // FIXME
@@ -1411,13 +1411,13 @@ bool KGame::sendGroupMessage(const QByteArray &msg, int msgid, Q_UINT32 sender,
return true;
}
-bool KGame::sendGroupMessage(const QDataStream &msg, int msgid, Q_UINT32 sender, const QString& group)
-{ return sendGroupMessage(((QBuffer*)msg.device())->buffer(), msgid, sender, group); }
+bool KGame::sendGroupMessage(const TQDataStream &msg, int msgid, Q_UINT32 sender, const TQString& group)
+{ return sendGroupMessage(((TQBuffer*)msg.device())->buffer(), msgid, sender, group); }
-bool KGame::sendGroupMessage(const QString& msg, int msgid, Q_UINT32 sender, const QString& group)
+bool KGame::sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group)
{
- QByteArray buffer;
- QDataStream stream(buffer, IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer, IO_WriteOnly);
stream << msg;
return sendGroupMessage(stream, msgid, sender, group);
}
@@ -1425,10 +1425,10 @@ bool KGame::sendGroupMessage(const QString& msg, int msgid, Q_UINT32 sender, con
bool KGame::addProperty(KGamePropertyBase* data)
{ return dataHandler()->addProperty(data); }
-bool KGame::sendPlayerProperty(int msgid, QDataStream& s, Q_UINT32 playerId)
+bool KGame::sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId)
{ return sendSystemMessage(s, msgid, playerId); }
-void KGame::sendProperty(int msgid, QDataStream& stream, bool* sent)
+void KGame::sendProperty(int msgid, TQDataStream& stream, bool* sent)
{
bool s = sendSystemMessage(stream, msgid);
if (s)
@@ -1459,11 +1459,11 @@ void KGame::setPolicy(GamePolicy p,bool recursive)
dataHandler()->setPolicy((KGamePropertyBase::PropertyPolicy)p,false);
// Set all KPLayer (active or inactive) property policy
- for (QPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it)
+ for (TQPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it)
{
it.current()->dataHandler()->setPolicy((KGamePropertyBase::PropertyPolicy)p,false);
}
- for (QPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it)
+ for (TQPtrListIterator<KPlayer> it(d->mInactivePlayerList); it.current(); ++it)
{
it.current()->dataHandler()->setPolicy((KGamePropertyBase::PropertyPolicy)p,false);
}
diff --git a/libkdegames/kgame/kgame.h b/libkdegames/kgame/kgame.h
index 37d8d974..85a8356c 100644
--- a/libkdegames/kgame/kgame.h
+++ b/libkdegames/kgame/kgame.h
@@ -23,9 +23,9 @@
#ifndef __KGAME_H_
#define __KGAME_H_
-#include <qstring.h>
-#include <qptrlist.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqptrlist.h>
+#include <tqvaluelist.h>
#include "kgamenetwork.h"
#include <kdemacros.h>
@@ -64,7 +64,7 @@ class KDE_EXPORT KGame : public KGameNetwork
Q_OBJECT
public:
- typedef QPtrList<KPlayer> KGamePlayerList;
+ typedef TQPtrList<KPlayer> KGamePlayerList;
/**
* The policy of the property. This can be PolicyClean (setVale uses
@@ -100,7 +100,7 @@ public:
* game in load/save and network operations. Change this between
* games.
*/
- KGame(int cookie=42,QObject* parent=0);
+ KGame(int cookie=42,TQObject* parent=0);
/**
* Destructs the game
@@ -282,19 +282,19 @@ public:
* Called by KPlayer to send a player input to the
* KMessageServer.
**/
- virtual bool sendPlayerInput(QDataStream &msg,KPlayer *player,Q_UINT32 sender=0);
+ virtual bool sendPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0);
/**
* Called when a player input arrives from KMessageServer.
*
- * Calls prepareNext (using QTimer::singleShot) if gameOver()
+ * Calls prepareNext (using TQTimer::singleShot) if gameOver()
* returns 0. This function should normally not be used outside KGame.
* It could be made non-virtual,protected in a later version. At the
* moment it is a virtual function to give you more control over KGame.
*
* For documentation see playerInput.
**/
- virtual bool systemPlayerInput(QDataStream &msg,KPlayer *player,Q_UINT32 sender=0);
+ virtual bool systemPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0);
/**
* This virtual function is called if the KGame needs to create a new player.
@@ -337,7 +337,7 @@ public:
*
* @return true?
*/
- virtual bool load(QDataStream &stream,bool reset=true);
+ virtual bool load(TQDataStream &stream,bool reset=true);
/**
* Same as above function but with different parameters
@@ -347,7 +347,7 @@ public:
*
* @return true?
**/
- virtual bool load(QString filename,bool reset=true);
+ virtual bool load(TQString filename,bool reset=true);
/**
* Save a game to a file OR to network. Otherwise the same as
@@ -358,7 +358,7 @@ public:
*
* @return true?
*/
- virtual bool save(QDataStream &stream,bool saveplayers=true);
+ virtual bool save(TQDataStream &stream,bool saveplayers=true);
/**
* Same as above function but with different parameters
@@ -368,7 +368,7 @@ public:
*
* @return true?
**/
- virtual bool save(QString filename,bool saveplayers=true);
+ virtual bool save(TQString filename,bool saveplayers=true);
/**
* Resets the game, i.e. puts it into a state where everything
@@ -403,7 +403,7 @@ public:
/**
* This is called by KPlayer::sendProperty only! Internal function!
**/
- bool sendPlayerProperty(int msgid, QDataStream& s, Q_UINT32 playerId);
+ bool sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId);
/**
* This function allows to find the pointer to a player
@@ -435,10 +435,10 @@ public:
* @param group the group of the receivers
* @return true if worked
*/
- bool sendGroupMessage(const QByteArray& msg, int msgid, Q_UINT32 sender, const QString& group);
- bool sendGroupMessage(const QDataStream &msg, int msgid, Q_UINT32 sender, const QString& group);
- bool sendGroupMessage(int msg, int msgid, Q_UINT32 sender, const QString& group);
- bool sendGroupMessage(const QString& msg, int msgid, Q_UINT32 sender, const QString& group);
+ bool sendGroupMessage(const TQByteArray& msg, int msgid, Q_UINT32 sender, const TQString& group);
+ bool sendGroupMessage(const TQDataStream &msg, int msgid, Q_UINT32 sender, const TQString& group);
+ bool sendGroupMessage(int msg, int msgid, Q_UINT32 sender, const TQString& group);
+ bool sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group);
/**
* This will either forward an incoming message to a specified player
@@ -458,7 +458,7 @@ public:
* @param sender
* @param clientID the client from which we received the transmission - hardly used
**/
- virtual void networkTransmission(QDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 clientID);
+ virtual void networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 clientID);
/**
* Returns a pointer to the KGame property handler
@@ -469,7 +469,7 @@ protected slots:
/**
* Called by KGamePropertyHandler only! Internal function!
**/
- void sendProperty(int msgid, QDataStream& stream, bool* sent);
+ void sendProperty(int msgid, TQDataStream& stream, bool* sent);
/**
* Called by KGamePropertyHandler only! Internal function!
@@ -539,7 +539,7 @@ signals:
*
* @param stream the load stream
*/
- void signalLoadPrePlayers(QDataStream &stream);
+ void signalLoadPrePlayers(TQDataStream &stream);
/**
* The game will be loaded from the given stream. Load from here
@@ -548,7 +548,7 @@ signals:
*
* @param stream the load stream
*/
- void signalLoad(QDataStream &stream);
+ void signalLoad(TQDataStream &stream);
/**
* The game will be saved to the given stream. Fill this with data
@@ -563,7 +563,7 @@ signals:
*
* @param stream the save stream
**/
- void signalSavePrePlayers(QDataStream &stream);
+ void signalSavePrePlayers(TQDataStream &stream);
/**
* The game will be saved to the given stream. Fill this with data
@@ -572,7 +572,7 @@ signals:
*
* @param stream the save stream
*/
- void signalSave(QDataStream &stream);
+ void signalSave(TQDataStream &stream);
/**
* Is emmited if a game with a different version cookie is loaded.
@@ -585,7 +585,7 @@ signals:
* @param cookie - the saved cookie. It differs from KGame::cookie()
* @param result - set this to true if you managed to load the game
*/
- void signalLoadError(QDataStream &stream,bool network,int cookie, bool &result);
+ void signalLoadError(TQDataStream &stream,bool network,int cookie, bool &result);
/**
* We got an user defined update message. This is usually done
@@ -593,7 +593,7 @@ signals:
* own methods and has to syncronise them over the network.
* Reaction to this is usually a call to a KGame function.
*/
- void signalNetworkData(int msgid,const QByteArray& buffer, Q_UINT32 receiver, Q_UINT32 sender);
+ void signalNetworkData(int msgid,const TQByteArray& buffer, Q_UINT32 receiver, Q_UINT32 sender);
/**
* We got an network message. this can be used to notify us that something
@@ -686,7 +686,7 @@ protected:
* and then manually call @ref playerInputFinished to resume it.
* Example:
* \code
- * bool MyClass::playerInput(QDataStream &msg,KPlayer *player)
+ * bool MyClass::playerInput(TQDataStream &msg,KPlayer *player)
* {
* Q_INT32 move;
* msg >> move;
@@ -700,7 +700,7 @@ protected:
* @param player the player who did the move
* @return true - input ready, false: input manual
*/
- virtual bool playerInput(QDataStream &msg,KPlayer *player)=0;
+ virtual bool playerInput(TQDataStream &msg,KPlayer *player)=0;
/**
@@ -752,7 +752,7 @@ protected:
**/
virtual void newPlayersJoin(KGamePlayerList *oldplayer,
KGamePlayerList *newplayer,
- QValueList<int> &inactivate) {
+ TQValueList<int> &inactivate) {
Q_UNUSED( oldplayer );
Q_UNUSED( newplayer );
Q_UNUSED( inactivate );
@@ -766,7 +766,7 @@ protected:
* @param list the optional list is the player list to be saved, default is playerList()
*
**/
- void savePlayers(QDataStream &stream,KGamePlayerList *list=0);
+ void savePlayers(TQDataStream &stream,KGamePlayerList *list=0);
/**
* Prepare a player for being added. Put all data about a player into the
@@ -778,7 +778,7 @@ protected:
* @param stream is the stream to add the player
* @param player The player to add
**/
- void savePlayer(QDataStream& stream,KPlayer* player);
+ void savePlayer(TQDataStream& stream,KPlayer* player);
/**
* Load the player list from a stream. Used for network game and load/save.
@@ -788,7 +788,7 @@ protected:
* @param isvirtual will set the virtual flag true/false
*
**/
- KPlayer *loadPlayer(QDataStream& stream,bool isvirtual=false);
+ KPlayer *loadPlayer(TQDataStream& stream,bool isvirtual=false);
/**
@@ -872,7 +872,7 @@ protected:
*
* @return true?
*/
- virtual bool loadgame(QDataStream &stream, bool network, bool reset);
+ virtual bool loadgame(TQDataStream &stream, bool network, bool reset);
/**
* Save a game, to file OR network. Internal.
@@ -883,7 +883,7 @@ protected:
*
* @return true?
*/
- virtual bool savegame(QDataStream &stream, bool network,bool saveplayers);
+ virtual bool savegame(TQDataStream &stream, bool network,bool saveplayers);
private:
//AB: this is to hide the "receiver" parameter from the user. It shouldn't be
@@ -913,7 +913,7 @@ private:
/**
* Helping function - game negotiation
**/
- void setupGameContinue(QDataStream& msg, Q_UINT32 sender);
+ void setupGameContinue(TQDataStream& msg, Q_UINT32 sender);
/**
* Removes a player from all lists, removes the @ref KGame pointer from the
diff --git a/libkdegames/kgame/kgamechat.cpp b/libkdegames/kgame/kgamechat.cpp
index 16ec7c18..ddc1bd66 100644
--- a/libkdegames/kgame/kgamechat.cpp
+++ b/libkdegames/kgame/kgamechat.cpp
@@ -29,8 +29,8 @@
#include <klocale.h>
#include <kdebug.h>
-#include <qmap.h>
-#include <qintdict.h>
+#include <tqmap.h>
+#include <tqintdict.h>
//FIXME:
#define FIRST_ID 2 // first id, that is free of use, aka not defined above
@@ -51,24 +51,24 @@ public:
int mMessageId;
- QIntDict<KPlayer> mIndex2Player;
+ TQIntDict<KPlayer> mIndex2Player;
- QMap<int, int> mSendId2PlayerId;
+ TQMap<int, int> mSendId2PlayerId;
int mToMyGroup; // just as the above - but for the group, not for players
};
-KGameChat::KGameChat(KGame* g, int msgid, QWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(KGame* g, int msgid, TQWidget* parent) : KChatBase(parent)
{
init(g, msgid);
}
-KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, QWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, TQWidget* parent) : KChatBase(parent)
{
init(g, msgid);
setFromPlayer(fromPlayer);
}
-KGameChat::KGameChat(QWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(TQWidget* parent) : KChatBase(parent)
{
init(0, -1);
}
@@ -88,7 +88,7 @@ void KGameChat::init(KGame* g, int msgId)
setKGame(g);
}
-void KGameChat::addMessage(int fromId, const QString& text)
+void KGameChat::addMessage(int fromId, const TQString& text)
{
if (!d->mGame) {
kdWarning(11001) << "no KGame object has been set" << endl;
@@ -105,7 +105,7 @@ void KGameChat::addMessage(int fromId, const QString& text)
}
}
-void KGameChat::returnPressed(const QString& text)
+void KGameChat::returnPressed(const TQString& text)
{
if (!d->mFromPlayer) {
kdWarning(11001) << k_funcinfo << ": You must set a player first!" << endl;
@@ -123,7 +123,7 @@ void KGameChat::returnPressed(const QString& text)
if (isToGroupMessage(id)) {
// note: there is currently no support for other groups than the players
// group! It might be useful to send to other groups, too
- QString group = d->mFromPlayer->group();
+ TQString group = d->mFromPlayer->group();
kdDebug(11001) << "send to group " << group << endl;
int sender = d->mFromPlayer->id();
d->mGame->sendGroupMessage(text, messageId(), sender, group);
@@ -164,7 +164,7 @@ bool KGameChat::isToPlayerMessage(int id) const
{
return d->mSendId2PlayerId.contains(id); }
-QString KGameChat::sendToPlayerEntry(const QString& name) const
+TQString KGameChat::sendToPlayerEntry(const TQString& name) const
{ return i18n("Send to %1").arg(name); }
int KGameChat::playerId(int id) const
@@ -178,7 +178,7 @@ int KGameChat::playerId(int id) const
int KGameChat::sendingId(int playerId) const
{
- QMap<int, int>::Iterator it;
+ TQMap<int, int>::Iterator it;
for (it = d->mSendId2PlayerId.begin(); it != d->mSendId2PlayerId.end(); ++it) {
if (it.data() == playerId) {
return it.key();
@@ -187,8 +187,8 @@ int KGameChat::sendingId(int playerId) const
return -1;
}
-const QString& KGameChat::fromName() const
-{ return d->mFromPlayer ? d->mFromPlayer->name() : QString::null; }
+const TQString& KGameChat::fromName() const
+{ return d->mFromPlayer ? d->mFromPlayer->name() : TQString::null; }
bool KGameChat::hasPlayer(int id) const
{
@@ -227,15 +227,15 @@ void KGameChat::setKGame(KGame* g)
d->mGame = g;
if (d->mGame) {
- connect(d->mGame, SIGNAL(signalPlayerJoinedGame(KPlayer*)),
- this, SLOT(slotAddPlayer(KPlayer*)));
- connect(d->mGame, SIGNAL(signalPlayerLeftGame(KPlayer*)),
- this, SLOT(slotRemovePlayer(KPlayer*)));
- connect(d->mGame, SIGNAL(signalNetworkData(int, const QByteArray&, Q_UINT32, Q_UINT32)),
- this, SLOT(slotReceiveMessage(int, const QByteArray&, Q_UINT32, Q_UINT32)));
- connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame()));
-
- QPtrList<KPlayer> playerList = *d->mGame->playerList();
+ connect(d->mGame, TQT_SIGNAL(signalPlayerJoinedGame(KPlayer*)),
+ this, TQT_SLOT(slotAddPlayer(KPlayer*)));
+ connect(d->mGame, TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)),
+ this, TQT_SLOT(slotRemovePlayer(KPlayer*)));
+ connect(d->mGame, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, Q_UINT32)),
+ this, TQT_SLOT(slotReceiveMessage(int, const TQByteArray&, Q_UINT32, Q_UINT32)));
+ connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame()));
+
+ TQPtrList<KPlayer> playerList = *d->mGame->playerList();
for (int unsigned i = 0; i < playerList.count(); i++) {
slotAddPlayer(playerList.at(i));
}
@@ -261,7 +261,7 @@ void KGameChat::slotUnsetKGame()
}
disconnect(d->mGame, 0, this, 0);
removeSendingEntry(d->mToMyGroup);
- QMap<int, int>::Iterator it;
+ TQMap<int, int>::Iterator it;
for (it = d->mSendId2PlayerId.begin(); it != d->mSendId2PlayerId.end(); ++it) {
removeSendingEntry(it.data());
}
@@ -281,10 +281,10 @@ void KGameChat::slotAddPlayer(KPlayer* p)
int sendingId = nextId();
addSendingEntry(comboBoxItem(p->name()), sendingId);
d->mSendId2PlayerId.insert(sendingId, p->id());
- connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
- this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
- connect(p, SIGNAL(signalNetworkData(int, const QByteArray&, Q_UINT32, KPlayer*)),
- this, SLOT(slotReceivePrivateMessage(int, const QByteArray&, Q_UINT32, KPlayer*)));
+ connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
+ this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
+ connect(p, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, KPlayer*)),
+ this, TQT_SLOT(slotReceivePrivateMessage(int, const TQByteArray&, Q_UINT32, KPlayer*)));
}
void KGameChat::slotRemovePlayer(KPlayer* p)
@@ -317,7 +317,7 @@ void KGameChat::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player)
}
}
-void KGameChat::slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q_UINT32 sender, KPlayer* me)
+void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me)
{
if (!me || me != fromPlayer()) {
kdDebug() << k_funcinfo << "nope - not for us!" << endl;
@@ -326,14 +326,14 @@ void KGameChat::slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q
slotReceiveMessage(msgid, buffer, me->id(), sender);
}
-void KGameChat::slotReceiveMessage(int msgid, const QByteArray& buffer, Q_UINT32 , Q_UINT32 sender)
+void KGameChat::slotReceiveMessage(int msgid, const TQByteArray& buffer, Q_UINT32 , Q_UINT32 sender)
{
- QDataStream msg(buffer, IO_ReadOnly);
+ TQDataStream msg(buffer, IO_ReadOnly);
if (msgid != messageId()) {
return;
}
- QString text;
+ TQString text;
msg >> text;
addMessage(sender, text);
diff --git a/libkdegames/kgame/kgamechat.h b/libkdegames/kgame/kgamechat.h
index 6f7ea65d..effcca22 100644
--- a/libkdegames/kgame/kgamechat.h
+++ b/libkdegames/kgame/kgamechat.h
@@ -21,7 +21,7 @@
#ifndef __KGAMECHAT_H__
#define __KGAMECHAT_H__
-#include <qstring.h>
+#include <tqstring.h>
#include "kchatbase.h"
#include <kdemacros.h>
@@ -49,14 +49,14 @@ public:
* the chat message. The @p fromPlayer is the local player (see @ref
* setFromPlayer).
**/
- KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, QWidget * parent);
+ KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, TQWidget * parent);
/**
* @overload
* To make use of this widget you need to call @ref setFromPlayer
* manually.
**/
- KGameChat(KGame* game, int msgId, QWidget* parent);
+ KGameChat(KGame* game, int msgId, TQWidget* parent);
/**
* @overload
@@ -64,7 +64,7 @@ public:
* setGame, setFromPlayer and setMessageId manually.
* @since 3.2
**/
- KGameChat(QWidget* parent);
+ KGameChat(TQWidget* parent);
virtual ~KGameChat();
@@ -114,14 +114,14 @@ public:
* reimplemented from @ref KChatBase
* @return @ref KPlayer::name() for the player set by @ref setFromPlayer
**/
- virtual const QString& fromName() const;
+ virtual const TQString& fromName() const;
public slots:
- virtual void addMessage(const QString& fromName, const QString& text) { KChatBase::addMessage(fromName, text);}
- virtual void addMessage(int fromId, const QString& text);
+ virtual void addMessage(const TQString& fromName, const TQString& text) { KChatBase::addMessage(fromName, text);}
+ virtual void addMessage(int fromId, const TQString& text);
- void slotReceiveMessage(int, const QByteArray&, Q_UINT32 receiver, Q_UINT32 sender);
+ void slotReceiveMessage(int, const TQByteArray&, Q_UINT32 receiver, Q_UINT32 sender);
protected:
/**
@@ -187,7 +187,7 @@ protected:
* KChatBase. By default this is "send to name" where name is the name
* that you specify. See also KChatBase::addSendingEntry
**/
- virtual QString sendToPlayerEntry(const QString& name) const;
+ virtual TQString sendToPlayerEntry(const TQString& name) const;
protected slots:
@@ -208,10 +208,10 @@ protected slots:
* gets forwarded to slotReceiveMessage if @p me equals
* fromPlayer.
**/
- void slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q_UINT32 sender, KPlayer* me);
+ void slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me);
protected:
- virtual void returnPressed(const QString& text);
+ virtual void returnPressed(const TQString& text);
private:
void init(KGame* g, int msgid);
diff --git a/libkdegames/kgame/kgameerror.cpp b/libkdegames/kgame/kgameerror.cpp
index 93f40f93..eb98a797 100644
--- a/libkdegames/kgame/kgameerror.cpp
+++ b/libkdegames/kgame/kgameerror.cpp
@@ -26,33 +26,33 @@
#include <klocale.h>
-QByteArray KGameError::errVersion(int remoteVersion)
+TQByteArray KGameError::errVersion(int remoteVersion)
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
s << (Q_INT32)KGameMessage::version();
s << (Q_INT32)remoteVersion;
return b;
}
-QByteArray KGameError::errCookie(int localCookie, int remoteCookie)
+TQByteArray KGameError::errCookie(int localCookie, int remoteCookie)
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
s << (Q_INT32)localCookie;
s << (Q_INT32)remoteCookie;
return b;
}
-QString KGameError::errorText(int errorCode, const QByteArray& message)
+TQString KGameError::errorText(int errorCode, const TQByteArray& message)
{
- QDataStream s(message, IO_ReadOnly);
+ TQDataStream s(message, IO_ReadOnly);
return errorText(errorCode, s);
}
-QString KGameError::errorText(int errorCode, QDataStream& s)
+TQString KGameError::errorText(int errorCode, TQDataStream& s)
{
- QString text;
+ TQString text;
switch (errorCode) {
case Cookie:
{
diff --git a/libkdegames/kgame/kgameerror.h b/libkdegames/kgame/kgameerror.h
index 2916e891..071737cc 100644
--- a/libkdegames/kgame/kgameerror.h
+++ b/libkdegames/kgame/kgameerror.h
@@ -23,7 +23,7 @@
#ifndef __KGAMEERROR_H_
#define __KGAMEERROR_H_
-#include <qstring.h>
+#include <tqstring.h>
class KGameError
@@ -40,19 +40,19 @@ public:
/**
* Generate an error message with Erorr Code = ErrCookie
**/
- static QByteArray errCookie(int localCookie, int remoteCookie);
- static QByteArray errVersion(int remoteVersion);
+ static TQByteArray errCookie(int localCookie, int remoteCookie);
+ static TQByteArray errVersion(int remoteVersion);
/**
- * Create an erorr text using a QDataStream (QByteArray) which was
+ * Create an erorr text using a TQDataStream (TQByteArray) which was
* created using @ref KGameError. This is the opposite function to all
* the errXYZ() function (e.g. @ref errVersion).
* You want to use this to generate the message that shall be
* displayed to the user.
* @return an error message
**/
- static QString errorText(int errorCode, QDataStream& message);
- static QString errorText(int errorCode, const QByteArray& message);
+ static TQString errorText(int errorCode, TQDataStream& message);
+ static TQString errorText(int errorCode, const TQByteArray& message);
};
diff --git a/libkdegames/kgame/kgameio.cpp b/libkdegames/kgame/kgameio.cpp
index 9b3a55e8..7183d5d3 100644
--- a/libkdegames/kgame/kgameio.cpp
+++ b/libkdegames/kgame/kgameio.cpp
@@ -30,20 +30,20 @@
#include <kdebug.h>
-#include <qwidget.h>
-#include <qbuffer.h>
-#include <qtimer.h>
+#include <tqwidget.h>
+#include <tqbuffer.h>
+#include <tqtimer.h>
#include <stdlib.h>
// ----------------------- Generic IO -------------------------
-KGameIO::KGameIO() : QObject(0,0)
+KGameIO::KGameIO() : TQObject(0,0)
{
kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)" << sizeof(KGameIO) << endl;
mPlayer = 0;
}
-KGameIO::KGameIO(KPlayer* player) : QObject(0,0)
+KGameIO::KGameIO(KPlayer* player) : TQObject(0,0)
{
kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)" << sizeof(KGameIO) << endl;
mPlayer = 0;
@@ -76,12 +76,12 @@ void KGameIO::notifyTurn(bool b)
return;
}
bool sendit=false;
- QByteArray buffer;
- QDataStream stream(buffer, IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer, IO_WriteOnly);
emit signalPrepareTurn(stream, b, this, &sendit);
if (sendit)
{
- QDataStream ostream(buffer,IO_ReadOnly);
+ TQDataStream ostream(buffer,IO_ReadOnly);
Q_UINT32 sender = player()->id(); // force correct sender
kdDebug(11001) << "Prepare turn sendInput" << endl;
sendInput(ostream, true, sender);
@@ -97,7 +97,7 @@ KGame* KGameIO::game() const
return player()->game();
}
-bool KGameIO::sendInput(QDataStream& s, bool transmit, Q_UINT32 sender)
+bool KGameIO::sendInput(TQDataStream& s, bool transmit, Q_UINT32 sender)
{
if (!player())
{
@@ -117,7 +117,7 @@ void KGameIO::Debug()
// ----------------------- Key IO ---------------------------
-KGameKeyIO::KGameKeyIO(QWidget *parent)
+KGameKeyIO::KGameKeyIO(TQWidget *parent)
: KGameIO()
{
if (parent)
@@ -137,7 +137,7 @@ KGameKeyIO::~KGameKeyIO()
int KGameKeyIO::rtti() const { return KeyIO; }
-bool KGameKeyIO::eventFilter( QObject *o, QEvent *e )
+bool KGameKeyIO::eventFilter( TQObject *o, TQEvent *e )
{
if (!player())
{
@@ -145,16 +145,16 @@ bool KGameKeyIO::eventFilter( QObject *o, QEvent *e )
}
// key press/release
- if ( e->type() == QEvent::KeyPress ||
- e->type() == QEvent::KeyRelease )
+ if ( e->type() == TQEvent::KeyPress ||
+ e->type() == TQEvent::KeyRelease )
{
- QKeyEvent *k = (QKeyEvent*)e;
+ TQKeyEvent *k = (TQKeyEvent*)e;
// kdDebug(11001) << "KGameKeyIO " << this << " key press/release " << k->key() << endl ;
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
bool eatevent=false;
emit signalKeyEvent(this,stream,k,&eatevent);
- QDataStream msg(buffer,IO_ReadOnly);
+ TQDataStream msg(buffer,IO_ReadOnly);
if (eatevent && sendInput(msg))
{
@@ -162,12 +162,12 @@ bool KGameKeyIO::eventFilter( QObject *o, QEvent *e )
}
return false; // do not eat otherwise
}
- return QObject::eventFilter( o, e ); // standard event processing
+ return TQObject::eventFilter( o, e ); // standard event processing
}
// ----------------------- Mouse IO ---------------------------
-KGameMouseIO::KGameMouseIO(QWidget *parent,bool trackmouse)
+KGameMouseIO::KGameMouseIO(TQWidget *parent,bool trackmouse)
: KGameIO()
{
if (parent)
@@ -195,11 +195,11 @@ void KGameMouseIO::setMouseTracking(bool b)
{
if (parent())
{
- ((QWidget*)parent())->setMouseTracking(b);
+ ((TQWidget*)parent())->setMouseTracking(b);
}
}
-bool KGameMouseIO::eventFilter( QObject *o, QEvent *e )
+bool KGameMouseIO::eventFilter( TQObject *o, TQEvent *e )
{
if (!player())
{
@@ -208,28 +208,28 @@ bool KGameMouseIO::eventFilter( QObject *o, QEvent *e )
// kdDebug(11001) << "KGameMouseIO " << this << endl ;
// mouse action
- if ( e->type() == QEvent::MouseButtonPress ||
- e->type() == QEvent::MouseButtonRelease ||
- e->type() == QEvent::MouseButtonDblClick ||
- e->type() == QEvent::Wheel ||
- e->type() == QEvent::MouseMove
+ if ( e->type() == TQEvent::MouseButtonPress ||
+ e->type() == TQEvent::MouseButtonRelease ||
+ e->type() == TQEvent::MouseButtonDblClick ||
+ e->type() == TQEvent::Wheel ||
+ e->type() == TQEvent::MouseMove
)
{
- QMouseEvent *k = (QMouseEvent*)e;
+ TQMouseEvent *k = (TQMouseEvent*)e;
// kdDebug(11001) << "KGameMouseIO " << this << endl ;
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
bool eatevent=false;
emit signalMouseEvent(this,stream,k,&eatevent);
// kdDebug(11001) << "################# eatevent=" << eatevent << endl;
- QDataStream msg(buffer,IO_ReadOnly);
+ TQDataStream msg(buffer,IO_ReadOnly);
if (eatevent && sendInput(msg))
{
return eatevent;
}
return false; // do not eat otherwise
}
- return QObject::eventFilter( o, e ); // standard event processing
+ return TQObject::eventFilter( o, e ); // standard event processing
}
@@ -249,7 +249,7 @@ public:
};
// ----------------------- Process IO ---------------------------
-KGameProcessIO::KGameProcessIO(const QString& name)
+KGameProcessIO::KGameProcessIO(const TQString& name)
: KGameIO()
{
kdDebug(11001) << k_funcinfo << ": this=" << this << ", sizeof(this)=" << sizeof(KGameProcessIO) << endl;
@@ -266,12 +266,12 @@ KGameProcessIO::KGameProcessIO(const QString& name)
//kdDebug(11001) << "================= KMEssage SetSErver ==================== " << endl;
//d->mMessageClient->setServer(d->mMessageServer);
kdDebug(11001) << "================= KMEssage: Connect ==================== " << endl;
- //connect(d->mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32)),
- // this, SLOT(clientMessage(const QByteArray&, Q_UINT32)));
- //connect(d->mMessageClient, SIGNAL(forwardReceived(const QByteArray&, Q_UINT32, const QValueList <Q_UINT32> &)),
- // this, SLOT(clientMessage(const QByteArray&, Q_UINT32, const QValueList <Q_UINT32> &)));
- connect(d->mProcessIO, SIGNAL(received(const QByteArray&)),
- this, SLOT(receivedMessage(const QByteArray&)));
+ //connect(d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)),
+ // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32)));
+ //connect(d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList <Q_UINT32> &)),
+ // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32, const TQValueList <Q_UINT32> &)));
+ connect(d->mProcessIO, TQT_SIGNAL(received(const TQByteArray&)),
+ this, TQT_SLOT(receivedMessage(const TQByteArray&)));
//kdDebug(11001) << "Our client is id="<<d->mMessageClient->id() << endl;
}
@@ -300,8 +300,8 @@ void KGameProcessIO::initIO(KPlayer *p)
{
KGameIO::initIO(p);
// Send 'hello' to process
- QByteArray buffer;
- QDataStream stream(buffer, IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer, IO_WriteOnly);
Q_INT16 id = p->userId();
stream << id;
@@ -326,8 +326,8 @@ void KGameProcessIO::notifyTurn(bool b)
return;
}
bool sendit=true;
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
stream << (Q_INT8)b;
emit signalPrepareTurn(stream,b,this,&sendit);
if (sendit)
@@ -338,17 +338,17 @@ void KGameProcessIO::notifyTurn(bool b)
}
}
-void KGameProcessIO::sendSystemMessage(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+void KGameProcessIO::sendSystemMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{
sendAllMessages(stream, msgid, receiver, sender, false);
}
-void KGameProcessIO::sendMessage(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+void KGameProcessIO::sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{
sendAllMessages(stream, msgid, receiver, sender, true);
}
-void KGameProcessIO::sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg)
+void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg)
{
kdDebug(11001) << "==============> KGameProcessIO::sendMessage (usermsg="<<usermsg<<")" << endl;
// if (!player()) return ;
@@ -361,10 +361,10 @@ void KGameProcessIO::sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 rec
kdDebug(11001) << "=============* ProcessIO (" << msgid << "," << receiver << "," << sender << ") ===========" << endl;
- QByteArray buffer;
- QDataStream ostream(buffer,IO_WriteOnly);
- QBuffer *device=(QBuffer *)stream.device();
- QByteArray data=device->buffer();;
+ TQByteArray buffer;
+ TQDataStream ostream(buffer,IO_WriteOnly);
+ TQBuffer *device=(TQBuffer *)stream.device();
+ TQByteArray data=device->buffer();;
KGameMessage::createHeader(ostream,sender,receiver,msgid);
// ostream.writeRawBytes(data.data()+device->at(),data.size()-device->at());
@@ -377,10 +377,10 @@ void KGameProcessIO::sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 rec
}
}
-//void KGameProcessIO::clientMessage(const QByteArray& receiveBuffer, Q_UINT32 clientID, const QValueList <Q_UINT32> &recv)
-void KGameProcessIO::receivedMessage(const QByteArray& receiveBuffer)
+//void KGameProcessIO::clientMessage(const TQByteArray& receiveBuffer, Q_UINT32 clientID, const TQValueList <Q_UINT32> &recv)
+void KGameProcessIO::receivedMessage(const TQByteArray& receiveBuffer)
{
- QDataStream stream(receiveBuffer,IO_ReadOnly);
+ TQDataStream stream(receiveBuffer,IO_ReadOnly);
int msgid;
Q_UINT32 sender;
Q_UINT32 receiver;
@@ -391,10 +391,10 @@ void KGameProcessIO::receivedMessage(const QByteArray& receiveBuffer)
// Cut out the header part...to not confuse network code
- QBuffer *buf=(QBuffer *)stream.device();
- QByteArray newbuffer;
+ TQBuffer *buf=(TQBuffer *)stream.device();
+ TQByteArray newbuffer;
newbuffer.setRawData(buf->buffer().data()+buf->at(),buf->size()-buf->at());
- QDataStream ostream(newbuffer,IO_ReadOnly);
+ TQDataStream ostream(newbuffer,IO_ReadOnly);
kdDebug(11001) << "Newbuffer size=" << newbuffer.size() << endl;
@@ -443,7 +443,7 @@ public:
int mPauseCounter;
- QTimer* mAdvanceTimer;
+ TQTimer* mAdvanceTimer;
};
KGameComputerIO::KGameComputerIO() : KGameIO()
@@ -488,8 +488,8 @@ int KGameComputerIO::reactionPeriod() const
void KGameComputerIO::setAdvancePeriod(int ms)
{
stopAdvancePeriod();
- d->mAdvanceTimer = new QTimer(this);
- connect(d->mAdvanceTimer, SIGNAL(timeout()), this, SLOT(advance()));
+ d->mAdvanceTimer = new TQTimer(this);
+ connect(d->mAdvanceTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(advance()));
d->mAdvanceTimer->start(ms);
}
diff --git a/libkdegames/kgame/kgameio.h b/libkdegames/kgame/kgameio.h
index 4d7e0f5b..82b84740 100644
--- a/libkdegames/kgame/kgameio.h
+++ b/libkdegames/kgame/kgameio.h
@@ -23,8 +23,8 @@
#ifndef __KGAMEIO_H__
#define __KGAMEIO_H__
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include <kdemacros.h>
class KPlayer;
class KGame;
@@ -128,7 +128,7 @@ public:
/**
* Send an input message using @ref KPlayer::forwardInput
**/
- bool sendInput(QDataStream& stream, bool transmit = true, Q_UINT32 sender = 0);
+ bool sendInput(TQDataStream& stream, bool transmit = true, Q_UINT32 sender = 0);
signals:
/**
@@ -147,7 +147,7 @@ signals:
*
* Example:
* \code
- * void GameWindow::slotPrepareTurn(QDataStream &stream,bool b,KGameIO *input,bool * )
+ * void GameWindow::slotPrepareTurn(TQDataStream &stream,bool b,KGameIO *input,bool * )
* {
* KPlayer *player=input->player();
* if (!player->myTurn()) return ;
@@ -162,7 +162,7 @@ signals:
* @param send set this to true to send the generated move using @ref
* sendInput
**/
- void signalPrepareTurn(QDataStream & stream, bool turn, KGameIO *io, bool * send);
+ void signalPrepareTurn(TQDataStream & stream, bool turn, KGameIO *io, bool * send);
private:
@@ -193,13 +193,13 @@ public:
* \code
* KGameKeyIO *input;
* input=new KGameKeyIO(myWidget);
- * connect(input,SIGNAL(signalKeyEvent(KGameIO *,QDataStream &,QKeyEvent *,bool *)),
- * this,SLOT(slotKeyInput(KGameIO *,QDataStream &,QKeyEvent *,bool *)));
+ * connect(input,TQT_SIGNAL(signalKeyEvent(KGameIO *,TQDataStream &,TQKeyEvent *,bool *)),
+ * this,TQT_SLOT(slotKeyInput(KGameIO *,TQDataStream &,TQKeyEvent *,bool *)));
* \endcode
*
* @param parent The parents widget whose keyboard events * should be grabbed
*/
- KGameKeyIO(QWidget *parent);
+ KGameKeyIO(TQWidget *parent);
virtual ~KGameKeyIO();
/**
@@ -228,16 +228,16 @@ signals:
*
* @param io the IO device we belong to
* @param stream the stream where we write our move into
- * @param m The QKeyEvent we can evaluate
+ * @param m The TQKeyEvent we can evaluate
* @param eatevent set this to true if we processed the event
*/
- void signalKeyEvent(KGameIO *io,QDataStream &stream,QKeyEvent *m,bool *eatevent);
+ void signalKeyEvent(KGameIO *io,TQDataStream &stream,TQKeyEvent *m,bool *eatevent);
protected:
/**
* Internal method to process the events
*/
- bool eventFilter( QObject *o, QEvent *e );
+ bool eventFilter( TQObject *o, TQEvent *e );
};
/**
@@ -258,14 +258,14 @@ public:
* \code
* KGameMouseIO *input;
* input=new KGameMouseIO(mView);
- * connect(input,SIGNAL(signalMouseEvent(KGameIO *,QDataStream &,QMouseEvent *,bool *)),
- * this,SLOT(slotMouseInput(KGameIO *,QDataStream &,QMouseEvent *,bool *)));
+ * connect(input,TQT_SIGNAL(signalMouseEvent(KGameIO *,TQDataStream &,TQMouseEvent *,bool *)),
+ * this,TQT_SLOT(slotMouseInput(KGameIO *,TQDataStream &,TQMouseEvent *,bool *)));
* \endcode
*
* @param parent The widget whose events should be captured
* @param trackmouse enables mouse tracking (gives mouse move events)
*/
- KGameMouseIO(QWidget *parent,bool trackmouse=false);
+ KGameMouseIO(TQWidget *parent,bool trackmouse=false);
virtual ~KGameMouseIO();
/**
@@ -298,16 +298,16 @@ signals:
*
* @param io the IO device we belong to
* @param stream the stream where we write our move into
- * @param m The QMouseEvent we can evaluate
+ * @param m The TQMouseEvent we can evaluate
* @param eatevent set this to true if we processed the event
*/
- void signalMouseEvent(KGameIO *io,QDataStream &stream,QMouseEvent *m,bool *eatevent);
+ void signalMouseEvent(KGameIO *io,TQDataStream &stream,TQMouseEvent *m,bool *eatevent);
protected:
/**
* Internal event filter
*/
- bool eventFilter( QObject *o, QEvent *e );
+ bool eventFilter( TQObject *o, TQEvent *e );
};
@@ -332,15 +332,15 @@ public:
* \code
* KGameProcessIO *input;
* input=new KGameProcessIO(executable_file);
- * connect(input,SIGNAL(signalPrepareTurn(QDataStream &,bool,KGameIO *,bool *)),
- * this,SLOT(slotPrepareTurn(QDataStream &,bool,KGameIO *,bool *)));
- * connect(input,SIGNAL(signalProcessQuery(QDataStream &,KGameProcessIO *)),
- * this,SLOT(slotProcessQuery(QDataStream &,KGameProcessIO *)));
+ * connect(input,TQT_SIGNAL(signalPrepareTurn(TQDataStream &,bool,KGameIO *,bool *)),
+ * this,TQT_SLOT(slotPrepareTurn(TQDataStream &,bool,KGameIO *,bool *)));
+ * connect(input,TQT_SIGNAL(signalProcessQuery(TQDataStream &,KGameProcessIO *)),
+ * this,TQT_SLOT(slotProcessQuery(TQDataStream &,KGameProcessIO *)));
* \endcode
*
* @param name the filename of the process to start
*/
- KGameProcessIO(const QString& name);
+ KGameProcessIO(const TQString& name);
/**
* Deletes the process input devices
@@ -364,7 +364,7 @@ public:
* @param receiver - not used
* @param sender - who send the message
*/
- void sendMessage(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender);
+ void sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender);
/**
* Send a system message to the process. This is analogous to the sendMessage
@@ -376,7 +376,7 @@ public:
* @param receiver - not used
* @param sender - who send the message
*/
- void sendSystemMessage(QDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender);
+ void sendSystemMessage(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender);
/**
* Init this device by setting the player and e.g. sending an
@@ -403,13 +403,13 @@ public:
/**
* Internal ~ombined function for all message handling
**/
- void sendAllMessages(QDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg);
+ void sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg);
protected slots:
/**
* Internal message handler to receive data from the process
*/
- void receivedMessage(const QByteArray& receiveBuffer);
+ void receivedMessage(const TQByteArray& receiveBuffer);
signals:
@@ -423,20 +423,20 @@ signals:
*
* Example:
* \code
- * void GameWindow::slotProcessQuery(QDataStream &stream,KGameProcessIO *reply)
+ * void GameWindow::slotProcessQuery(TQDataStream &stream,KGameProcessIO *reply)
* {
* int no;
* stream >> no; // We assume the process sends us an integer question numner
* if (no==1) // but YOU have to do this in the process player
* {
- * QByteArray buffer;
- * QDataStream out(buffer,IO_WriteOnly);
+ * TQByteArray buffer;
+ * TQDataStream out(buffer,IO_WriteOnly);
* reply->sendSystemMessage(out,4242,0,0); // lets reply something...
* }
* }
* \endcode
*/
- void signalProcessQuery(QDataStream &stream,KGameProcessIO *me);
+ void signalProcessQuery(TQDataStream &stream,KGameProcessIO *me);
/**
* Signal generated when the computer player is added.
@@ -448,7 +448,7 @@ signals:
* @param p the player itself
* @param send set this to false if no move should be generated
*/
- void signalIOAdded(KGameIO *game,QDataStream &stream,KPlayer *p,bool *send);
+ void signalIOAdded(KGameIO *game,TQDataStream &stream,KPlayer *p,bool *send);
protected:
@@ -497,7 +497,7 @@ public:
int reactionPeriod() const;
/**
- * Start a QTimer which calls advance every @p ms milli seconds.
+ * Start a TQTimer which calls advance every @p ms milli seconds.
**/
void setAdvancePeriod(int ms);
@@ -525,18 +525,18 @@ public:
public slots:
/**
- * Works kind of similar to QCanvas::advance. Increase the internal
+ * Works kind of similar to TQCanvas::advance. Increase the internal
* advance counter. If @p reactionPeriod is reached the counter is set back to
* 0 and @ref signalReaction is emitted. This is when the player is meant
* to do something (move its units or so).
*
- * This is very useful if you use QCanvas as you can use this in your
- * QCanvas::advance call. The advantage is that if you change the speed
- * of the game (i.e. change QCanvas::setAdvancePeriod) the computer
+ * This is very useful if you use TQCanvas as you can use this in your
+ * TQCanvas::advance call. The advantage is that if you change the speed
+ * of the game (i.e. change TQCanvas::setAdvancePeriod) the computer
* player gets slower as well.
*
- * If you don't use QCanvas you can use setAdvancePeriod to get
- * the same result. Alternatively you can just use a QTimer.
+ * If you don't use TQCanvas you can use setAdvancePeriod to get
+ * the same result. Alternatively you can just use a TQTimer.
*
**/
virtual void advance();
diff --git a/libkdegames/kgame/kgamemessage.cpp b/libkdegames/kgame/kgamemessage.cpp
index 6464d407..228708e9 100644
--- a/libkdegames/kgame/kgamemessage.cpp
+++ b/libkdegames/kgame/kgamemessage.cpp
@@ -60,38 +60,38 @@ bool KGameMessage::isGame(Q_UINT32 msgid)
}
-void KGameMessage::createHeader(QDataStream &msg,Q_UINT32 sender,Q_UINT32 receiver,int msgid)
+void KGameMessage::createHeader(TQDataStream &msg,Q_UINT32 sender,Q_UINT32 receiver,int msgid)
{
msg << (Q_INT16)sender << (Q_INT16)receiver << (Q_INT16)msgid;
}
-void KGameMessage::extractHeader(QDataStream &msg,Q_UINT32 &sender,Q_UINT32 &receiver,int &msgid)
+void KGameMessage::extractHeader(TQDataStream &msg,Q_UINT32 &sender,Q_UINT32 &receiver,int &msgid)
{
Q_INT16 d3,d4,d5;
msg >> d3 >> d4 >> d5;
sender=d3;receiver=d4;msgid=d5;
}
-void KGameMessage::createPropertyHeader(QDataStream &msg,int id)
+void KGameMessage::createPropertyHeader(TQDataStream &msg,int id)
{
msg << (Q_INT16)id;
}
-void KGameMessage::extractPropertyHeader(QDataStream &msg,int &id)
+void KGameMessage::extractPropertyHeader(TQDataStream &msg,int &id)
{
Q_INT16 d1;
msg >> d1;
id=d1;
}
-void KGameMessage::createPropertyCommand(QDataStream &msg,int cmdid,int pid,int cmd)
+void KGameMessage::createPropertyCommand(TQDataStream &msg,int cmdid,int pid,int cmd)
{
createPropertyHeader(msg,cmdid);
msg << (Q_INT16)pid ;
msg << (Q_INT8)cmd ;
}
-void KGameMessage::extractPropertyCommand(QDataStream &msg,int &pid,int &cmd)
+void KGameMessage::extractPropertyCommand(TQDataStream &msg,int &pid,int &cmd)
{
Q_INT16 d1;
Q_INT8 d2;
@@ -105,7 +105,7 @@ int KGameMessage::version()
return MESSAGE_VERSION;
}
-QString KGameMessage::messageId2Text(int msgid)
+TQString KGameMessage::messageId2Text(int msgid)
{
// this should contain all KGameMessage::GameMessageIds
// feel free to add missing ones, to remove obsolete one and even feel free to
@@ -151,6 +151,6 @@ QString KGameMessage::messageId2Text(int msgid)
return i18n("Player ID");
case KGameMessage::IdUser: // IdUser must be unknown for use, too!
default:
- return QString::null;
+ return TQString::null;
}
}
diff --git a/libkdegames/kgame/kgamemessage.h b/libkdegames/kgame/kgamemessage.h
index 4394b4fa..d671a948 100644
--- a/libkdegames/kgame/kgamemessage.h
+++ b/libkdegames/kgame/kgamemessage.h
@@ -23,7 +23,7 @@
#ifndef __KGAMEMSG_H_
#define __KGAMEMSG_H_
-#include <qdatastream.h>
+#include <tqdatastream.h>
#include <kdemacros.h>
class KDE_EXPORT KGameMessage
@@ -85,34 +85,34 @@ class KDE_EXPORT KGameMessage
* (message length and magic cookie). If you don't need them remove them
* with @ref dropExternalHeader
*/
- static void createHeader(QDataStream &msg, Q_UINT32 sender, Q_UINT32 receiver, int msgid);
+ static void createHeader(TQDataStream &msg, Q_UINT32 sender, Q_UINT32 receiver, int msgid);
/**
* Retrieves the information like cookie,sender,receiver,... from a message header
*
* Note that it could be necessary to call @ref dropExternalHeader first
*/
- static void extractHeader(QDataStream &msg,Q_UINT32 &sender, Q_UINT32 &receiver, int &msgid);
+ static void extractHeader(TQDataStream &msg,Q_UINT32 &sender, Q_UINT32 &receiver, int &msgid);
/**
* Creates a property header given the property id
*/
- static void createPropertyHeader(QDataStream &msg, int id);
+ static void createPropertyHeader(TQDataStream &msg, int id);
/**
* Retrieves the property id from a property message header
*/
- static void extractPropertyHeader(QDataStream &msg, int &id);
+ static void extractPropertyHeader(TQDataStream &msg, int &id);
/**
* Creates a property header given the property id
*/
- static void createPropertyCommand(QDataStream &msg, int cmdid, int pid, int cmd);
+ static void createPropertyCommand(TQDataStream &msg, int cmdid, int pid, int cmd);
/**
* Retrieves the property id from a property message header
*/
- static void extractPropertyCommand(QDataStream &msg, int &pid, int &cmd);
+ static void extractPropertyCommand(TQDataStream &msg, int &pid, int &cmd);
/**
* @return Version of the network library
@@ -124,10 +124,10 @@ class KDE_EXPORT KGameMessage
* suitable string for it. This string can't be used to identify a message
* (as it is i18n'ed) but it can make debugging more easy. See also @ref
* KGameDebugDialog.
- * @return Either a i18n'ed string (the name of the id) or QString::null if
+ * @return Either a i18n'ed string (the name of the id) or TQString::null if
* the msgid is unknown
**/
- static QString messageId2Text(int msgid);
+ static TQString messageId2Text(int msgid);
/**
diff --git a/libkdegames/kgame/kgamenetwork.cpp b/libkdegames/kgame/kgamenetwork.cpp
index 9eccb868..92669834 100644
--- a/libkdegames/kgame/kgamenetwork.cpp
+++ b/libkdegames/kgame/kgamenetwork.cpp
@@ -33,7 +33,7 @@
#include <kdebug.h>
-#include <qbuffer.h>
+#include <tqbuffer.h>
class KGameNetworkPrivate
@@ -52,14 +52,14 @@ public:
KMessageServer* mMessageServer;
Q_UINT32 mDisconnectId; // Stores gameId() over a disconnect process
DNSSD::PublicService* mService;
- QString mType;
- QString mName;
+ TQString mType;
+ TQString mName;
int mCookie;
};
// ------------------- NETWORK GAME ------------------------
-KGameNetwork::KGameNetwork(int c, QObject* parent) : QObject(parent, 0)
+KGameNetwork::KGameNetwork(int c, TQObject* parent) : TQObject(parent, 0)
{
d = new KGameNetworkPrivate;
d->mCookie = (Q_INT16)c;
@@ -120,25 +120,25 @@ void KGameNetwork::setMaster()
}
if (!d->mMessageClient) {
d->mMessageClient = new KMessageClient (this);
- connect (d->mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32)),
- this, SLOT(receiveNetworkTransmission(const QByteArray&, Q_UINT32)));
- connect (d->mMessageClient, SIGNAL(connectionBroken()),
- this, SIGNAL(signalConnectionBroken()));
- connect (d->mMessageClient, SIGNAL(aboutToDisconnect(Q_UINT32)),
- this, SLOT(aboutToLoseConnection(Q_UINT32)));
- connect (d->mMessageClient, SIGNAL(connectionBroken()),
- this, SLOT(slotResetConnection()));
-
- connect (d->mMessageClient, SIGNAL(adminStatusChanged(bool)),
- this, SLOT(slotAdminStatusChanged(bool)));
- connect (d->mMessageClient, SIGNAL(eventClientConnected(Q_UINT32)),
- this, SIGNAL(signalClientConnected(Q_UINT32)));
- connect (d->mMessageClient, SIGNAL(eventClientDisconnected(Q_UINT32, bool)),
- this, SIGNAL(signalClientDisconnected(Q_UINT32, bool)));
+ connect (d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)),
+ this, TQT_SLOT(receiveNetworkTransmission(const TQByteArray&, Q_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()),
+ this, TQT_SIGNAL(signalConnectionBroken()));
+ connect (d->mMessageClient, TQT_SIGNAL(aboutToDisconnect(Q_UINT32)),
+ this, TQT_SLOT(aboutToLoseConnection(Q_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()),
+ this, TQT_SLOT(slotResetConnection()));
+
+ connect (d->mMessageClient, TQT_SIGNAL(adminStatusChanged(bool)),
+ this, TQT_SLOT(slotAdminStatusChanged(bool)));
+ connect (d->mMessageClient, TQT_SIGNAL(eventClientConnected(Q_UINT32)),
+ this, TQT_SIGNAL(signalClientConnected(Q_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(eventClientDisconnected(Q_UINT32, bool)),
+ this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool)));
// broacast and direct messages are treated equally on receive.
- connect (d->mMessageClient, SIGNAL(forwardReceived(const QByteArray&, Q_UINT32, const QValueList<Q_UINT32>&)),
- d->mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList<Q_UINT32>&)),
+ d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)));
} else {
// should be no problem but still has to be tested
@@ -147,7 +147,7 @@ void KGameNetwork::setMaster()
d->mMessageClient->setServer(d->mMessageServer);
}
-void KGameNetwork::setDiscoveryInfo(const QString& type, const QString& name)
+void KGameNetwork::setDiscoveryInfo(const TQString& type, const TQString& name)
{
kdDebug() << k_funcinfo << type << ":" << name << endl;
d->mType = type;
@@ -201,7 +201,7 @@ bool KGameNetwork::offerConnections(Q_UINT16 port)
return true;
}
-bool KGameNetwork::connectToServer (const QString& host, Q_UINT16 port)
+bool KGameNetwork::connectToServer (const TQString& host, Q_UINT16 port)
{
if (host.isEmpty()) {
kdError(11001) << k_funcinfo << "No hostname given" << endl;
@@ -251,7 +251,7 @@ Q_UINT16 KGameNetwork::port() const
return 0;
}
-QString KGameNetwork::hostName() const
+TQString KGameNetwork::hostName() const
{
return d->mMessageClient->peerName();
}
@@ -276,8 +276,8 @@ void KGameNetwork::disconnect()
kdDebug(11001) << k_funcinfo << endl;
stopServerConnection();
if (d->mMessageServer) {
- QValueList <Q_UINT32> list=d->mMessageServer->clientIDs();
- QValueList<Q_UINT32>::Iterator it;
+ TQValueList <Q_UINT32> list=d->mMessageServer->clientIDs();
+ TQValueList<Q_UINT32>::Iterator it;
for( it = list.begin(); it != list.end(); ++it )
{
kdDebug(11001) << "Client id=" << (*it) << endl;
@@ -338,8 +338,8 @@ void KGameNetwork::electAdmin(Q_UINT32 clientID)
kdWarning(11001) << k_funcinfo << "only ADMIN is allowed to call this!" << endl;
return;
}
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
stream << static_cast<Q_UINT32>( KMessageServer::REQ_ADMIN_CHANGE );
stream << clientID;
d->mMessageClient->sendServerMessage(buffer);
@@ -351,8 +351,8 @@ void KGameNetwork::setMaxClients(int max)
kdWarning(11001) << k_funcinfo << "only ADMIN is allowed to call this!" << endl;
return;
}
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
stream << static_cast<Q_UINT32>( KMessageServer::REQ_MAX_NUM_CLIENTS );
stream << (Q_INT32)max;
d->mMessageClient->sendServerMessage(buffer);
@@ -376,27 +376,27 @@ void KGameNetwork::unlock()
bool KGameNetwork::sendSystemMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
stream << data;
return sendSystemMessage(buffer,msgid,receiver,sender);
}
-bool KGameNetwork::sendSystemMessage(const QString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{
- QByteArray buffer;
- QDataStream stream(buffer, IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer, IO_WriteOnly);
stream << msg;
return sendSystemMessage(buffer, msgid, receiver, sender);
}
-bool KGameNetwork::sendSystemMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
-{ return sendSystemMessage(((QBuffer*)msg.device())->buffer(), msgid, receiver, sender); }
+bool KGameNetwork::sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+{ return sendSystemMessage(((TQBuffer*)msg.device())->buffer(), msgid, receiver, sender); }
-bool KGameNetwork::sendSystemMessage(const QByteArray& data, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
if (!sender) {
sender = gameId();
}
@@ -438,19 +438,19 @@ bool KGameNetwork::sendSystemMessage(const QByteArray& data, int msgid, Q_UINT32
bool KGameNetwork::sendMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{ return sendSystemMessage(data,msgid+KGameMessage::IdUser,receiver,sender); }
-bool KGameNetwork::sendMessage(const QString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{ return sendSystemMessage(msg,msgid+KGameMessage::IdUser,receiver,sender); }
-bool KGameNetwork::sendMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{ return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); }
-bool KGameNetwork::sendMessage(const QByteArray &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendMessage(const TQByteArray &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
{ return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); }
-void KGameNetwork::sendError(int error,const QByteArray& message, Q_UINT32 receiver, Q_UINT32 sender)
+void KGameNetwork::sendError(int error,const TQByteArray& message, Q_UINT32 receiver, Q_UINT32 sender)
{
- QByteArray buffer;
- QDataStream stream(buffer,IO_WriteOnly);
+ TQByteArray buffer;
+ TQDataStream stream(buffer,IO_WriteOnly);
stream << (Q_INT32) error;
stream.writeRawBytes(message.data(), message.size());
sendSystemMessage(stream,KGameMessage::IdError,receiver,sender);
@@ -458,9 +458,9 @@ void KGameNetwork::sendError(int error,const QByteArray& message, Q_UINT32 recei
// ----------------- receive messages from the network
-void KGameNetwork::receiveNetworkTransmission(const QByteArray& receiveBuffer, Q_UINT32 clientID)
+void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, Q_UINT32 clientID)
{
- QDataStream stream(receiveBuffer, IO_ReadOnly);
+ TQDataStream stream(receiveBuffer, IO_ReadOnly);
int msgid;
Q_UINT32 sender; // the id of the KGame/KPlayer who sent the message
Q_UINT32 receiver; // the id of the KGame/KPlayer the message is for
@@ -480,7 +480,7 @@ void KGameNetwork::receiveNetworkTransmission(const QByteArray& receiveBuffer, Q
}
else if (msgid==KGameMessage::IdError)
{
- QString text;
+ TQString text;
Q_INT32 error;
stream >> error;
kdDebug(11001) << k_funcinfo << "Got IdError " << error << endl;
diff --git a/libkdegames/kgame/kgamenetwork.h b/libkdegames/kgame/kgamenetwork.h
index 6ff5cf94..47276d06 100644
--- a/libkdegames/kgame/kgamenetwork.h
+++ b/libkdegames/kgame/kgamenetwork.h
@@ -23,8 +23,8 @@
#ifndef __KGAMENETWORK_H_
#define __KGAMENETWORK_H_
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include <kdemacros.h>
class KGameIO;
class KMessageClient;
@@ -51,7 +51,7 @@ public:
/**
* Create a KGameNetwork object
*/
- KGameNetwork(int cookie=42,QObject* parent=0);
+ KGameNetwork(int cookie=42,TQObject* parent=0);
virtual ~KGameNetwork();
/**
@@ -120,7 +120,7 @@ public:
* set hostname will be used. In case of name conflict -2, -3 and so on will be added to name.
* @since 3.4
**/
- void setDiscoveryInfo(const QString& type, const QString& name=QString::null);
+ void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null);
/**
* Inits a network game as a network CLIENT
@@ -130,7 +130,7 @@ public:
*
* @return true if connected
**/
- bool connectToServer(const QString& host, Q_UINT16 port);
+ bool connectToServer(const TQString& host, Q_UINT16 port);
/**
* @since 3.2
@@ -146,7 +146,7 @@ public:
* isNetwork is TRUE and we are not the MASTER, i.e. if connectToServer
* was called. Otherwise this will return "localhost".
**/
- QString hostName() const;
+ TQString hostName() const;
/**
* Stops offering server connections - only for game MASTER
@@ -189,7 +189,7 @@ public:
* @return true if worked
*/
// AB: TODO: doc on how "receiver" and "sender" should be created!
- bool sendSystemMessage(const QByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendSystemMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
/**
* @overload
@@ -199,12 +199,12 @@ public:
/**
* @overload
**/
- bool sendSystemMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
/**
* @overload
**/
- bool sendSystemMessage(const QString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendSystemMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
/**
* Sends a network message
@@ -217,7 +217,7 @@ public:
* the correct value for you. You might want to use this if you send a
* message from a specific player.
**/
- void sendError(int error, const QByteArray& message, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ void sendError(int error, const TQByteArray& message, Q_UINT32 receiver=0, Q_UINT32 sender=0);
/**
* Are we still offer offering server connections - only for game MASTER
@@ -265,17 +265,17 @@ public:
* @return true if worked
**/
// AB: TODO: doc on how "receiver" and "sender" should be created!
- bool sendMessage(const QByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
/**
* This is an overloaded member function, provided for convenience.
**/
- bool sendMessage(const QDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
/**
* This is an overloaded member function, provided for convenience.
**/
- bool sendMessage(const QString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
/**
* This is an overloaded member function, provided for convenience.
@@ -287,7 +287,7 @@ public:
* Called by ReceiveNetworkTransmission(). Will be overwritten by
* KGame and handle the incoming message.
**/
- virtual void networkTransmission(QDataStream&, int, Q_UINT32, Q_UINT32, Q_UINT32 clientID) = 0;
+ virtual void networkTransmission(TQDataStream&, int, Q_UINT32, Q_UINT32, Q_UINT32 clientID) = 0;
/**
@@ -345,7 +345,7 @@ signals:
* @param error the error code
* @param text the error text
*/
- void signalNetworkErrorMessage(int error, QString text);
+ void signalNetworkErrorMessage(int error, TQString text);
/**
* Our connection to the KMessageServer has broken.
@@ -401,7 +401,7 @@ protected slots:
* If it is valid, the pure virtual method networkTransmission() is called.
* (This one is overwritten in KGame.)
**/
- void receiveNetworkTransmission(const QByteArray& a, Q_UINT32 clientID);
+ void receiveNetworkTransmission(const TQByteArray& a, Q_UINT32 clientID);
/**
* This KGame object receives or loses the admin status.
diff --git a/libkdegames/kgame/kgameprocess.cpp b/libkdegames/kgame/kgameprocess.cpp
index 96efe0ce..ffbf0936 100644
--- a/libkdegames/kgame/kgameprocess.cpp
+++ b/libkdegames/kgame/kgameprocess.cpp
@@ -29,9 +29,9 @@
#include <krandomsequence.h>
-#include <qbuffer.h>
-#include <qdatastream.h>
-#include <qcstring.h>
+#include <tqbuffer.h>
+#include <tqdatastream.h>
+#include <tqcstring.h>
#include <assert.h>
#include <stdio.h>
@@ -43,7 +43,7 @@
// ----------------------- Process Child ---------------------------
-KGameProcess::KGameProcess() : QObject(0,0)
+KGameProcess::KGameProcess() : TQObject(0,0)
{
mTerminate=false;
// Check whether a player is set. If not create one!
@@ -52,10 +52,10 @@ KGameProcess::KGameProcess() : QObject(0,0)
mMessageIO=new KMessageFilePipe(this,&rFile,&wFile);
// mMessageClient=new KMessageClient(this);
// mMessageClient->setServer(mMessageIO);
-// connect (mMessageClient, SIGNAL(broadcastReceived(const QByteArray&, Q_UINT32)),
-// this, SLOT(receivedMessage(const QByteArray&, Q_UINT32)));
- connect (mMessageIO, SIGNAL(received(const QByteArray&)),
- this, SLOT(receivedMessage(const QByteArray&)));
+// connect (mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)),
+// this, TQT_SLOT(receivedMessage(const TQByteArray&, Q_UINT32)));
+ connect (mMessageIO, TQT_SIGNAL(received(const TQByteArray&)),
+ this, TQT_SLOT(receivedMessage(const TQByteArray&)));
fprintf(stderr,"KGameProcess::constructor %p %p\n",&rFile,&wFile);
mRandom = new KRandomSequence;
@@ -85,17 +85,17 @@ bool KGameProcess::exec(int argc, char *argv[])
}
// You have to do this to create a message
-// QByteArray buffer;
-// QDataStream wstream(buffer,IO_WriteOnly);
+// TQByteArray buffer;
+// TQDataStream wstream(buffer,IO_WriteOnly);
// then stream data into the stream and call this function
-void KGameProcess::sendSystemMessage(QDataStream &stream,int msgid,Q_UINT32 receiver)
+void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver)
{
fprintf(stderr,"KGameProcess::sendMessage id=%d recv=%d",msgid,receiver);
- QByteArray a;
- QDataStream outstream(a,IO_WriteOnly);
+ TQByteArray a;
+ TQDataStream outstream(a,IO_WriteOnly);
- QBuffer *device=(QBuffer *)stream.device();
- QByteArray data=device->buffer();;
+ TQBuffer *device=(TQBuffer *)stream.device();
+ TQByteArray data=device->buffer();;
KGameMessage::createHeader(outstream,0,receiver,msgid);
outstream.writeRawBytes(data.data(),data.size());
@@ -107,7 +107,7 @@ void KGameProcess::sendSystemMessage(QDataStream &stream,int msgid,Q_UINT32 rece
if (mMessageIO) mMessageIO->send(a);
}
-void KGameProcess::sendMessage(QDataStream &stream,int msgid,Q_UINT32 receiver)
+void KGameProcess::sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver)
{
sendSystemMessage(stream,msgid+KGameMessage::IdUser,receiver);
}
@@ -129,9 +129,9 @@ void KGameProcess::processArgs(int argc, char *argv[])
fflush(stderr);
}
-void KGameProcess::receivedMessage(const QByteArray& receiveBuffer)
+void KGameProcess::receivedMessage(const TQByteArray& receiveBuffer)
{
- QDataStream stream(receiveBuffer, IO_ReadOnly);
+ TQDataStream stream(receiveBuffer, IO_ReadOnly);
int msgid;
Q_UINT32 sender;
Q_UINT32 receiver;
diff --git a/libkdegames/kgame/kgameprocess.h b/libkdegames/kgame/kgameprocess.h
index a8db4fcd..ac6389be 100644
--- a/libkdegames/kgame/kgameprocess.h
+++ b/libkdegames/kgame/kgameprocess.h
@@ -23,9 +23,9 @@
#ifndef __KGAMEPROCESS_H_
#define __KGAMEPROCESS_H_
-#include <qstring.h>
-#include <qobject.h>
-#include <qfile.h>
+#include <tqstring.h>
+#include <tqobject.h>
+#include <tqfile.h>
#include "kgameproperty.h"
#include <krandomsequence.h>
@@ -60,12 +60,12 @@ class KDE_EXPORT KGameProcess: public QObject
* int main(int argc ,char * argv[])
* {
* KGameProcess proc;
- * connect(&proc,SIGNAL(signalCommand(QDataStream &,int ,int ,int )),
- * this,SLOT(slotCommand(QDataStream & ,int ,int ,int )));
- * connect(&proc,SIGNAL(signalInit(QDataStream &,int)),
- * this,SLOT(slotInit(QDataStream & ,int )));
- * connect(&proc,SIGNAL(signalTurn(QDataStream &,bool )),
- * this,SLOT(slotTurn(QDataStream & ,bool )));
+ * connect(&proc,TQT_SIGNAL(signalCommand(TQDataStream &,int ,int ,int )),
+ * this,TQT_SLOT(slotCommand(TQDataStream & ,int ,int ,int )));
+ * connect(&proc,TQT_SIGNAL(signalInit(TQDataStream &,int)),
+ * this,TQT_SLOT(slotInit(TQDataStream & ,int )));
+ * connect(&proc,TQT_SIGNAL(signalTurn(TQDataStream &,bool )),
+ * this,TQT_SLOT(slotTurn(TQDataStream & ,bool )));
* return proc.exec(argc,argv);
* }
* \endcode
@@ -103,11 +103,11 @@ class KDE_EXPORT KGameProcess: public QObject
* device. Works like the sendSystemMessage but
* for user id's
*
- * @param stream the QDataStream containing the message
+ * @param stream the TQDataStream containing the message
* @param msgid the message id for the message
* @param receiver unused
*/
- void sendMessage(QDataStream &stream,int msgid,Q_UINT32 receiver=0);
+ void sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0);
/**
* Sends a system message to the corresonding KGameIO device.
@@ -117,18 +117,18 @@ class KDE_EXPORT KGameProcess: public QObject
* game relevant data from here.
* Exmaple for a query:
* \code
- * QByteArray buffer;
- * QDataStream out(buffer,IO_WriteOnly);
+ * TQByteArray buffer;
+ * TQDataStream out(buffer,IO_WriteOnly);
* int msgid=KGameMessage::IdProcessQuery;
* out << (int)1;
* proc.sendSystemMessage(out,msgid,0);
* \endcode
*
- * @param stream the QDataStream containing the message
+ * @param stream the TQDataStream containing the message
* @param msgid the message id for the message
* @param receiver unused
*/
- void sendSystemMessage(QDataStream &stream,int msgid,Q_UINT32 receiver=0);
+ void sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0);
/**
* Returns a pointer to a KRandomSequence. You can generate
@@ -153,7 +153,7 @@ class KDE_EXPORT KGameProcess: public QObject
* A message is received via the interprocess connection. The
* appropriate signals are called.
*/
- void receivedMessage(const QByteArray& receiveBuffer);
+ void receivedMessage(const TQByteArray& receiveBuffer);
signals:
/**
@@ -162,7 +162,7 @@ class KDE_EXPORT KGameProcess: public QObject
* All signals but IdIOAdded and IdTurn end up here!
* Example:
* \code
- * void Computer::slotCommand(int &msgid,QDataStream &in,QDataStream &out)
+ * void Computer::slotCommand(int &msgid,TQDataStream &in,TQDataStream &out)
* {
* Q_INT32 data,move;
* in >> data;
@@ -177,7 +177,7 @@ class KDE_EXPORT KGameProcess: public QObject
* @param receiver the id of the receiver
* @param sender the id of the sender
*/
- void signalCommand(QDataStream &inputStream,int msgid,int receiver,int sender);
+ void signalCommand(TQDataStream &inputStream,int msgid,int receiver,int sender);
/**
* This signal is emmited if the computer player should perform a turn.
@@ -190,12 +190,12 @@ class KDE_EXPORT KGameProcess: public QObject
* stream here.
* Example:
* \code
- * void slotTurn(QDataStream &in,bool turn)
+ * void slotTurn(TQDataStream &in,bool turn)
* {
* int id;
* int recv;
- * QByteArray buffer;
- * QDataStream out(buffer,IO_WriteOnly);
+ * TQByteArray buffer;
+ * TQDataStream out(buffer,IO_WriteOnly);
* if (turn)
* {
* // Create a move - the format is yours to decide
@@ -216,7 +216,7 @@ class KDE_EXPORT KGameProcess: public QObject
* @param turn True or false whether the turn is activated or deactivated
*
*/
- void signalTurn(QDataStream &stream,bool turn);
+ void signalTurn(TQDataStream &stream,bool turn);
/**
* This signal is emmited when the process is initialized, i.e. added
@@ -229,14 +229,14 @@ class KDE_EXPORT KGameProcess: public QObject
* @param stream The datastream which contains user data
* @param userid The userId of the player. (Careful to rely on it yet)
*/
- void signalInit(QDataStream &stream,int userid);
+ void signalInit(TQDataStream &stream,int userid);
protected:
bool mTerminate;
KMessageFilePipe *mMessageIO;
private:
- QFile rFile;
- QFile wFile;
+ TQFile rFile;
+ TQFile wFile;
KRandomSequence* mRandom;
};
#endif
diff --git a/libkdegames/kgame/kgameproperty.cpp b/libkdegames/kgame/kgameproperty.cpp
index 68a33bcb..3b8c3109 100644
--- a/libkdegames/kgame/kgameproperty.cpp
+++ b/libkdegames/kgame/kgameproperty.cpp
@@ -76,19 +76,19 @@ void KGamePropertyBase::init()
setPolicy(PolicyLocal);
}
-int KGamePropertyBase::registerData(int id, KGame* owner, QString name)
+int KGamePropertyBase::registerData(int id, KGame* owner, TQString name)
{ return registerData(id, owner->dataHandler(), name); }
-int KGamePropertyBase::registerData(int id, KPlayer* owner, QString name)
+int KGamePropertyBase::registerData(int id, KPlayer* owner, TQString name)
{ return registerData(id, owner->dataHandler(), name); }
-int KGamePropertyBase::registerData( KGamePropertyHandler* owner,PropertyPolicy p, QString name)
+int KGamePropertyBase::registerData( KGamePropertyHandler* owner,PropertyPolicy p, TQString name)
{ return registerData(-1, owner,p, name); }
-int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner, QString name)
+int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner, TQString name)
{ return registerData(id, owner,PolicyUndefined, name); }
-int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, QString name)
+int KGamePropertyBase::registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, TQString name)
{
// we don't support changing the id
if (!owner) {
@@ -123,8 +123,8 @@ void KGamePropertyBase::unregisterData()
bool KGamePropertyBase::sendProperty()
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyHeader(s, id());
save(s);
if (mOwner) {
@@ -135,10 +135,10 @@ bool KGamePropertyBase::sendProperty()
}
}
-bool KGamePropertyBase::sendProperty(const QByteArray& data)
+bool KGamePropertyBase::sendProperty(const TQByteArray& data)
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyHeader(s, id());
s.writeRawBytes(data.data(), data.size());
if (mOwner) {
@@ -169,8 +169,8 @@ bool KGamePropertyBase::unlock(bool force)
void KGamePropertyBase::setLock(bool l)
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s, IdCommand, id(), CmdLock);
s << (Q_INT8)l;
@@ -192,7 +192,7 @@ void KGamePropertyBase::emitSignal()
}
}
-void KGamePropertyBase::command(QDataStream& s, int cmd, bool isSender)
+void KGamePropertyBase::command(TQDataStream& s, int cmd, bool isSender)
{
switch (cmd) {
case CmdLock:
diff --git a/libkdegames/kgame/kgameproperty.h b/libkdegames/kgame/kgameproperty.h
index c6915606..04474603 100644
--- a/libkdegames/kgame/kgameproperty.h
+++ b/libkdegames/kgame/kgameproperty.h
@@ -21,7 +21,7 @@
#ifndef __KGAMEPROPERTY_H_
#define __KGAMEPROPERTY_H_
-#include <qdatastream.h>
+#include <tqdatastream.h>
#include <kdebug.h>
#include <typeinfo>
@@ -151,7 +151,7 @@ public:
/**
* Sets this property to emit a signal on value changed.
- * As the proerties do not inehrit QObject for optimisation
+ * As the proerties do not inehrit TQObject for optimisation
* this signal is emited via the KPlayer or KGame object
**/
void setEmittingSignal(bool p) { mFlags.bits.emitsignal=p; }
@@ -217,12 +217,12 @@ public:
* overwrite this method in order to use this class
* @param s The stream to read from
**/
- virtual void load(QDataStream& s) = 0;
+ virtual void load(TQDataStream& s) = 0;
/**
* Write the value into a stream. MUST be overwritten
**/
- virtual void save(QDataStream& s) = 0;
+ virtual void save(TQDataStream& s) = 0;
/**
* send a command to advanced properties like arrays
@@ -230,7 +230,7 @@ public:
* @param msgid The ID of the command - see PropertyCommandIds
* @param isSender whether this client is also the sender of the command
**/
- virtual void command(QDataStream &stream, int msgid, bool isSender=false);
+ virtual void command(TQDataStream &stream, int msgid, bool isSender=false);
/**
* @return The id of this property
@@ -261,25 +261,25 @@ public:
* @param name if not 0 you can assign a name to this property
*
**/
- int registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, QString name=0);
+ int registerData(int id, KGamePropertyHandler* owner,PropertyPolicy p, TQString name=0);
/**
* This is an overloaded member function, provided for convenience.
* It differs from the above function only in what argument(s) it accepts.
**/
- int registerData(int id, KGamePropertyHandler* owner, QString name=0);
+ int registerData(int id, KGamePropertyHandler* owner, TQString name=0);
/**
* This is an overloaded member function, provided for convenience.
* It differs from the above function only in what argument(s) it accepts.
**/
- int registerData(int id, KGame* owner, QString name=0);
+ int registerData(int id, KGame* owner, TQString name=0);
/**
* This is an overloaded member function, provided for convenience.
* It differs from the above function only in what argument(s) it accepts.
**/
- int registerData(int id, KPlayer* owner, QString name=0);
+ int registerData(int id, KPlayer* owner, TQString name=0);
/**
* This is an overloaded member function, provided for convenience.
@@ -287,7 +287,7 @@ public:
* In particular you can use this function to create properties which
* will have an automatic id assigned. The new id is returned.
**/
- int registerData(KGamePropertyHandler* owner,PropertyPolicy p=PolicyUndefined, QString name=0);
+ int registerData(KGamePropertyHandler* owner,PropertyPolicy p=PolicyUndefined, TQString name=0);
void unregisterData();
@@ -341,7 +341,7 @@ protected:
* @return TRUE if the message could be sent successfully, otherwise
* FALSE
**/
- bool sendProperty(const QByteArray& b);
+ bool sendProperty(const TQByteArray& b);
/**
* Causes the parent object to emit a signal on value change
@@ -420,7 +420,7 @@ private:
* queues the message. As soon as <em>all</em> messages in the message server
* which are before the changed property have been transferred the message
* server delivers the new value of the KGameProperty to all clients. A
- * QTimer::singleShot is used to queue the messages inside the
+ * TQTimer::singleShot is used to queue the messages inside the
* KMessageServer.
*
* This means that if you do the following:
@@ -433,7 +433,7 @@ private:
* then "value" will be "0". initData is used to initialize the property
* (e.g. when the KMessageServer is not yet running or can not yet be
* reached). This is because "myProperty = 10" or "myProperty.send(10)" send a
- * message to the KMessageServer which uses QTimer::singleShot to
+ * message to the KMessageServer which uses TQTimer::singleShot to
* queue the message. The game first has to go back into the event loop where
* the message is received. The KGamePropertyHandler receives the new value
* sets the property. So if you need the new value you need to store it in a
@@ -536,7 +536,7 @@ private:
* @section Custom classes:
*
* If you want to use a custum class with KGameProperty you have to implement the
- * operators << and >> for QDataStream:
+ * operators << and >> for TQDataStream:
* \code
* class Card
* {
@@ -544,7 +544,7 @@ private:
* int type;
* int suite;
* };
- * QDataStream& operator<<(QDataStream& stream, Card& card)
+ * TQDataStream& operator<<(TQDataStream& stream, Card& card)
* {
* Q_INT16 type = card.type;
* Q_INT16 suite = card.suite;
@@ -552,7 +552,7 @@ private:
* s << suite;
* return s;
* }
- * QDataStream& operator>>(QDataStream& stream, Card& card)
+ * TQDataStream& operator>>(TQDataStream& stream, Card& card)
* {
* Q_INT16 type;
* Q_INT16 suite;
@@ -635,7 +635,7 @@ public:
* This function sends a new value over network.
*
* Note that the value DOES NOT change when you call this function. This
- * function saves the value into a QDataStream and calls
+ * function saves the value into a TQDataStream and calls
* sendProperty where it gets forwarded to the owner and finally the
* value is sent over network. The KMessageServer now sends the
* value to ALL clients - even the one who called this function. As soon
@@ -675,8 +675,8 @@ public:
if (isLocked()) {
return false;
}
- QByteArray b;
- QDataStream stream(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream stream(b, IO_WriteOnly);
stream << v;
if (!sendProperty(b)) {
setLocal(v);
@@ -751,7 +751,7 @@ public:
* Saves the object to a stream.
* @param stream The stream to save to
**/
- virtual void save(QDataStream &stream)
+ virtual void save(TQDataStream &stream)
{
stream << mData;
}
@@ -777,7 +777,7 @@ public:
* Also calls emitSignal if isEmittingSignal is TRUE.
* @param s The stream to read from
**/
- virtual void load(QDataStream& s)
+ virtual void load(TQDataStream& s)
{
s >> mData;
setDirty(false);
@@ -842,7 +842,7 @@ private:
typedef KGameProperty<int> KGamePropertyInt;
typedef KGameProperty<unsigned int> KGamePropertyUInt;
-typedef KGameProperty<QString> KGamePropertyQString;
+typedef KGameProperty<TQString> KGamePropertyQString;
typedef KGameProperty<Q_INT8> KGamePropertyBool;
#endif
diff --git a/libkdegames/kgame/kgamepropertyarray.h b/libkdegames/kgame/kgamepropertyarray.h
index f91bd75c..0bb1d1a1 100644
--- a/libkdegames/kgame/kgamepropertyarray.h
+++ b/libkdegames/kgame/kgamepropertyarray.h
@@ -21,7 +21,7 @@
#ifndef __KGAMEPROPERTYARRAY_H_
#define __KGAMEPROPERTYARRAY_H_
-#include <qdatastream.h>
+#include <tqdatastream.h>
#include <kdebug.h>
#include "kgamemessage.h"
@@ -30,10 +30,10 @@
template<class type>
-class KGamePropertyArray : public QMemArray<type>, public KGamePropertyBase
+class KGamePropertyArray : public TQMemArray<type>, public KGamePropertyBase
{
public:
- KGamePropertyArray() :QMemArray<type>(), KGamePropertyBase()
+ KGamePropertyArray() :TQMemArray<type>(), KGamePropertyBase()
{
//kdDebug(11001) << "KGamePropertyArray init" << endl;
}
@@ -43,17 +43,17 @@ public:
resize(size);
}
- KGamePropertyArray( const KGamePropertyArray<type> &a ) : QMemArray<type>(a)
+ KGamePropertyArray( const KGamePropertyArray<type> &a ) : TQMemArray<type>(a)
{
}
bool resize( uint size )
{
- if (size!=QMemArray<type>::size())
+ if (size!=TQMemArray<type>::size())
{
bool a=true;
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdResize);
s << size ;
if (policy()==PolicyClean || policy()==PolicyDirty)
@@ -66,7 +66,7 @@ public:
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
extractProperty(b);
-// a=QMemArray<type>::resize(size);// FIXME: return value!
+// a=TQMemArray<type>::resize(size);// FIXME: return value!
}
return a;
}
@@ -75,8 +75,8 @@ public:
void setAt(uint i,type data)
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdAt);
s << i ;
s << data;
@@ -96,12 +96,12 @@ public:
type at( uint i ) const
{
- return QMemArray<type>::at(i);
+ return TQMemArray<type>::at(i);
}
type operator[]( int i ) const
{
- return QMemArray<type>::at(i);
+ return TQMemArray<type>::at(i);
}
KGamePropertyArray<type> &operator=(const KGamePropertyArray<type> &a)
@@ -117,8 +117,8 @@ public:
bool fill( const type &data, int size = -1 )
{
bool r=true;
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdFill);
s << data;
s << size ;
@@ -132,7 +132,7 @@ public:
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
extractProperty(b);
-// r=QMemArray<type>::fill(data,size);//FIXME: return value!
+// r=TQMemArray<type>::fill(data,size);//FIXME: return value!
}
return r;
}
@@ -146,7 +146,7 @@ public:
}
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
- QMemArray<type>::assign(a);
+ TQMemArray<type>::assign(a);
}
return *this;
}
@@ -158,7 +158,7 @@ public:
}
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
- QMemArray<type>::assign(a,n);
+ TQMemArray<type>::assign(a,n);
}
return *this;
}
@@ -170,7 +170,7 @@ public:
}
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
- QMemArray<type>::duplicate(a);
+ TQMemArray<type>::duplicate(a);
}
return *this;
}
@@ -182,7 +182,7 @@ public:
}
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
- QMemArray<type>::duplicate(a,n);
+ TQMemArray<type>::duplicate(a,n);
}
return *this;
}
@@ -194,14 +194,14 @@ public:
}
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
- QMemArray<type>::setRawData(a,n);
+ TQMemArray<type>::setRawData(a,n);
}
return *this;
}
void sort()
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdSort);
if (policy()==PolicyLocal || policy()==PolicyDirty)
{
@@ -216,30 +216,30 @@ public:
}
}
- void load(QDataStream& s)
+ void load(TQDataStream& s)
{
//kdDebug(11001) << "KGamePropertyArray load " << id() << endl;
type data;
- for (unsigned int i=0; i<QMemArray<type>::size(); i++)
+ for (unsigned int i=0; i<TQMemArray<type>::size(); i++)
{
s >> data;
- QMemArray<type>::at(i)=data;
+ TQMemArray<type>::at(i)=data;
}
if (isEmittingSignal())
{
emitSignal();
}
}
- void save(QDataStream &s)
+ void save(TQDataStream &s)
{
//kdDebug(11001) << "KGamePropertyArray save "<<id() << endl;
- for (unsigned int i=0; i<QMemArray<type>::size(); i++)
+ for (unsigned int i=0; i<TQMemArray<type>::size(); i++)
{
s << at(i);
}
}
- void command(QDataStream &s,int cmd,bool)
+ void command(TQDataStream &s,int cmd,bool)
{
KGamePropertyBase::command(s, cmd);
//kdDebug(11001) << "Array id="<<id()<<" got command ("<<cmd<<") !!!" <<endl;
@@ -250,7 +250,7 @@ public:
uint i;
type data;
s >> i >> data;
- QMemArray<type>::at(i)=data;
+ TQMemArray<type>::at(i)=data;
//kdDebug(11001) << "CmdAt:id="<<id()<<" i="<<i<<" data="<<data <<endl;
if (isEmittingSignal())
{
@@ -262,10 +262,10 @@ public:
{
uint size;
s >> size;
- //kdDebug(11001) << "CmdResize:id="<<id()<<" oldsize="<<QMemArray<type>::size()<<" newsize="<<size <<endl;
- if (QMemArray<type>::size() != size)
+ //kdDebug(11001) << "CmdResize:id="<<id()<<" oldsize="<<TQMemArray<type>::size()<<" newsize="<<size <<endl;
+ if (TQMemArray<type>::size() != size)
{
- QMemArray<type>::resize(size);
+ TQMemArray<type>::resize(size);
}
break;
}
@@ -275,7 +275,7 @@ public:
type data;
s >> data >> size;
//kdDebug(11001) << "CmdFill:id="<<id()<<"size="<<size <<endl;
- QMemArray<type>::fill(data,size);
+ TQMemArray<type>::fill(data,size);
if (isEmittingSignal())
{
emitSignal();
@@ -285,7 +285,7 @@ public:
case CmdSort:
{
//kdDebug(11001) << "CmdSort:id="<<id()<<endl;
- QMemArray<type>::sort();
+ TQMemArray<type>::sort();
break;
}
default:
@@ -294,9 +294,9 @@ public:
}
}
protected:
- void extractProperty(const QByteArray& b)
+ void extractProperty(const TQByteArray& b)
{
- QDataStream s(b, IO_ReadOnly);
+ TQDataStream s(b, IO_ReadOnly);
int cmd;
int propId;
KGameMessage::extractPropertyHeader(s, propId);
diff --git a/libkdegames/kgame/kgamepropertyhandler.cpp b/libkdegames/kgame/kgamepropertyhandler.cpp
index 75b3e7e2..f395fc66 100644
--- a/libkdegames/kgame/kgamepropertyhandler.cpp
+++ b/libkdegames/kgame/kgamepropertyhandler.cpp
@@ -25,8 +25,8 @@
#include "kgameproperty.h"
#include "kgamemessage.h"
-#include <qmap.h>
-#include <qptrqueue.h>
+#include <tqmap.h>
+#include <tqptrqueue.h>
#include <klocale.h>
#include <typeinfo>
@@ -41,23 +41,23 @@ public:
{
}
- QMap<int, QString> mNameMap;
- QIntDict<KGamePropertyBase> mIdDict;
+ TQMap<int, TQString> mNameMap;
+ TQIntDict<KGamePropertyBase> mIdDict;
int mUniqueId;
int mId;
KGamePropertyBase::PropertyPolicy mDefaultPolicy;
bool mDefaultUserspace;
int mIndirectEmit;
- QPtrQueue<KGamePropertyBase> mSignalQueue;
+ TQPtrQueue<KGamePropertyBase> mSignalQueue;
};
-KGamePropertyHandler::KGamePropertyHandler(int id, const QObject* receiver, const char * sendf, const char *emitf, QObject* parent) : QObject(parent)
+KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* parent) : TQObject(parent)
{
init();
registerHandler(id,receiver,sendf,emitf);
}
-KGamePropertyHandler::KGamePropertyHandler(QObject* parent) : QObject(parent)
+KGamePropertyHandler::KGamePropertyHandler(TQObject* parent) : TQObject(parent)
{
init();
}
@@ -90,20 +90,20 @@ void KGamePropertyHandler::setId(int id)
d->mId = id;
}
-void KGamePropertyHandler::registerHandler(int id,const QObject * receiver, const char * sendf, const char *emitf)
+void KGamePropertyHandler::registerHandler(int id,const TQObject * receiver, const char * sendf, const char *emitf)
{
setId(id);
if (receiver && sendf) {
- kdDebug(11001) << "Connecting SLOT " << sendf << endl;
- connect(this, SIGNAL(signalSendMessage(int, QDataStream &, bool*)), receiver, sendf);
+ kdDebug(11001) << "Connecting TQT_SLOT " << sendf << endl;
+ connect(this, TQT_SIGNAL(signalSendMessage(int, TQDataStream &, bool*)), receiver, sendf);
}
if (receiver && emitf) {
- kdDebug(11001) << "Connecting SLOT " << emitf << endl;
- connect(this, SIGNAL(signalPropertyChanged(KGamePropertyBase *)), receiver, emitf);
+ kdDebug(11001) << "Connecting TQT_SLOT " << emitf << endl;
+ connect(this, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *)), receiver, emitf);
}
}
-bool KGamePropertyHandler::processMessage(QDataStream &stream, int id, bool isSender)
+bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isSender)
{
// kdDebug(11001) << k_funcinfo << ": id=" << id << " mId=" << d->mId << endl;
if (id != d->mId) {
@@ -148,7 +148,7 @@ bool KGamePropertyHandler::removeProperty(KGamePropertyBase* data)
return d->mIdDict.remove(data->id());
}
-bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, QString name)
+bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name)
{
//kdDebug(11001) << k_funcinfo << ": " << data->id() << endl;
if (d->mIdDict.find(data->id())) {
@@ -169,9 +169,9 @@ bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, QString name)
return true;
}
-QString KGamePropertyHandler::propertyName(int id) const
+TQString KGamePropertyHandler::propertyName(int id) const
{
- QString s;
+ TQString s;
if (d->mIdDict.find(id)) {
if (d->mNameMap.contains(id)) {
s = i18n("%1 (%2)").arg(d->mNameMap[id]).arg(id);
@@ -185,7 +185,7 @@ QString KGamePropertyHandler::propertyName(int id) const
return s;
}
-bool KGamePropertyHandler::load(QDataStream &stream)
+bool KGamePropertyHandler::load(TQDataStream &stream)
{
// Prevent direct emmiting until all is loaded
lockDirectEmit();
@@ -207,11 +207,11 @@ bool KGamePropertyHandler::load(QDataStream &stream)
return true;
}
-bool KGamePropertyHandler::save(QDataStream &stream)
+bool KGamePropertyHandler::save(TQDataStream &stream)
{
kdDebug(11001) << k_funcinfo << ": " << d->mIdDict.count() << " KGameProperty objects " << endl;
stream << (uint)d->mIdDict.count();
- QIntDictIterator<KGamePropertyBase> it(d->mIdDict);
+ TQIntDictIterator<KGamePropertyBase> it(d->mIdDict);
while (it.current()) {
KGamePropertyBase *base=it.current();
if (base) {
@@ -234,7 +234,7 @@ void KGamePropertyHandler::setPolicy(KGamePropertyBase::PropertyPolicy p,bool us
// kdDebug(11001) << k_funcinfo << ": " << p << endl;
d->mDefaultPolicy=p;
d->mDefaultUserspace=userspace;
- QIntDictIterator<KGamePropertyBase> it(d->mIdDict);
+ TQIntDictIterator<KGamePropertyBase> it(d->mIdDict);
while (it.current()) {
if (!userspace || it.current()->id()>=KGamePropertyBase::IdUser) {
it.current()->setPolicy((KGamePropertyBase::PropertyPolicy)p);
@@ -245,7 +245,7 @@ void KGamePropertyHandler::setPolicy(KGamePropertyBase::PropertyPolicy p,bool us
void KGamePropertyHandler::unlockProperties()
{
- QIntDictIterator<KGamePropertyBase> it(d->mIdDict);
+ TQIntDictIterator<KGamePropertyBase> it(d->mIdDict);
while (it.current()) {
it.current()->unlock();
++it;
@@ -254,7 +254,7 @@ void KGamePropertyHandler::unlockProperties()
void KGamePropertyHandler::lockProperties()
{
- QIntDictIterator<KGamePropertyBase> it(d->mIdDict);
+ TQIntDictIterator<KGamePropertyBase> it(d->mIdDict);
while (it.current()) {
it.current()->lock();
++it;
@@ -268,7 +268,7 @@ int KGamePropertyHandler::uniquePropertyId()
void KGamePropertyHandler::flush()
{
- QIntDictIterator<KGamePropertyBase> it(d->mIdDict);
+ TQIntDictIterator<KGamePropertyBase> it(d->mIdDict);
while (it.current()) {
if (it.current()->isDirty()) {
it.current()->sendProperty();
@@ -319,7 +319,7 @@ void KGamePropertyHandler::emitSignal(KGamePropertyBase *prop)
}
}
-bool KGamePropertyHandler::sendProperty(QDataStream &s)
+bool KGamePropertyHandler::sendProperty(TQDataStream &s)
{
bool sent = false;
emit signalSendMessage(id(), s, &sent);
@@ -334,7 +334,7 @@ KGamePropertyBase *KGamePropertyHandler::find(int id)
void KGamePropertyHandler::clear()
{
kdDebug(11001) << k_funcinfo << id() << endl;
- QIntDictIterator<KGamePropertyBase> it(d->mIdDict);
+ TQIntDictIterator<KGamePropertyBase> it(d->mIdDict);
while (it.toFirst()) {
KGamePropertyBase* p = it.toFirst();
p->unregisterData();
@@ -346,31 +346,31 @@ void KGamePropertyHandler::clear()
}
}
-QIntDict<KGamePropertyBase>& KGamePropertyHandler::dict() const
+TQIntDict<KGamePropertyBase>& KGamePropertyHandler::dict() const
{
return d->mIdDict;
}
-QString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop)
+TQString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop)
{
if (!prop) {
return i18n("NULL pointer");
}
int id = prop->id();
- QString name = propertyName(id);
- QString value;
+ TQString name = propertyName(id);
+ TQString value;
const type_info* t = prop->typeinfo();
if (*t == typeid(int)) {
- value = QString::number(((KGamePropertyInt*)prop)->value());
+ value = TQString::number(((KGamePropertyInt*)prop)->value());
} else if (*t == typeid(unsigned int)) {
- value = QString::number(((KGamePropertyUInt *)prop)->value());
+ value = TQString::number(((KGamePropertyUInt *)prop)->value());
} else if (*t == typeid(long int)) {
- value = QString::number(((KGameProperty<long int> *)prop)->value());
+ value = TQString::number(((KGameProperty<long int> *)prop)->value());
} else if (*t == typeid(unsigned long int)) {
- value = QString::number(((KGameProperty<unsigned long int> *)prop)->value());
- } else if (*t == typeid(QString)) {
+ value = TQString::number(((KGameProperty<unsigned long int> *)prop)->value());
+ } else if (*t == typeid(TQString)) {
value = ((KGamePropertyQString*)prop)->value();
} else if (*t == typeid(Q_INT8)) {
value = ((KGamePropertyBool*)prop)->value() ? i18n("True") : i18n("False");
@@ -390,7 +390,7 @@ void KGamePropertyHandler::Debug()
kdDebug(11001) << "KGamePropertyHandler:: Debug this=" << this << endl;
kdDebug(11001) << " Registered properties: (Policy,Lock,Emit,Optimized, Dirty)" << endl;
- QIntDictIterator<KGamePropertyBase> it(d->mIdDict);
+ TQIntDictIterator<KGamePropertyBase> it(d->mIdDict);
while (it.current()) {
KGamePropertyBase *p=it.current();
kdDebug(11001) << " "<< p->id() << ": p=" << p->policy()
diff --git a/libkdegames/kgame/kgamepropertyhandler.h b/libkdegames/kgame/kgamepropertyhandler.h
index 6147c071..ec7fec06 100644
--- a/libkdegames/kgame/kgamepropertyhandler.h
+++ b/libkdegames/kgame/kgamepropertyhandler.h
@@ -21,8 +21,8 @@
#ifndef __KGAMEPROPERTYHANDLER_H_
#define __KGAMEPROPERTYHANDLER_H_
-#include <qobject.h>
-#include <qintdict.h>
+#include <tqobject.h>
+#include <tqintdict.h>
#include "kgameproperty.h"
#include <kdemacros.h>
@@ -63,7 +63,7 @@ class KGamePropertyHandlerPrivate; // wow - what a name ;-)
*
* A KGamePropertyHandler is also used - indirectly using emitSignal - to
* emit a signal when the value of a property changes. This is done this way
- * because a KGameProperty does not inherit QObject because of memory
+ * because a KGameProperty does not inherit TQObject because of memory
* advantages. Many games can have dozens or even hundreds of KGameProperty
* objects so every additional variable in KGameProperty would be
* multiplied.
@@ -80,14 +80,14 @@ public:
* You have to call registerHandler before you can use this
* handler!
**/
- KGamePropertyHandler(QObject* parent = 0);
+ KGamePropertyHandler(TQObject* parent = 0);
/**
* Construct a registered handler.
*
* @see registerHandler
**/
- KGamePropertyHandler(int id, const QObject* receiver, const char* sendf, const char* emitf, QObject* parent = 0);
+ KGamePropertyHandler(int id, const TQObject* receiver, const char* sendf, const char* emitf, TQObject* parent = 0);
~KGamePropertyHandler();
/**
@@ -101,7 +101,7 @@ public:
* @param send A slot that is being connected to signalSendMessage
* @param emit A slot that is being connected to signalPropertyChanged
**/
- void registerHandler(int id, const QObject *receiver, const char * send, const char *emit);
+ void registerHandler(int id, const TQObject *receiver, const char * send, const char *emit);
/**
* Main message process function. This has to be called by
@@ -118,7 +118,7 @@ public:
* @param isSender Whether the receiver is also the sender
* @return true on message processed otherwise false
**/
- bool processMessage(QDataStream &stream, int id, bool isSender );
+ bool processMessage(TQDataStream &stream, int id, bool isSender );
/**
* @return the id of the handler
@@ -132,7 +132,7 @@ public:
* propertyName. This is used for debugging, e.g. in KGameDebugDialog
* @return true on success
**/
- bool addProperty(KGamePropertyBase *data, QString name=0);
+ bool addProperty(KGamePropertyBase *data, TQString name=0);
/**
* Removes a property from the handler
@@ -156,7 +156,7 @@ public:
* @param stream the datastream to load from
* @return true on success otherwise false
**/
- virtual bool load(QDataStream &stream);
+ virtual bool load(TQDataStream &stream);
/**
* Saves properties into the datastream
@@ -164,14 +164,14 @@ public:
* @param stream the datastream to save to
* @return true on success otherwise false
**/
- virtual bool save(QDataStream &stream);
+ virtual bool save(TQDataStream &stream);
/**
* called by a property to send itself into the
* datastream. This call is simply forwarded to
* the parent object
**/
- bool sendProperty(QDataStream &s);
+ bool sendProperty(TQDataStream &s);
void sendLocked(bool l);
@@ -188,7 +188,7 @@ public:
* depend on this function! It it possible not to provide a name or to
* provide the same name for multiple properties!
**/
- QString propertyName(int id) const;
+ TQString propertyName(int id) const;
/**
* @param id The ID of the property. See KGamePropertyBase::id
@@ -277,13 +277,13 @@ public:
/**
* Reference to the internal dictionary
**/
- QIntDict<KGamePropertyBase> &dict() const;
+ TQIntDict<KGamePropertyBase> &dict() const;
/**
- * In several situations you just want to have a QString of a
+ * In several situations you just want to have a TQString of a
* KGameProperty object. This is the case in the
* KGameDebugDialog where the value of all properties is displayed. This
- * function will provide you with such a QString for all the types
+ * function will provide you with such a TQString for all the types
* used inside of all KGame classes. If you have a non-standard
* property (probably a self defined class or something like this) you
* also need to connect to signalRequestValue to make this function
@@ -291,7 +291,7 @@ public:
* @param property Return the value of this KGameProperty
* @return The value of a KGameProperty
**/
- QString propertyValue(KGamePropertyBase* property);
+ TQString propertyValue(KGamePropertyBase* property);
/**
@@ -320,20 +320,20 @@ signals:
* @param sent set this to true if the property was sent successfully -
* otherwise don't touch
**/
- void signalSendMessage(int msgid, QDataStream &, bool* sent); // AB shall we change bool* into bool& again?
+ void signalSendMessage(int msgid, TQDataStream &, bool* sent); // AB shall we change bool* into bool& again?
/**
* If you call propertyValue with a non-standard KGameProperty
* it is possible that the value cannot automatically be converted into a
- * QString. Then this signal is emitted and asks you to provide the
+ * TQString. Then this signal is emitted and asks you to provide the
* correct value. You probably want to use something like this to achieve
* this:
* \code
* #include <typeinfo>
- * void slotRequestValue(KGamePropertyBase* p, QString& value)
+ * void slotRequestValue(KGamePropertyBase* p, TQString& value)
* {
* if (*(p->typeinfo()) == typeid(MyType) {
- * value = QString(((KGameProperty<MyType>*)p)->value());
+ * value = TQString(((KGameProperty<MyType>*)p)->value());
* }
* }
* \endcode
@@ -341,7 +341,7 @@ signals:
* @param property The KGamePropertyBase the value is requested for
* @param value The value of this property. You have to set this.
**/
- void signalRequestValue(KGamePropertyBase* property, QString& value);
+ void signalRequestValue(KGamePropertyBase* property, TQString& value);
private:
void init();
diff --git a/libkdegames/kgame/kgamepropertylist.h b/libkdegames/kgame/kgamepropertylist.h
index 3a304e70..df8eb604 100644
--- a/libkdegames/kgame/kgamepropertylist.h
+++ b/libkdegames/kgame/kgamepropertylist.h
@@ -21,7 +21,7 @@
#ifndef __KGAMEPROPERTYLIST_H_
#define __KGAMEPROPERTYLIST_H_
-#include <qvaluelist.h>
+#include <tqvaluelist.h>
#include <kdebug.h>
@@ -32,20 +32,20 @@
// AB: also see README.LIB!
template<class type>
-class KGamePropertyList : public QValueList<type>, public KGamePropertyBase
+class KGamePropertyList : public TQValueList<type>, public KGamePropertyBase
{
public:
/**
* Typedefs
*/
- typedef QValueListIterator<type> Iterator;
- typedef QValueListConstIterator<type> ConstIterator;
+ typedef TQValueListIterator<type> Iterator;
+ typedef TQValueListConstIterator<type> ConstIterator;
- KGamePropertyList() :QValueList<type>(), KGamePropertyBase()
+ KGamePropertyList() :TQValueList<type>(), KGamePropertyBase()
{
}
- KGamePropertyList( const KGamePropertyList<type> &a ) : QValueList<type>(a)
+ KGamePropertyList( const KGamePropertyList<type> &a ) : TQValueList<type>(a)
{
}
@@ -66,10 +66,10 @@ public:
Iterator insert( Iterator it, const type& d )
{
- it=QValueList<type>::insert(it,d);
+ it=TQValueList<type>::insert(it,d);
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdInsert);
int i=findIterator(it);
s << i;
@@ -92,8 +92,8 @@ public:
void append( const type& d )
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdAppend);
s << d;
if (policy() == PolicyClean || policy() == PolicyDirty)
@@ -111,8 +111,8 @@ public:
Iterator erase( Iterator it )
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdRemove);
int i=findIterator(it);
s << i;
@@ -128,7 +128,7 @@ public:
extractProperty(b);
}
//TODO: return value - is it correct for PolicyLocal|PolicyDirty?
-// return QValueList<type>::remove(it);
+// return TQValueList<type>::remove(it);
return it;
}
@@ -145,8 +145,8 @@ public:
void clear()
{
- QByteArray b;
- QDataStream s(b, IO_WriteOnly);
+ TQByteArray b;
+ TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdClear);
if (policy() == PolicyClean || policy() == PolicyDirty)
{
@@ -161,10 +161,10 @@ public:
}
}
- void load(QDataStream& s)
+ void load(TQDataStream& s)
{
kdDebug(11001) << "KGamePropertyList load " << id() << endl;
- QValueList<type>::clear();
+ TQValueList<type>::clear();
uint size;
type data;
s >> size;
@@ -172,12 +172,12 @@ public:
for (unsigned int i=0;i<size;i++)
{
s >> data;
- QValueList<type>::append(data);
+ TQValueList<type>::append(data);
}
if (isEmittingSignal()) emitSignal();
}
- void save(QDataStream &s)
+ void save(TQDataStream &s)
{
kdDebug(11001) << "KGamePropertyList save "<<id() << endl;
type data;
@@ -191,7 +191,7 @@ public:
}
}
- void command(QDataStream &s,int cmd,bool)
+ void command(TQDataStream &s,int cmd,bool)
{
KGamePropertyBase::command(s, cmd);
kdDebug(11001) << "---> LIST id="<<id()<<" got command ("<<cmd<<") !!!" <<endl;
@@ -204,7 +204,7 @@ public:
type data;
s >> i >> data;
it=this->at(i);
- QValueList<type>::insert(it,data);
+ TQValueList<type>::insert(it,data);
// kdDebug(11001) << "CmdInsert:id="<<id()<<" i="<<i<<" data="<<data <<endl;
if (isEmittingSignal()) emitSignal();
break;
@@ -213,7 +213,7 @@ public:
{
type data;
s >> data;
- QValueList<type>::append(data);
+ TQValueList<type>::append(data);
// kdDebug(11001) << "CmdAppend:id=" << id() << " data=" << data << endl;
if (isEmittingSignal()) emitSignal();
break;
@@ -223,14 +223,14 @@ public:
uint i;
s >> i;
it=this->at(i);
- QValueList<type>::remove(it);
+ TQValueList<type>::remove(it);
kdDebug(11001) << "CmdRemove:id="<<id()<<" i="<<i <<endl;
if (isEmittingSignal()) emitSignal();
break;
}
case CmdClear:
{
- QValueList<type>::clear();
+ TQValueList<type>::clear();
kdDebug(11001) << "CmdClear:id="<<id()<<endl;
if (isEmittingSignal()) emitSignal();
break;
@@ -241,11 +241,11 @@ public:
}
protected:
- void extractProperty(const QByteArray& b)
+ void extractProperty(const TQByteArray& b)
// this is called for Policy[Dirty|Local] after putting the stuff into the
// stream
{
- QDataStream s(b, IO_ReadOnly);
+ TQDataStream s(b, IO_ReadOnly);
int cmd;
int propId;
KGameMessage::extractPropertyHeader(s, propId);
diff --git a/libkdegames/kgame/kgamesequence.cpp b/libkdegames/kgame/kgamesequence.cpp
index 984a9315..9391ee04 100644
--- a/libkdegames/kgame/kgamesequence.cpp
+++ b/libkdegames/kgame/kgamesequence.cpp
@@ -27,7 +27,7 @@
#include "kplayer.h"
#include "kgame.h"
-KGameSequence::KGameSequence() : QObject()
+KGameSequence::KGameSequence() : TQObject()
{
mGame = 0;
mCurrentPlayer = 0;
diff --git a/libkdegames/kgame/kgamesequence.h b/libkdegames/kgame/kgamesequence.h
index 4d26ceee..19699d6b 100644
--- a/libkdegames/kgame/kgamesequence.h
+++ b/libkdegames/kgame/kgamesequence.h
@@ -23,7 +23,7 @@
#ifndef __KGAMESEQUENCE_H_
#define __KGAMESEQUENCE_H_
-#include <qobject.h>
+#include <tqobject.h>
class KPlayer;
class KGame;
diff --git a/libkdegames/kgame/kmessageclient.cpp b/libkdegames/kgame/kmessageclient.cpp
index ed9cc966..e490a084 100644
--- a/libkdegames/kgame/kmessageclient.cpp
+++ b/libkdegames/kgame/kmessageclient.cpp
@@ -20,8 +20,8 @@
#include <kdebug.h>
#include <stdio.h>
-#include <qbuffer.h>
-#include <qtimer.h>
+#include <tqbuffer.h>
+#include <tqtimer.h>
#include "kmessageio.h"
#include "kmessageserver.h"
@@ -41,15 +41,15 @@ public:
}
Q_UINT32 adminID;
- QValueList <Q_UINT32> clientList;
+ TQValueList <Q_UINT32> clientList;
KMessageIO *connection;
bool isLocked;
- QValueList <QByteArray> delayedMessages;
+ TQValueList <TQByteArray> delayedMessages;
};
-KMessageClient::KMessageClient (QObject *parent, const char *name)
- : QObject (parent, name)
+KMessageClient::KMessageClient (TQObject *parent, const char *name)
+ : TQObject (parent, name)
{
d = new KMessageClientPrivate ();
d->isLocked = false;
@@ -63,7 +63,7 @@ KMessageClient::~KMessageClient ()
// -- setServer stuff
-void KMessageClient::setServer (const QString &host, Q_UINT16 port)
+void KMessageClient::setServer (const TQString &host, Q_UINT16 port)
{
setServer (new KMessageSocket (host, port));
}
@@ -86,10 +86,10 @@ void KMessageClient::setServer (KMessageIO *connection)
d->connection = connection;
if (connection )
{
- connect (connection, SIGNAL (received(const QByteArray &)),
- this, SLOT (processIncomingMessage(const QByteArray &)));
- connect (connection, SIGNAL (connectionBroken()),
- this, SLOT (removeBrokenConnection ()));
+ connect (connection, TQT_SIGNAL (received(const TQByteArray &)),
+ this, TQT_SLOT (processIncomingMessage(const TQByteArray &)));
+ connect (connection, TQT_SIGNAL (connectionBroken()),
+ this, TQT_SLOT (removeBrokenConnection ()));
}
}
@@ -110,7 +110,7 @@ Q_UINT32 KMessageClient::adminId () const
return d->adminID;
}
-const QValueList <Q_UINT32> &KMessageClient::clientList() const
+const TQValueList <Q_UINT32> &KMessageClient::clientList() const
{
return d->clientList;
}
@@ -130,14 +130,14 @@ Q_UINT16 KMessageClient::peerPort () const
return d->connection ? d->connection->peerPort() : 0;
}
-QString KMessageClient::peerName () const
+TQString KMessageClient::peerName () const
{
- return d->connection ? d->connection->peerName() : QString::fromLatin1("localhost");
+ return d->connection ? d->connection->peerName() : TQString::fromLatin1("localhost");
}
// --------------------- Sending messages
-void KMessageClient::sendServerMessage (const QByteArray &msg)
+void KMessageClient::sendServerMessage (const TQByteArray &msg)
{
if (!d->connection)
{
@@ -147,39 +147,39 @@ void KMessageClient::sendServerMessage (const QByteArray &msg)
d->connection->send (msg);
}
-void KMessageClient::sendBroadcast (const QByteArray &msg)
+void KMessageClient::sendBroadcast (const TQByteArray &msg)
{
- QByteArray sendBuffer;
- QBuffer buffer (sendBuffer);
+ TQByteArray sendBuffer;
+ TQBuffer buffer (sendBuffer);
buffer.open (IO_WriteOnly);
- QDataStream stream (&buffer);
+ TQDataStream stream (&buffer);
stream << static_cast<Q_UINT32> ( KMessageServer::REQ_BROADCAST );
- buffer.QIODevice::writeBlock (msg);
+ buffer.TQIODevice::writeBlock (msg);
sendServerMessage (sendBuffer);
}
-void KMessageClient::sendForward (const QByteArray &msg, const QValueList <Q_UINT32> &clients)
+void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients)
{
- QByteArray sendBuffer;
- QBuffer buffer (sendBuffer);
+ TQByteArray sendBuffer;
+ TQBuffer buffer (sendBuffer);
buffer.open (IO_WriteOnly);
- QDataStream stream (&buffer);
+ TQDataStream stream (&buffer);
stream << static_cast<Q_UINT32>( KMessageServer::REQ_FORWARD ) << clients;
- buffer.QIODevice::writeBlock (msg);
+ buffer.TQIODevice::writeBlock (msg);
sendServerMessage (sendBuffer);
}
-void KMessageClient::sendForward (const QByteArray &msg, Q_UINT32 client)
+void KMessageClient::sendForward (const TQByteArray &msg, Q_UINT32 client)
{
- sendForward (msg, QValueList <Q_UINT32> () << client);
+ sendForward (msg, TQValueList <Q_UINT32> () << client);
}
// --------------------- Receiving and processing messages
-void KMessageClient::processIncomingMessage (const QByteArray &msg)
+void KMessageClient::processIncomingMessage (const TQByteArray &msg)
{
if (d->isLocked)
{
@@ -189,7 +189,7 @@ void KMessageClient::processIncomingMessage (const QByteArray &msg)
if (d->delayedMessages.count() > 0)
{
d->delayedMessages.append (msg);
- QByteArray first = d->delayedMessages.front();
+ TQByteArray first = d->delayedMessages.front();
d->delayedMessages.pop_front();
processMessage (first);
}
@@ -199,16 +199,16 @@ void KMessageClient::processIncomingMessage (const QByteArray &msg)
}
}
-void KMessageClient::processMessage (const QByteArray &msg)
+void KMessageClient::processMessage (const TQByteArray &msg)
{
if (d->isLocked)
{ // must NOT happen, since we check in processIncomingMessage as well as in processFirstMessage
d->delayedMessages.append(msg);
return;
}
- QBuffer in_buffer (msg);
+ TQBuffer in_buffer (msg);
in_buffer.open (IO_ReadOnly);
- QDataStream in_stream (&in_buffer);
+ TQDataStream in_stream (&in_buffer);
bool unknown = false;
@@ -228,7 +228,7 @@ void KMessageClient::processMessage (const QByteArray &msg)
case KMessageServer::MSG_FORWARD:
{
Q_UINT32 clientID;
- QValueList <Q_UINT32> receivers;
+ TQValueList <Q_UINT32> receivers;
in_stream >> clientID >> receivers;
emit forwardReceived (in_buffer.readAll(), clientID, receivers);
}
@@ -313,7 +313,7 @@ void KMessageClient::processFirstMessage()
kdDebug(11001) << k_funcinfo << ": no messages delayed" << endl;
return;
}
- QByteArray first = d->delayedMessages.front();
+ TQByteArray first = d->delayedMessages.front();
d->delayedMessages.pop_front();
processMessage (first);
}
@@ -321,8 +321,8 @@ void KMessageClient::processFirstMessage()
void KMessageClient::removeBrokenConnection ()
{
kdDebug (11001) << k_funcinfo << ": timer single shot for removeBrokenConnection"<<this << endl;
- // MH We cannot directly delete the socket. otherwise QSocket crashes
- QTimer::singleShot( 0, this, SLOT(removeBrokenConnection2()) );
+ // MH We cannot directly delete the socket. otherwise TQSocket crashes
+ TQTimer::singleShot( 0, this, TQT_SLOT(removeBrokenConnection2()) );
return;
}
@@ -361,7 +361,7 @@ void KMessageClient::unlock ()
d->isLocked = false;
for (unsigned int i = 0; i < d->delayedMessages.count(); i++)
{
- QTimer::singleShot(0, this, SLOT(processFirstMessage()));
+ TQTimer::singleShot(0, this, TQT_SLOT(processFirstMessage()));
}
}
diff --git a/libkdegames/kgame/kmessageclient.h b/libkdegames/kgame/kmessageclient.h
index 90364c8d..71ab7a1e 100644
--- a/libkdegames/kgame/kmessageclient.h
+++ b/libkdegames/kgame/kmessageclient.h
@@ -20,9 +20,9 @@
#ifndef __KMESSAGECLIENT_H__
#define __KMESSAGECLIENT_H__
-#include <qobject.h>
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
class KMessageIO;
class KMessageServer;
@@ -58,7 +58,7 @@ public:
Creates an unconnected KMessageClient object. Use setServer() later to connect to a
KMessageServer object.
*/
- KMessageClient (QObject *parent = 0, const char *name = 0);
+ KMessageClient (TQObject *parent = 0, const char *name = 0);
/**
Destructor.
@@ -95,7 +95,7 @@ public:
/**
@return The list of the IDs of all the message clients connected to the message server.
*/
- const QValueList <Q_UINT32> &clientList() const;
+ const TQValueList <Q_UINT32> &clientList() const;
/**
Connects the client to (another) server.
@@ -108,7 +108,7 @@ public:
be resolved to an IP or just an IP
@param port The port to connect to
*/
- void setServer (const QString &host, Q_UINT16 port);
+ void setServer (const TQString &host, Q_UINT16 port);
/**
Connects the client to (another) server.
@@ -165,7 +165,7 @@ public:
/**
@return 0 if isConnected() is FALSE, otherwise the port number this client is
- connected to. See also KMessageIO::peerPort and QSocket::peerPort.
+ connected to. See also KMessageIO::peerPort and TQSocket::peerPort.
@since 3.2
*/
Q_UINT16 peerPort () const;
@@ -173,9 +173,9 @@ public:
/**
@since 3.2
@return "localhost" if isConnected() is FALSE, otherwise the hostname this client is
- connected to. See also KMessageIO::peerName() and QSocket::peerName().
+ connected to. See also KMessageIO::peerName() and TQSocket::peerName().
*/
- QString peerName() const;
+ TQString peerName() const;
/**
Sends a message to the KMessageServer. If we are not yet connected to one, nothing
@@ -188,7 +188,7 @@ public:
and sendForward().
@param msg The message to be sent to the server. Must be in the format specified in KMessageServer.
*/
- void sendServerMessage (const QByteArray &msg);
+ void sendServerMessage (const TQByteArray &msg);
/**
Sends a message to all the clients connected to the server, including ourself.
@@ -199,7 +199,7 @@ public:
@param msg The message to be sent to the clients
*/
//AB: processBroadcast doesn't exist!! is processIncomingMessage meant?
- void sendBroadcast (const QByteArray &msg);
+ void sendBroadcast (const TQByteArray &msg);
/**
Sends a message to all the clients in a list.
@@ -218,11 +218,11 @@ public:
@param clients A list of clients the message should be sent to
*/
//AB: processForward doesn't exist!! is processIncomingMessage meant?
- void sendForward (const QByteArray &msg, const QValueList <Q_UINT32> &clients);
+ void sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients);
/**
Sends a message to a single client. This is a convenieance method. It calls
- sendForward (const QByteArray &msg, const QValueList &ltQ_UINT32> &clients)
+ sendForward (const TQByteArray &msg, const TQValueList &ltQ_UINT32> &clients)
with a list containing only one client ID.
To send a message to the admin of the KMessageServer, you can use 0 as clientID,
@@ -230,7 +230,7 @@ public:
@param msg The message to be sent to the client
@param client The id of the client the message shall be sent to
*/
- void sendForward (const QByteArray &msg, Q_UINT32 client);
+ void sendForward (const TQByteArray &msg, Q_UINT32 client);
/**
Once this function is called no message will be received anymore.
@@ -263,7 +263,7 @@ signals:
to ignore broadcast messages that were sent by yourself:
\code
- void myObject::myBroadcastSlot (const QByteArray &msg, Q_UINT32 senderID)
+ void myObject::myBroadcastSlot (const TQByteArray &msg, Q_UINT32 senderID)
{
if (senderID == ((KMessageClient *)sender())->id())
return;
@@ -273,7 +273,7 @@ signals:
@param msg The message that has been sent to us
@param senderID The ID of the client which sent the message
*/
- void broadcastReceived (const QByteArray &msg, Q_UINT32 senderID);
+ void broadcastReceived (const TQByteArray &msg, Q_UINT32 senderID);
/**
This signal is emitted when the client receives a forward message from the
@@ -294,8 +294,8 @@ signals:
\code
KMessageClient *client = new KMessageClient ();
- connect (client, SIGNAL (forwardReceived (const QByteArray &, Q_UINT32, const QValueList <Q_UINT32>&)),
- client, SIGNAL (broadcastReceived (const QByteArray &, Q_UINT32)));
+ connect (client, TQT_SIGNAL (forwardReceived (const TQByteArray &, Q_UINT32, const TQValueList <Q_UINT32>&)),
+ client, TQT_SIGNAL (broadcastReceived (const TQByteArray &, Q_UINT32)));
\endcode
Then connect the broadcast signal to your slot that analyzes the message.
@@ -303,7 +303,7 @@ signals:
@param senderID The ID of the client which sent the message
@param receivers All clients which receive this message
*/
- void forwardReceived (const QByteArray &msg, Q_UINT32 senderID, const QValueList <Q_UINT32> &receivers);
+ void forwardReceived (const TQByteArray &msg, Q_UINT32 senderID, const TQValueList <Q_UINT32> &receivers);
/**
This signal is emitted when the connection to the KMessageServer is broken.
@@ -360,7 +360,7 @@ signals:
//AB: maybe add a setNoEmit() so that the other signals can be deactivated?
//Could be a performance benefit (note: KMessageClient is a time critical
//class!!!)
- void serverMessageReceived (const QByteArray &msg, bool &unknown);
+ void serverMessageReceived (const TQByteArray &msg, bool &unknown);
protected:
/**
@@ -380,7 +380,7 @@ protected:
@param msg The incoming message
*/
- virtual void processMessage (const QByteArray& msg);
+ virtual void processMessage (const TQByteArray& msg);
protected slots:
/**
@@ -398,10 +398,10 @@ protected slots:
MSG_BROADCAST, MSG_FORWARD, ANS_CLIENT_ID, ANS_ADMIN_ID, ANS_CLIENT_LIST
@param msg The incoming message
*/
- virtual void processIncomingMessage (const QByteArray &msg);
+ virtual void processIncomingMessage (const TQByteArray &msg);
/**
- Called from unlock() (using QTimer::singleShot) until all delayed
+ Called from unlock() (using TQTimer::singleShot) until all delayed
messages are delivered.
*/
void processFirstMessage();
diff --git a/libkdegames/kgame/kmessageio.cpp b/libkdegames/kgame/kmessageio.cpp
index f3353277..7057a621 100644
--- a/libkdegames/kgame/kmessageio.cpp
+++ b/libkdegames/kgame/kmessageio.cpp
@@ -22,15 +22,15 @@
*/
#include "kmessageio.h"
-#include <qsocket.h>
+#include <tqsocket.h>
#include <kdebug.h>
#include <kprocess.h>
-#include <qfile.h>
+#include <tqfile.h>
// ----------------------- KMessageIO -------------------------
-KMessageIO::KMessageIO (QObject *parent, const char *name)
- : QObject (parent, name), m_id (0)
+KMessageIO::KMessageIO (TQObject *parent, const char *name)
+ : TQObject (parent, name), m_id (0)
{}
KMessageIO::~KMessageIO ()
@@ -48,25 +48,25 @@ Q_UINT32 KMessageIO::id ()
// ----------------------KMessageSocket -----------------------
-KMessageSocket::KMessageSocket (QString host, Q_UINT16 port, QObject *parent,
+KMessageSocket::KMessageSocket (TQString host, Q_UINT16 port, TQObject *parent,
const char *name)
: KMessageIO (parent, name)
{
- mSocket = new QSocket ();
+ mSocket = new TQSocket ();
mSocket->connectToHost (host, port);
initSocket ();
}
-KMessageSocket::KMessageSocket (QHostAddress host, Q_UINT16 port, QObject
+KMessageSocket::KMessageSocket (TQHostAddress host, Q_UINT16 port, TQObject
*parent, const char *name)
: KMessageIO (parent, name)
{
- mSocket = new QSocket ();
+ mSocket = new TQSocket ();
mSocket->connectToHost (host.toString(), port);
initSocket ();
}
-KMessageSocket::KMessageSocket (QSocket *socket, QObject *parent, const char
+KMessageSocket::KMessageSocket (TQSocket *socket, TQObject *parent, const char
*name)
: KMessageIO (parent, name)
{
@@ -74,11 +74,11 @@ KMessageSocket::KMessageSocket (QSocket *socket, QObject *parent, const char
initSocket ();
}
-KMessageSocket::KMessageSocket (int socketFD, QObject *parent, const char
+KMessageSocket::KMessageSocket (int socketFD, TQObject *parent, const char
*name)
: KMessageIO (parent, name)
{
- mSocket = new QSocket ();
+ mSocket = new TQSocket ();
mSocket->setSocket (socketFD);
initSocket ();
}
@@ -90,12 +90,12 @@ KMessageSocket::~KMessageSocket ()
bool KMessageSocket::isConnected () const
{
- return mSocket->state() == QSocket::Connection;
+ return mSocket->state() == TQSocket::Connection;
}
-void KMessageSocket::send (const QByteArray &msg)
+void KMessageSocket::send (const TQByteArray &msg)
{
- QDataStream str (mSocket);
+ TQDataStream str (mSocket);
str << Q_UINT8 ('M'); // magic number for begin of message
str.writeBytes (msg.data(), msg.size()); // writes the length (as Q_UINT32) and the data
}
@@ -106,7 +106,7 @@ void KMessageSocket::processNewData ()
return;
isRecursive = true;
- QDataStream str (mSocket);
+ TQDataStream str (mSocket);
while (mSocket->bytesAvailable() > 0)
{
if (mAwaitingHeader)
@@ -141,7 +141,7 @@ void KMessageSocket::processNewData ()
return;
}
- QByteArray msg (mNextBlockLength);
+ TQByteArray msg (mNextBlockLength);
str.readRawBytes (msg.data(), mNextBlockLength);
// send the received message
@@ -157,9 +157,9 @@ void KMessageSocket::processNewData ()
void KMessageSocket::initSocket ()
{
- connect (mSocket, SIGNAL (error(int)), SIGNAL (connectionBroken()));
- connect (mSocket, SIGNAL (connectionClosed()), SIGNAL (connectionBroken()));
- connect (mSocket, SIGNAL (readyRead()), SLOT (processNewData()));
+ connect (mSocket, TQT_SIGNAL (error(int)), TQT_SIGNAL (connectionBroken()));
+ connect (mSocket, TQT_SIGNAL (connectionClosed()), TQT_SIGNAL (connectionBroken()));
+ connect (mSocket, TQT_SIGNAL (readyRead()), TQT_SLOT (processNewData()));
mAwaitingHeader = true;
mNextBlockLength = 0;
isRecursive = false;
@@ -170,14 +170,14 @@ Q_UINT16 KMessageSocket::peerPort () const
return mSocket->peerPort();
}
-QString KMessageSocket::peerName () const
+TQString KMessageSocket::peerName () const
{
return mSocket->peerName();
}
// ----------------------KMessageDirect -----------------------
-KMessageDirect::KMessageDirect (KMessageDirect *partner, QObject *parent,
+KMessageDirect::KMessageDirect (KMessageDirect *partner, TQObject *parent,
const char *name)
: KMessageIO (parent, name), mPartner (0)
{
@@ -213,7 +213,7 @@ bool KMessageDirect::isConnected () const
return mPartner != 0;
}
-void KMessageDirect::send (const QByteArray &msg)
+void KMessageDirect::send (const TQByteArray &msg)
{
if (mPartner)
emit mPartner->received (msg);
@@ -238,24 +238,24 @@ KMessageProcess::~KMessageProcess()
// Maybe todo: delete mSendBuffer
}
}
-KMessageProcess::KMessageProcess(QObject *parent, QString file) : KMessageIO(parent,0)
+KMessageProcess::KMessageProcess(TQObject *parent, TQString file) : KMessageIO(parent,0)
{
// Start process
kdDebug(11001) << "@@@KMessageProcess::Start process" << endl;
mProcessName=file;
mProcess=new KProcess;
int id=0;
- *mProcess << mProcessName << QString("%1").arg(id);
+ *mProcess << mProcessName << TQString("%1").arg(id);
kdDebug(11001) << "@@@KMessageProcess::Init:Id= " << id << endl;
kdDebug(11001) << "@@@KMessgeProcess::Init:Processname: " << mProcessName << endl;
- connect(mProcess, SIGNAL(receivedStdout(KProcess *, char *, int )),
- this, SLOT(slotReceivedStdout(KProcess *, char * , int )));
- connect(mProcess, SIGNAL(receivedStderr(KProcess *, char *, int )),
- this, SLOT(slotReceivedStderr(KProcess *, char * , int )));
- connect(mProcess, SIGNAL(processExited(KProcess *)),
- this, SLOT(slotProcessExited(KProcess *)));
- connect(mProcess, SIGNAL(wroteStdin(KProcess *)),
- this, SLOT(slotWroteStdin(KProcess *)));
+ connect(mProcess, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )),
+ this, TQT_SLOT(slotReceivedStdout(KProcess *, char * , int )));
+ connect(mProcess, TQT_SIGNAL(receivedStderr(KProcess *, char *, int )),
+ this, TQT_SLOT(slotReceivedStderr(KProcess *, char * , int )));
+ connect(mProcess, TQT_SIGNAL(processExited(KProcess *)),
+ this, TQT_SLOT(slotProcessExited(KProcess *)));
+ connect(mProcess, TQT_SIGNAL(wroteStdin(KProcess *)),
+ this, TQT_SLOT(slotWroteStdin(KProcess *)));
mProcess->start(KProcess::NotifyOnExit,KProcess::All);
mSendBuffer=0;
mReceiveCount=0;
@@ -267,7 +267,7 @@ bool KMessageProcess::isConnected() const
if (!mProcess) return false;
return mProcess->isRunning();
}
-void KMessageProcess::send(const QByteArray &msg)
+void KMessageProcess::send(const TQByteArray &msg)
{
kdDebug(11001) << "@@@KMessageProcess:: SEND("<<msg.size()<<") to process" << endl;
unsigned int size=msg.size()+2*sizeof(long);
@@ -280,7 +280,7 @@ void KMessageProcess::send(const QByteArray &msg)
*p1=0x4242aeae;
*p2=size;
- QByteArray *buffer=new QByteArray();
+ TQByteArray *buffer=new TQByteArray();
buffer->assign(tmpbuffer,size);
// buffer->duplicate(msg);
mQueue.enqueue(buffer);
@@ -330,9 +330,9 @@ void KMessageProcess::slotReceivedStderr(KProcess * proc, char *buffer, int bufl
if (!p) len=buflen;
else len=p-pos;
- QByteArray a;
+ TQByteArray a;
a.setRawData(pos,len);
- QString s(a);
+ TQString s(a);
kdDebug(11001) << "PID" <<pid<< ":" << s << endl;
a.resetRawData(pos,len);
if (p) pos=p+1;
@@ -371,7 +371,7 @@ void KMessageProcess::slotReceivedStdout(KProcess * , char *buffer, int buflen)
{
kdDebug(11001) << k_funcinfo << ": Got message with len " << len << endl;
- QByteArray msg;
+ TQByteArray msg;
// msg.setRawData(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long));
msg.duplicate(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long));
emit received(msg);
@@ -397,7 +397,7 @@ void KMessageProcess::slotProcessExited(KProcess * /*p*/)
// ----------------------- KMessageFilePipe ---------------------------
-KMessageFilePipe::KMessageFilePipe(QObject *parent,QFile *readfile,QFile *writefile) : KMessageIO(parent,0)
+KMessageFilePipe::KMessageFilePipe(TQObject *parent,TQFile *readfile,TQFile *writefile) : KMessageIO(parent,0)
{
mReadFile=readfile;
mWriteFile=writefile;
@@ -414,7 +414,7 @@ bool KMessageFilePipe::isConnected () const
return (mReadFile!=0)&&(mWriteFile!=0);
}
-void KMessageFilePipe::send(const QByteArray &msg)
+void KMessageFilePipe::send(const TQByteArray &msg)
{
unsigned int size=msg.size()+2*sizeof(long);
@@ -425,7 +425,7 @@ void KMessageFilePipe::send(const QByteArray &msg)
*p1=0x4242aeae;
*p2=size;
- QByteArray buffer;
+ TQByteArray buffer;
buffer.assign(tmpbuffer,size);
mWriteFile->writeBlock(buffer);
mWriteFile->flush();
@@ -464,7 +464,7 @@ void KMessageFilePipe::exec()
{
//fprintf(stderr,"KMessageFilePipe::exec:: Got Message with len %d\n",len);
- QByteArray msg;
+ TQByteArray msg;
//msg.setRawData(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long));
msg.duplicate(mReceiveBuffer.data()+2*sizeof(long),len-2*sizeof(long));
emit received(msg);
diff --git a/libkdegames/kgame/kmessageio.h b/libkdegames/kgame/kmessageio.h
index 37cf35cd..8ffa4377 100644
--- a/libkdegames/kgame/kmessageio.h
+++ b/libkdegames/kgame/kmessageio.h
@@ -24,12 +24,12 @@
#ifndef _KMESSAGEIO_H_
#define _KMESSAGEIO_H_
-#include <qcstring.h>
-#include <qhostaddress.h>
-#include <qobject.h>
-#include <qstring.h>
-#include <qptrqueue.h>
-#include <qfile.h>
+#include <tqcstring.h>
+#include <tqhostaddress.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqptrqueue.h>
+#include <tqfile.h>
#include <kdebug.h>
class QSocket;
@@ -59,9 +59,9 @@ class KMessageIO : public QObject
public:
/**
- * The usual QObject constructor, does nothing else.
+ * The usual TQObject constructor, does nothing else.
**/
- KMessageIO (QObject *parent = 0, const char *name = 0);
+ KMessageIO (TQObject *parent = 0, const char *name = 0);
/**
* The usual destructor, does nothing special.
@@ -122,7 +122,7 @@ public:
@since 3.2
@return "localhost" in the default implementation. Reimplemented in @ref KMessageSocket
*/
- virtual QString peerName () const { return QString::fromLatin1("localhost"); }
+ virtual TQString peerName () const { return TQString::fromLatin1("localhost"); }
signals:
@@ -131,7 +131,7 @@ signals:
object is called. The parameter contains the same data array in /e msg
as was used in /e send().
*/
- void received (const QByteArray &msg);
+ void received (const TQByteArray &msg);
/**
This signal is emitted when the connection is closed. This can be caused
@@ -154,7 +154,7 @@ public slots:
as a slot! (Otherwise another slot would be defined. It would work, but uses
more memory and time.) See /e KMessageSocket for an example implementation.
*/
- virtual void send (const QByteArray &msg) = 0;
+ virtual void send (const TQByteArray &msg) = 0;
protected:
Q_UINT32 m_id;
@@ -181,7 +181,7 @@ public:
If the connection could not be established (e.g. unknown host or no server
socket at this port), the signal /e connectionBroken is emitted.
*/
- KMessageSocket (QString host, Q_UINT16 port, QObject *parent = 0,
+ KMessageSocket (TQString host, Q_UINT16 port, TQObject *parent = 0,
const char *name = 0);
/**
@@ -192,7 +192,7 @@ public:
If the connection could not be established (e.g. unknown host or no server
socket at this port), the signal /e connectionBroken is emitted.
*/
- KMessageSocket (QHostAddress host, Q_UINT16 port, QObject *parent = 0,
+ KMessageSocket (TQHostAddress host, Q_UINT16 port, TQObject *parent = 0,
const char *name = 0);
/**
@@ -206,20 +206,20 @@ public:
together with this KMessageSocket object. (Use 0 as parent for the QSocket
object t ensure it is not deleted.)
*/
- KMessageSocket (QSocket *socket, QObject *parent = 0, const char *name = 0);
+ KMessageSocket (TQSocket *socket, TQObject *parent = 0, const char *name = 0);
/**
Uses the socket specified by the socket descriptor socketFD to do the
communication. The socket must already be connected.
- This constructor can be used with a QServerSocket within the (pure
+ This constructor can be used with a TQServerSocket within the (pure
virtual) method /e newConnection.
Note: The socket is then owned by the /e KMessageSocket object. So don't
manipulate the socket afterwards, especially don't close it. The socket is
automatically closed when KMessageSocket is deleted.
*/
- KMessageSocket (int socketFD, QObject *parent = 0, const char *name = 0);
+ KMessageSocket (int socketFD, TQObject *parent = 0, const char *name = 0);
/**
Destructor, closes the socket.
@@ -233,15 +233,15 @@ public:
/**
@since 3.2
- @return The port that this object is connected to. See QSocket::peerPort
+ @return The port that this object is connected to. See TQSocket::peerPort
*/
virtual Q_UINT16 peerPort () const;
/**
@since 3.2
- @return The hostname this object is connected to. See QSocket::peerName.
+ @return The hostname this object is connected to. See TQSocket::peerName.
*/
- virtual QString peerName () const;
+ virtual TQString peerName () const;
/**
@return TRUE as this is a network IO.
@@ -259,18 +259,18 @@ public:
Note: It is not declared as a slot method, since the slot is already
defined in KMessageIO as a virtual method.
*/
- void send (const QByteArray &msg);
+ void send (const TQByteArray &msg);
protected slots:
virtual void processNewData ();
protected:
void initSocket ();
- QSocket *mSocket;
+ TQSocket *mSocket;
bool mAwaitingHeader;
Q_UINT32 mNextBlockLength;
- bool isRecursive; // workaround for "bug" in QSocket, Qt 2.2.3 or older
+ bool isRecursive; // workaround for "bug" in TQSocket, Qt 2.2.3 or older
};
@@ -304,7 +304,7 @@ public:
If that object is already connected, the object remains unconnected.
*/
- KMessageDirect (KMessageDirect *partner = 0, QObject *parent = 0, const char
+ KMessageDirect (KMessageDirect *partner = 0, TQObject *parent = 0, const char
*name = 0);
/**
@@ -339,7 +339,7 @@ public:
Note: It is not declared as a slot method, since the slot is already
defined in KMessageIO as a virtual method.
*/
- void send (const QByteArray &msg);
+ void send (const TQByteArray &msg);
protected:
KMessageDirect *mPartner;
@@ -350,10 +350,10 @@ class KMessageProcess : public KMessageIO
Q_OBJECT
public:
- KMessageProcess(QObject *parent, QString file);
+ KMessageProcess(TQObject *parent, TQString file);
~KMessageProcess();
bool isConnected() const;
- void send (const QByteArray &msg);
+ void send (const TQByteArray &msg);
void writeToProcess();
/**
@@ -375,11 +375,11 @@ class KMessageProcess : public KMessageIO
void slotWroteStdin(KProcess *p);
private:
- QString mProcessName;
+ TQString mProcessName;
KProcess *mProcess;
- QPtrQueue <QByteArray> mQueue;
- QByteArray *mSendBuffer;
- QByteArray mReceiveBuffer;
+ TQPtrQueue <TQByteArray> mQueue;
+ TQByteArray *mSendBuffer;
+ TQByteArray mReceiveBuffer;
unsigned int mReceiveCount;
};
@@ -388,10 +388,10 @@ class KMessageFilePipe : public KMessageIO
Q_OBJECT
public:
- KMessageFilePipe(QObject *parent,QFile *readFile,QFile *writeFile);
+ KMessageFilePipe(TQObject *parent,TQFile *readFile,TQFile *writeFile);
~KMessageFilePipe();
bool isConnected() const;
- void send (const QByteArray &msg);
+ void send (const TQByteArray &msg);
void exec();
/**
@@ -407,9 +407,9 @@ class KMessageFilePipe : public KMessageIO
private:
- QFile *mReadFile;
- QFile *mWriteFile;
- QByteArray mReceiveBuffer;
+ TQFile *mReadFile;
+ TQFile *mWriteFile;
+ TQByteArray mReceiveBuffer;
unsigned int mReceiveCount;
};
diff --git a/libkdegames/kgame/kmessageserver.cpp b/libkdegames/kgame/kmessageserver.cpp
index e857ea31..105f35da 100644
--- a/libkdegames/kgame/kmessageserver.cpp
+++ b/libkdegames/kgame/kmessageserver.cpp
@@ -17,12 +17,12 @@
Boston, MA 02110-1301, USA.
*/
-#include <qiodevice.h>
-#include <qbuffer.h>
-#include <qptrlist.h>
-#include <qptrqueue.h>
-#include <qtimer.h>
-#include <qvaluelist.h>
+#include <tqiodevice.h>
+#include <tqbuffer.h>
+#include <tqptrlist.h>
+#include <tqptrqueue.h>
+#include <tqtimer.h>
+#include <tqvaluelist.h>
#include <kdebug.h>
@@ -31,8 +31,8 @@
// --------------- internal class KMessageServerSocket
-KMessageServerSocket::KMessageServerSocket (Q_UINT16 port, QObject *parent)
- : QServerSocket (port, 0, parent)
+KMessageServerSocket::KMessageServerSocket (Q_UINT16 port, TQObject *parent)
+ : TQServerSocket (port, 0, parent)
{
}
@@ -50,11 +50,11 @@ void KMessageServerSocket::newConnection (int socket)
class MessageBuffer
{
public:
- MessageBuffer (Q_UINT32 clientID, const QByteArray &messageData)
+ MessageBuffer (Q_UINT32 clientID, const TQByteArray &messageData)
: id (clientID), data (messageData) { }
~MessageBuffer () {}
Q_UINT32 id;
- QByteArray data;
+ TQByteArray data;
};
// ---------------- KMessageServer's private class
@@ -77,23 +77,23 @@ public:
KMessageServerSocket* mServerSocket;
- QPtrList <KMessageIO> mClientList;
- QPtrQueue <MessageBuffer> mMessageQueue;
- QTimer mTimer;
+ TQPtrList <KMessageIO> mClientList;
+ TQPtrQueue <MessageBuffer> mMessageQueue;
+ TQTimer mTimer;
bool mIsRecursive;
};
// ------------------ KMessageServer
-KMessageServer::KMessageServer (Q_UINT16 cookie,QObject* parent)
- : QObject(parent, 0)
+KMessageServer::KMessageServer (Q_UINT16 cookie,TQObject* parent)
+ : TQObject(parent, 0)
{
d = new KMessageServerPrivate;
d->mIsRecursive=false;
d->mCookie=cookie;
- connect (&(d->mTimer), SIGNAL (timeout()),
- this, SLOT (processOneMessage()));
+ connect (&(d->mTimer), TQT_SIGNAL (timeout()),
+ this, TQT_SLOT (processOneMessage()));
kdDebug(11001) << "CREATE(KMessageServer="
<< this
<< ") cookie="
@@ -138,8 +138,8 @@ bool KMessageServer::initNetwork (Q_UINT16 port)
kdDebug (11001) << k_funcinfo << ": Now listening to port "
<< d->mServerSocket->port() << endl;
- connect (d->mServerSocket, SIGNAL (newClientConnected (KMessageIO*)),
- this, SLOT (addClient (KMessageIO*)));
+ connect (d->mServerSocket, TQT_SIGNAL (newClientConnected (KMessageIO*)),
+ this, TQT_SLOT (addClient (KMessageIO*)));
return true;
}
@@ -169,7 +169,7 @@ bool KMessageServer::isOfferingConnections() const
void KMessageServer::addClient (KMessageIO* client)
{
- QByteArray msg;
+ TQByteArray msg;
// maximum number of clients reached?
if (d->mMaxClients >= 0 && d->mMaxClients <= clientCount())
@@ -183,25 +183,25 @@ void KMessageServer::addClient (KMessageIO* client)
kdDebug (11001) << k_funcinfo << ": " << client->id() << endl;
// connect its signals
- connect (client, SIGNAL (connectionBroken()),
- this, SLOT (removeBrokenClient()));
- connect (client, SIGNAL (received (const QByteArray &)),
- this, SLOT (getReceivedMessage (const QByteArray &)));
+ connect (client, TQT_SIGNAL (connectionBroken()),
+ this, TQT_SLOT (removeBrokenClient()));
+ connect (client, TQT_SIGNAL (received (const TQByteArray &)),
+ this, TQT_SLOT (getReceivedMessage (const TQByteArray &)));
// Tell everyone about the new guest
// Note: The new client doesn't get this message!
- QDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_CONNECTED) << client->id();
+ TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_CONNECTED) << client->id();
broadcastMessage (msg);
// add to our list
d->mClientList.append (client);
// tell it its ID
- QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_ID) << client->id();
+ TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_ID) << client->id();
client->send (msg);
// Give it the complete list of client IDs
- QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs();
+ TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs();
client->send (msg);
@@ -213,7 +213,7 @@ void KMessageServer::addClient (KMessageIO* client)
else
{
// otherwise tell it who is the admin
- QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID();
+ TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID();
client->send (msg);
}
@@ -230,8 +230,8 @@ void KMessageServer::removeClient (KMessageIO* client, bool broken)
}
// tell everyone about the removed client
- QByteArray msg;
- QDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (Q_INT8)broken;
+ TQByteArray msg;
+ TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (Q_INT8)broken;
broadcastMessage (msg);
// If it was the admin, select a new admin.
@@ -280,10 +280,10 @@ int KMessageServer::clientCount() const
return d->mClientList.count();
}
-QValueList <Q_UINT32> KMessageServer::clientIDs () const
+TQValueList <Q_UINT32> KMessageServer::clientIDs () const
{
- QValueList <Q_UINT32> list;
- for (QPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter)
+ TQValueList <Q_UINT32> list;
+ for (TQPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter)
list.append ((*iter)->id());
return list;
}
@@ -293,7 +293,7 @@ KMessageIO* KMessageServer::findClient (Q_UINT32 no) const
if (no == 0)
no = d->mAdminID;
- QPtrListIterator <KMessageIO> iter (d->mClientList);
+ TQPtrListIterator <KMessageIO> iter (d->mClientList);
while (*iter)
{
if ((*iter)->id() == no)
@@ -322,8 +322,8 @@ void KMessageServer::setAdmin (Q_UINT32 adminID)
d->mAdminID = adminID;
- QByteArray msg;
- QDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID;
+ TQByteArray msg;
+ TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID;
// Tell everyone about the new master
broadcastMessage (msg);
@@ -339,26 +339,26 @@ Q_UINT32 KMessageServer::uniqueClientNumber() const
// --------------------- Messages ---------------------------
-void KMessageServer::broadcastMessage (const QByteArray &msg)
+void KMessageServer::broadcastMessage (const TQByteArray &msg)
{
- for (QPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter)
+ for (TQPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter)
(*iter)->send (msg);
}
-void KMessageServer::sendMessage (Q_UINT32 id, const QByteArray &msg)
+void KMessageServer::sendMessage (Q_UINT32 id, const TQByteArray &msg)
{
KMessageIO *client = findClient (id);
if (client)
client->send (msg);
}
-void KMessageServer::sendMessage (const QValueList <Q_UINT32> &ids, const QByteArray &msg)
+void KMessageServer::sendMessage (const TQValueList <Q_UINT32> &ids, const TQByteArray &msg)
{
- for (QValueListConstIterator <Q_UINT32> iter = ids.begin(); iter != ids.end(); ++iter)
+ for (TQValueListConstIterator <Q_UINT32> iter = ids.begin(); iter != ids.end(); ++iter)
sendMessage (*iter, msg);
}
-void KMessageServer::getReceivedMessage (const QByteArray &msg)
+void KMessageServer::getReceivedMessage (const TQByteArray &msg)
{
if (!sender() || !sender()->inherits("KMessageIO"))
{
@@ -369,7 +369,7 @@ void KMessageServer::getReceivedMessage (const QByteArray &msg)
KMessageIO *client = (KMessageIO *) sender();
Q_UINT32 clientID = client->id();
- //QByteArray *ta=new QByteArray;
+ //TQByteArray *ta=new QByteArray;
//ta->duplicate(msg);
//d->mMessageQueue.enqueue (new MessageBuffer (clientID, *ta));
@@ -396,18 +396,18 @@ void KMessageServer::processOneMessage ()
MessageBuffer *msg_buf = d->mMessageQueue.head();
Q_UINT32 clientID = msg_buf->id;
- QBuffer in_buffer (msg_buf->data);
+ TQBuffer in_buffer (msg_buf->data);
in_buffer.open (IO_ReadOnly);
- QDataStream in_stream (&in_buffer);
+ TQDataStream in_stream (&in_buffer);
- QByteArray out_msg;
- QBuffer out_buffer (out_msg);
+ TQByteArray out_msg;
+ TQBuffer out_buffer (out_msg);
out_buffer.open (IO_WriteOnly);
- QDataStream out_stream (&out_buffer);
+ TQDataStream out_stream (&out_buffer);
bool unknown = false;
- QByteArray ttt=in_buffer.buffer();
+ TQByteArray ttt=in_buffer.buffer();
Q_UINT32 messageID;
in_stream >> messageID;
//kdDebug(11001) << k_funcinfo << ": got message with messageID=" << messageID << endl;
@@ -416,19 +416,19 @@ void KMessageServer::processOneMessage ()
case REQ_BROADCAST:
out_stream << Q_UINT32 (MSG_BROADCAST) << clientID;
// FIXME, compiler bug?
- // this should be okay, since QBuffer is subclass of QIODevice! :
+ // this should be okay, since TQBuffer is subclass of QIODevice! :
// out_buffer.writeBlock (in_buffer.readAll());
- out_buffer.QIODevice::writeBlock (in_buffer.readAll());
+ out_buffer.TQIODevice::writeBlock (in_buffer.readAll());
broadcastMessage (out_msg);
break;
case REQ_FORWARD:
{
- QValueList <Q_UINT32> clients;
+ TQValueList <Q_UINT32> clients;
in_stream >> clients;
out_stream << Q_UINT32 (MSG_FORWARD) << clientID << clients;
// see above!
- out_buffer.QIODevice::writeBlock (in_buffer.readAll());
+ out_buffer.TQIODevice::writeBlock (in_buffer.readAll());
sendMessage (clients, out_msg);
}
break;
@@ -455,9 +455,9 @@ void KMessageServer::processOneMessage ()
case REQ_REMOVE_CLIENT:
if (clientID == d->mAdminID)
{
- QValueList <Q_UINT32> client_list;
+ TQValueList <Q_UINT32> client_list;
in_stream >> client_list;
- for (QValueListIterator <Q_UINT32> iter = client_list.begin(); iter != client_list.end(); ++iter)
+ for (TQValueListIterator <Q_UINT32> iter = client_list.begin(); iter != client_list.end(); ++iter)
{
KMessageIO *client = findClient (*iter);
if (client)
diff --git a/libkdegames/kgame/kmessageserver.h b/libkdegames/kgame/kmessageserver.h
index 0049a2e7..3d0b1055 100644
--- a/libkdegames/kgame/kmessageserver.h
+++ b/libkdegames/kgame/kmessageserver.h
@@ -20,10 +20,10 @@
#ifndef __KMESSAGESERVER_H__
#define __KMESSAGESERVER_H__
-#include <qobject.h>
-#include <qserversocket.h>
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqobject.h>
+#include <tqserversocket.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
class KMessageIO;
class KMessageServerPrivate;
@@ -42,7 +42,7 @@ class KMessageServerPrivate;
KMessageDirect.) This object already has to be connected.
The messages are always packages of an arbitrary length. The format of the messages
- is given below. All the data is stored and received with QDataStream, to be
+ is given below. All the data is stored and received with TQDataStream, to be
platform independant.
Setting up a KMessageServer can be done like this:
@@ -72,53 +72,53 @@ class KMessageServerPrivate;
This is always interpreted as the admin client, independant of its real clientID.
Here is a list of the messages the KMessageServer understands:
- &lt;&lt; means, the value is inserted into the QByteArray using QDataStream. The
+ &lt;&lt; means, the value is inserted into the TQByteArray using TQDataStream. The
messageIDs (REQ_BROADCAST, ...) are of type Q_UINT32.
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_BROADCAST ) << raw_data
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_BROADCAST ) << raw_data
When the server receives this message, it sends the following message to
ALL connected clients (a broadcast), where the raw_data is left unchanged:
- QByteArray << static_cast &lt;Q_UINT32>( MSG_BROADCAST ) << clientID << raw_data
+ TQByteArray << static_cast &lt;Q_UINT32>( MSG_BROADCAST ) << clientID << raw_data
Q_UINT32 clientID; // the ID of the client that sent the broadcast request
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_FORWARD ) << client_list << raw_data
- QValueList &lt;Q_UINT32> client_list; // list of receivers
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_FORWARD ) << client_list << raw_data
+ TQValueList &lt;Q_UINT32> client_list; // list of receivers
When the server receives this message, it sends the following message to
the clients in client_list:
- QByteArray << static_cast&lt;Q_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data
+ TQByteArray << static_cast&lt;Q_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data
Q_UINT32 senderID; // the sender of the forward request
- QValueList &lt;Q_UINT32> client_list; // a copy of the receiver list
+ TQValueList &lt;Q_UINT32> client_list; // a copy of the receiver list
Note: Every client receives the message as many times as he is in the client_list.
Note: Since the client_list is sent to all the clients, every client can see who else
got the message. If you want to prevent this, send a single REQ_FORWARD
message for every receiver.
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_CLIENT_ID )
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_CLIENT_ID )
When the server receives this message, it sends the following message to
the asking client:
- QByteArray << static_cast&lt;Q_UINT32>( ANS_CLIENT_ID ) << clientID
+ TQByteArray << static_cast&lt;Q_UINT32>( ANS_CLIENT_ID ) << clientID
Q_UINT32 clientID; // The ID of the client who asked for it
Note: This answer is also automatically sent to a new connected client, so that he
can store his ID. The ID of a client doesn't change during his lifetime, and is
unique for this KMessageServer.
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_ADMIN_ID )
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_ADMIN_ID )
When the server receives this message, it sends the following message to
the asking client:
- QByteArray << ANS_ADMIN_ID << adminID
+ TQByteArray << ANS_ADMIN_ID << adminID
Q_UINT32 adminID; // The ID of the admin
Note: This answer is also automatically sent to a new connected client, so that he
can see if he is the admin or not. It will also be sent to all connected clients
when a new admin is set (see REQ_ADMIN_CHANGE).
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_ADMIN_CHANGE ) << new_admin
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_ADMIN_CHANGE ) << new_admin
Q_UINT32 new_admin; // the ID of the new admin, or 0 for no admin
When the server receives this message, it sets the admin to the new ID. If no client
@@ -127,8 +127,8 @@ class KMessageServerPrivate;
Note: The server sends a ANS_ADMIN_ID message to every connected client.
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_REMOVE_CLIENT ) << client_list
- QValueList &lt;Q_UINT32> client_list; // The list of clients to be removed
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_REMOVE_CLIENT ) << client_list
+ TQValueList &lt;Q_UINT32> client_list; // The list of clients to be removed
When the server receives this message, it removes the clients with the ids stored in
client_list, disconnecting the connection to them.
@@ -137,7 +137,7 @@ class KMessageServerPrivate;
Note: If one of the clients is the admin himself, he will also be deleted.
Another client (if any left) will become the new admin.
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_MAX_NUM_CLIENTS ) << maximum_clients
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_MAX_NUM_CLIENTS ) << maximum_clients
Q_INT32 maximum_clients; // The maximum of clients connected, or infinite if -1
When the server receives this message, it limits the number of clients to the number given,
@@ -147,12 +147,12 @@ class KMessageServerPrivate;
Note: If there are already more clients, they are not affected. It only prevents new Clients
to be added. To assure this limit, remove clients afterwards (REQ_REMOVE_CLIENT)
- - QByteArray << static_cast&lt;Q_UINT32>( REQ_CLIENT_LIST )
+ - TQByteArray << static_cast&lt;Q_UINT32>( REQ_CLIENT_LIST )
When the server receives this message, it answers by sending a list of IDs of all the clients
that are connected at the moment. So it sends the following message to the asking client:
- QByteArray << static_cast&lt;Q_UINT32>( ANS_CLIENT_LIST ) << clientList
- QValueList &lt;Q_UINT32> clientList; // The IDs of the connected clients
+ TQByteArray << static_cast&lt;Q_UINT32>( ANS_CLIENT_LIST ) << clientList
+ TQValueList &lt;Q_UINT32> clientList; // The IDs of the connected clients
Note: This message is also sent to every new connected client, so that he knows the other
clients.
@@ -160,10 +160,10 @@ class KMessageServerPrivate;
There are two more messages that are sent from the server to the every client automatically
when a new client connects or a connection to a client is lost:
- QByteArray << static_cast&lt;Q_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID;
+ TQByteArray << static_cast&lt;Q_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID;
Q_UINT32 clientID; // the ID of the new connected client
- QByteArray << static_cast&lt;Q_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID;
+ TQByteArray << static_cast&lt;Q_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID;
Q_UINT32 clientID; // the ID of the client that lost the connection
Q_UINT8 broken; // 1 if the network connection was closed, 0 if it was disconnected
// on purpose
@@ -208,7 +208,7 @@ public:
/**
* Create a KGameNetwork object
**/
- KMessageServer(Q_UINT16 cookie = 42, QObject* parent = 0);
+ KMessageServer(Q_UINT16 cookie = 42, TQObject* parent = 0);
~KMessageServer();
@@ -325,7 +325,7 @@ public:
/**
* returns a list of the unique IDs of all clients.
**/
- QValueList <Q_UINT32> clientIDs() const;
+ TQValueList <Q_UINT32> clientIDs() const;
/**
* Find the @ref KMessageIO object to the given client number.
@@ -375,7 +375,7 @@ public:
* The message is NOT translated in any way. This method calls
* @ref KMessageIO::send for every client added.
**/
- virtual void broadcastMessage (const QByteArray &msg);
+ virtual void broadcastMessage (const TQByteArray &msg);
/**
* Sends a message to a single client with the given ID.
@@ -385,7 +385,7 @@ public:
* @ref findClient (id)->send(msg) manually, but this method checks for
* errors.
**/
- virtual void sendMessage (Q_UINT32 id, const QByteArray &msg);
+ virtual void sendMessage (Q_UINT32 id, const TQByteArray &msg);
/**
* Sends a message to a list of clients. Their ID is given in ids. If
@@ -394,7 +394,7 @@ public:
* This is just a convenience method. You could also iterate over the
* list of IDs.
**/
- virtual void sendMessage (const QValueList <Q_UINT32> &ids, const QByteArray &msg);
+ virtual void sendMessage (const TQValueList <Q_UINT32> &ids, const TQByteArray &msg);
protected slots:
/**
@@ -406,7 +406,7 @@ protected slots:
* @ref KMessageIO::received, since the sender() object is used to find out
* the client that sent the message!
**/
- virtual void getReceivedMessage (const QByteArray &msg);
+ virtual void getReceivedMessage (const TQByteArray &msg);
/**
* This slot is called whenever there are elements in the message queue. This queue
@@ -448,7 +448,7 @@ signals:
* @param clientID the ID of the KMessageIO object that received the message
* @param unknown true, if the message type is not known by the KMessageServer
**/
- void messageReceived (const QByteArray &data, Q_UINT32 clientID, bool &unknown);
+ void messageReceived (const TQByteArray &data, Q_UINT32 clientID, bool &unknown);
protected:
/**
@@ -468,7 +468,7 @@ private:
connections.
NOTE: This has to be here in the header file, because it is a subclass from
- QObject and has to go through the moc.
+ TQObject and has to go through the moc.
@short An internal class for KServerSocket
@author Burkhard Lehner <[email protected]>
@@ -478,7 +478,7 @@ class KMessageServerSocket : public QServerSocket
Q_OBJECT
public:
- KMessageServerSocket (Q_UINT16 port, QObject *parent = 0);
+ KMessageServerSocket (Q_UINT16 port, TQObject *parent = 0);
~KMessageServerSocket ();
void newConnection (int socket);
diff --git a/libkdegames/kgame/kplayer.cpp b/libkdegames/kgame/kplayer.cpp
index 0f8ea184..fdde20d9 100644
--- a/libkdegames/kgame/kplayer.cpp
+++ b/libkdegames/kgame/kplayer.cpp
@@ -31,7 +31,7 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qbuffer.h>
+#include <tqbuffer.h>
#include <stdio.h>
#include <assert.h>
@@ -59,12 +59,12 @@ public:
KGamePropertyQString mGroup;
};
-KPlayer::KPlayer() : QObject(0,0)
+KPlayer::KPlayer() : TQObject(0,0)
{
init();
}
-KPlayer::KPlayer(KGame* game) : QObject(0, 0)
+KPlayer::KPlayer(KGame* game) : TQObject(0, 0)
{
init();
game->addPlayer(this);
@@ -78,8 +78,8 @@ void KPlayer::init()
d = new KPlayerPrivate;
d->mProperties.registerHandler(KGameMessage::IdPlayerProperty,
- this,SLOT(sendProperty(int, QDataStream&, bool*)),
- SLOT(emitSignal(KGamePropertyBase *)));
+ this,TQT_SLOT(sendProperty(int, TQDataStream&, bool*)),
+ TQT_SLOT(emitSignal(KGamePropertyBase *)));
d->mVirtual=false;
mActive=true;
mGame=0;
@@ -125,7 +125,7 @@ KPlayer::~KPlayer()
// kdDebug(11001) << k_funcinfo << " done" << endl;
}
-bool KPlayer::forwardMessage(QDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT32 sender)
+bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT32 sender)
{
if (!isActive())
{
@@ -139,7 +139,7 @@ bool KPlayer::forwardMessage(QDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT
return game()->sendSystemMessage(msg,msgid,receiver,sender);
}
-bool KPlayer::forwardInput(QDataStream &msg,bool transmit,Q_UINT32 sender)
+bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,Q_UINT32 sender)
{
if (!isActive())
{
@@ -180,16 +180,16 @@ void KPlayer::setId(Q_UINT32 newid)
}
-void KPlayer::setGroup(const QString& group)
+void KPlayer::setGroup(const TQString& group)
{ d->mGroup = group; }
-const QString& KPlayer::group() const
+const TQString& KPlayer::group() const
{ return d->mGroup.value(); }
-void KPlayer::setName(const QString& name)
+void KPlayer::setName(const TQString& name)
{ d->mName = name; }
-const QString& KPlayer::name() const
+const TQString& KPlayer::name() const
{ return d->mName.value(); }
Q_UINT32 KPlayer::id() const
@@ -258,7 +258,7 @@ bool KPlayer::removeGameIO(KGameIO *targetinput,bool deleteit)
KGameIO * KPlayer::findRttiIO(int rtti) const
{
- QPtrListIterator<KGameIO> it(mInputList);
+ TQPtrListIterator<KGameIO> it(mInputList);
while (it.current())
{
if (it.current()->rtti() == rtti)
@@ -273,7 +273,7 @@ KGameIO * KPlayer::findRttiIO(int rtti) const
int KPlayer::calcIOValue()
{
int value=0;
- QPtrListIterator<KGameIO> it(mInputList);
+ TQPtrListIterator<KGameIO> it(mInputList);
while (it.current())
{
value|=it.current()->rtti();
@@ -311,7 +311,7 @@ bool KPlayer::setTurn(bool b, bool exclusive)
return true;
}
-bool KPlayer::load(QDataStream &stream)
+bool KPlayer::load(TQDataStream &stream)
{
Q_INT32 id,priority;
stream >> id >> priority;
@@ -337,7 +337,7 @@ bool KPlayer::load(QDataStream &stream)
return true;
}
-bool KPlayer::save(QDataStream &stream)
+bool KPlayer::save(TQDataStream &stream)
{
stream << (Q_INT32)id() << (Q_INT32)networkPriority();
@@ -350,7 +350,7 @@ bool KPlayer::save(QDataStream &stream)
}
-void KPlayer::networkTransmission(QDataStream &stream,int msgid,Q_UINT32 sender)
+void KPlayer::networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender)
{
//kdDebug(11001) << k_funcinfo ": msgid=" << msgid << " sender=" << sender << " we are=" << id() << endl;
// PlayerProperties processed
@@ -378,7 +378,7 @@ void KPlayer::networkTransmission(QDataStream &stream,int msgid,Q_UINT32 sender)
break;
default:
emit signalNetworkData(msgid - KGameMessage::IdUser,
- ((QBuffer*)stream.device())->readAll(),sender,this);
+ ((TQBuffer*)stream.device())->readAll(),sender,this);
kdDebug(11001) << k_funcinfo << ": "
<< "User data msgid " << msgid << endl;
break;
@@ -396,7 +396,7 @@ bool KPlayer::addProperty(KGamePropertyBase* data)
return d->mProperties.addProperty(data);
}
-void KPlayer::sendProperty(int msgid, QDataStream& stream, bool* sent)
+void KPlayer::sendProperty(int msgid, TQDataStream& stream, bool* sent)
{
if (game())
{
@@ -414,7 +414,7 @@ void KPlayer::emitSignal(KGamePropertyBase *me)
if (me->id()==KGamePropertyBase::IdTurn)
{
//kdDebug(11001) << k_funcinfo << ": for KGamePropertyBase::IdTurn " << endl;
- QPtrListIterator<KGameIO> it(mInputList);
+ TQPtrListIterator<KGameIO> it(mInputList);
while (it.current())
{
it.current()->notifyTurn(mMyTurn.value());
diff --git a/libkdegames/kgame/kplayer.h b/libkdegames/kgame/kplayer.h
index 0e511ac3..a2d78929 100644
--- a/libkdegames/kgame/kplayer.h
+++ b/libkdegames/kgame/kplayer.h
@@ -21,9 +21,9 @@
#ifndef __KPLAYER_H_
#define __KPLAYER_H_
-#include <qstring.h>
-#include <qobject.h>
-#include <qptrlist.h>
+#include <tqstring.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
#include "kgameproperty.h"
#include <kdemacros.h>
@@ -71,7 +71,7 @@ class KDE_EXPORT KPlayer : public QObject
Q_OBJECT
public:
- typedef QPtrList<KGameIO> KGameIOList;
+ typedef TQPtrList<KGameIO> KGameIOList;
// KPlayer(KGame *,KGameIO * input=0);
/**
@@ -259,24 +259,24 @@ public:
* A group the player belongs to. This
* Can be set arbitrary by you.
*/
- void setGroup(const QString& group);
+ void setGroup(const TQString& group);
/**
* Query the group the player belongs to.
*/
- virtual const QString& group() const;
+ virtual const TQString& group() const;
/**
* Sets the name of the player.
* This can be chosen arbitrary.
* @param name The player's name
*/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* @return The name of the player.
*/
- virtual const QString& name() const;
+ virtual const TQString& name() const;
// set devices
@@ -333,12 +333,12 @@ public:
* KGame::playerInput() (if player=false, ie the message *was* sent through
* KGame::sendPlayerInput).
*/
- virtual bool forwardInput(QDataStream &msg,bool transmit=true, Q_UINT32 sender=0);
+ virtual bool forwardInput(TQDataStream &msg,bool transmit=true, Q_UINT32 sender=0);
/**
* Forwards Message to the game object..internal use only
*/
- virtual bool forwardMessage(QDataStream &msg,int msgid,Q_UINT32 receiver=0,Q_UINT32 sender=0);
+ virtual bool forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver=0,Q_UINT32 sender=0);
// Game logic
/**
@@ -372,7 +372,7 @@ public:
*
* @return true?
*/
- virtual bool load(QDataStream &stream);
+ virtual bool load(TQDataStream &stream);
/**
* Save a player to a file OR to network. See also load
@@ -381,7 +381,7 @@ public:
*
* @return true?
*/
- virtual bool save(QDataStream &stream);
+ virtual bool save(TQDataStream &stream);
/**
* Receives a message
@@ -390,7 +390,7 @@ public:
* @param stream The message itself
* @param sender
**/
- void networkTransmission(QDataStream &stream,int msgid,Q_UINT32 sender);
+ void networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender);
/**
* Searches for a property of the player given its id.
@@ -430,7 +430,7 @@ signals:
* means probably a user message. Connecting to this signal
* allowed to process it.
*/
- void signalNetworkData(int msgid, const QByteArray& buffer, Q_UINT32 sender, KPlayer *me);
+ void signalNetworkData(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer *me);
/**
* This signal is emmited if a player property changes its value and
@@ -444,7 +444,7 @@ protected slots:
/**
* Called by KGameProperty only! Internal function!
**/
- void sendProperty(int msgid, QDataStream& stream, bool* sent);
+ void sendProperty(int msgid, TQDataStream& stream, bool* sent);
/**
* Called by KGameProperty only! Internal function!
**/
diff --git a/libkdegames/kgamelcd.cpp b/libkdegames/kgamelcd.cpp
index 65c436a5..c87930b5 100644
--- a/libkdegames/kgamelcd.cpp
+++ b/libkdegames/kgamelcd.cpp
@@ -20,23 +20,23 @@
#include "kgamelcd.h"
#include "kgamelcd.moc"
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqtimer.h>
#include <kglobal.h>
//-----------------------------------------------------------------------------
-KGameLCD::KGameLCD(uint nbDigits, QWidget *parent, const char *name)
- : QLCDNumber(nbDigits, parent, name), _htime(800)
+KGameLCD::KGameLCD(uint nbDigits, TQWidget *parent, const char *name)
+ : TQLCDNumber(nbDigits, parent, name), _htime(800)
{
- const QPalette &p = palette();
- _fgColor = p.color(QPalette::Active, QColorGroup::Foreground);
- _hlColor = p.color(QPalette::Active, QColorGroup::HighlightedText);
+ const TQPalette &p = palette();
+ _fgColor = p.color(TQPalette::Active, TQColorGroup::Foreground);
+ _hlColor = p.color(TQPalette::Active, TQColorGroup::HighlightedText);
- _timer = new QTimer(this);
- connect(_timer, SIGNAL(timeout()), SLOT(timeout()));
+ _timer = new TQTimer(this);
+ connect(_timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()));
setFrameStyle(Panel | Plain);
setSegmentStyle(Flat);
@@ -47,27 +47,27 @@ KGameLCD::KGameLCD(uint nbDigits, QWidget *parent, const char *name)
KGameLCD::~KGameLCD()
{}
-void KGameLCD::setDefaultBackgroundColor(const QColor &color)
+void KGameLCD::setDefaultBackgroundColor(const TQColor &color)
{
- QPalette p = palette();
- p.setColor(QColorGroup::Background, color);
+ TQPalette p = palette();
+ p.setColor(TQColorGroup::Background, color);
setPalette(p);
}
-void KGameLCD::setDefaultColor(const QColor &color)
+void KGameLCD::setDefaultColor(const TQColor &color)
{
_fgColor = color;
- QPalette p = palette();
- p.setColor(QColorGroup::Foreground, color);
+ TQPalette p = palette();
+ p.setColor(TQColorGroup::Foreground, color);
setPalette(p);
}
-void KGameLCD::setHighlightColor(const QColor &color)
+void KGameLCD::setHighlightColor(const TQColor &color)
{
_hlColor = color;
}
-void KGameLCD::setLeadingString(const QString &s)
+void KGameLCD::setLeadingString(const TQString &s)
{
_lead = s;
displayInt(0);
@@ -80,21 +80,21 @@ void KGameLCD::setHighlightTime(uint time)
void KGameLCD::resetColor()
{
- setColor(QColor());
+ setColor(TQColor());
}
-void KGameLCD::setColor(const QColor &color)
+void KGameLCD::setColor(const TQColor &color)
{
- const QColor &c = (color.isValid() ? color : _fgColor);
- QPalette p = palette();
- p.setColor(QColorGroup::Foreground, c);
+ const TQColor &c = (color.isValid() ? color : _fgColor);
+ TQPalette p = palette();
+ p.setColor(TQColorGroup::Foreground, c);
setPalette(p);
}
void KGameLCD::displayInt(int v)
{
int n = numDigits() - _lead.length();
- display(_lead + QString::number(v).rightJustify(n));
+ display(_lead + TQString::number(v).rightJustify(n));
}
void KGameLCD::highlight()
@@ -110,11 +110,11 @@ void KGameLCD::highlight(bool light)
}
//-----------------------------------------------------------------------------
-KGameLCDClock::KGameLCDClock(QWidget *parent, const char *name)
+KGameLCDClock::KGameLCDClock(TQWidget *parent, const char *name)
: KGameLCD(5, parent, name)
{
- _timerClock = new QTimer(this);
- connect(_timerClock, SIGNAL(timeout()), SLOT(timeoutClock()));
+ _timerClock = new TQTimer(this);
+ connect(_timerClock, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutClock()));
}
KGameLCDClock::~KGameLCDClock()
@@ -132,10 +132,10 @@ void KGameLCDClock::timeoutClock()
showTime();
}
-QString KGameLCDClock::pretty() const
+TQString KGameLCDClock::pretty() const
{
- QString sec = QString::number(_sec).rightJustify(2, '0', true);
- QString min = QString::number(_min).rightJustify(2, '0', true);
+ TQString sec = TQString::number(_sec).rightJustify(2, '0', true);
+ TQString min = TQString::number(_min).rightJustify(2, '0', true);
return min + ':' + sec;
}
@@ -175,7 +175,7 @@ void KGameLCDClock::setTime(uint sec)
showTime();
}
-void KGameLCDClock::setTime(const QString &s)
+void KGameLCDClock::setTime(const TQString &s)
{
Q_ASSERT( s.length()==5 && s[2]==':' );
uint min = kMin(s.section(':', 0, 0).toUInt(), uint(59));
@@ -188,20 +188,20 @@ void KGameLCDClock::setTime(const QString &s)
class KGameLCDList::KGameLCDListPrivate
{
public:
- QValueVector<QLabel *> _leadings;
+ TQValueVector<TQLabel *> _leadings;
};
-KGameLCDList::KGameLCDList(const QString &title, QWidget *parent,
+KGameLCDList::KGameLCDList(const TQString &title, TQWidget *parent,
const char *name)
- : QWidget(parent, name)
+ : TQWidget(parent, name)
{
init(title);
}
-KGameLCDList::KGameLCDList(QWidget *parent, const char *name)
- : QWidget(parent, name)
+KGameLCDList::KGameLCDList(TQWidget *parent, const char *name)
+ : TQWidget(parent, name)
{
- init(QString::null);
+ init(TQString::null);
}
KGameLCDList::~KGameLCDList()
@@ -209,34 +209,34 @@ KGameLCDList::~KGameLCDList()
delete d;
}
-void KGameLCDList::init(const QString &title)
+void KGameLCDList::init(const TQString &title)
{
d = new KGameLCDListPrivate;
- QGridLayout *top = new QGridLayout(this, 1, 2, 5);
+ TQGridLayout *top = new TQGridLayout(this, 1, 2, 5);
top->setColStretch(1, 1);
- _title = new QLabel(title, this);
+ _title = new TQLabel(title, this);
_title->setAlignment(AlignCenter);
top->addMultiCellWidget(_title, 0, 0, 0, 1, AlignCenter);
}
-void KGameLCDList::append(QLCDNumber *lcd)
+void KGameLCDList::append(TQLCDNumber *lcd)
{
- append(QString::null, lcd);
+ append(TQString::null, lcd);
}
-void KGameLCDList::append(const QString &leading, QLCDNumber *lcd)
+void KGameLCDList::append(const TQString &leading, TQLCDNumber *lcd)
{
uint i = size();
- QLabel *label = 0;
+ TQLabel *label = 0;
if ( !leading.isEmpty() ) {
- label = new QLabel(leading, this);
- static_cast<QGridLayout *>(layout())->addWidget(label, i+1, 0);
+ label = new TQLabel(leading, this);
+ static_cast<TQGridLayout *>(layout())->addWidget(label, i+1, 0);
}
d->_leadings.push_back(label);
_lcds.push_back(lcd);
- static_cast<QGridLayout *>(layout())->addWidget(lcd, i+1, 1);
+ static_cast<TQGridLayout *>(layout())->addWidget(lcd, i+1, 1);
}
void KGameLCDList::clear()
diff --git a/libkdegames/kgamelcd.h b/libkdegames/kgamelcd.h
index 3e6ad33c..f7d2c58d 100644
--- a/libkdegames/kgamelcd.h
+++ b/libkdegames/kgamelcd.h
@@ -20,8 +20,8 @@
#ifndef __KGAMELCD_H
#define __KGAMELCD_H
-#include <qlcdnumber.h>
-#include <qvaluevector.h>
+#include <tqlcdnumber.h>
+#include <tqvaluevector.h>
#include <kdemacros.h>
class QLabel;
@@ -29,7 +29,7 @@ class QTimer;
//-----------------------------------------------------------------------------
/**
- * This class is a visually enhanced @ref QLCDNumber:
+ * This class is a visually enhanced @ref TQLCDNumber:
* <ul>
* <li> It can show an additional string before the integer being
* displayed.</li>
@@ -43,30 +43,30 @@ class KDE_EXPORT KGameLCD : public QLCDNumber
{
Q_OBJECT
public:
- KGameLCD(uint nbDigits, QWidget *parent = 0, const char *name = 0);
+ KGameLCD(uint nbDigits, TQWidget *parent = 0, const char *name = 0);
~KGameLCD();
/**
* Set the default background color.
*/
- void setDefaultBackgroundColor(const QColor &color);
+ void setDefaultBackgroundColor(const TQColor &color);
/**
* Set the default foreground color.
*/
- void setDefaultColor(const QColor &color);
+ void setDefaultColor(const TQColor &color);
/**
* Set highlight color.
*/
- void setHighlightColor(const QColor &color);
+ void setHighlightColor(const TQColor &color);
/**
* Set the string that will be displayed before the integer number to be
* displayed. By default this string is null.
*/
- void setLeadingString(const QString &s);
+ void setLeadingString(const TQString &s);
/**
* Set the highlight duration in milliseconds. The default value is
@@ -82,7 +82,7 @@ public:
/**
* Set the foreground color.
*/
- void setColor(const QColor &color);
+ void setColor(const TQColor &color);
public slots:
/**
@@ -94,8 +94,8 @@ public slots:
/**
* Display the given integer with the (optionnal) leading string.
*
- * Note: we cannot use display(int) since QLCDNumber::display is
- * not virtual... And you cannot use QLCDNumber::intValue() to retrieve
+ * Note: we cannot use display(int) since TQLCDNumber::display is
+ * not virtual... And you cannot use TQLCDNumber::intValue() to retrieve
* the given value.
*/
void displayInt(int value);
@@ -104,10 +104,10 @@ private slots:
void timeout() { highlight(false); }
private:
- QColor _fgColor, _hlColor;
- QString _lead;
+ TQColor _fgColor, _hlColor;
+ TQString _lead;
uint _htime;
- QTimer *_timer;
+ TQTimer *_timer;
class KGameLCDPrivate;
KGameLCDPrivate *d;
@@ -127,7 +127,7 @@ class KDE_EXPORT KGameLCDClock : public KGameLCD
{
Q_OBJECT
public:
- KGameLCDClock(QWidget *parent = 0, const char *name = 0);
+ KGameLCDClock(TQWidget *parent = 0, const char *name = 0);
~KGameLCDClock();
@@ -139,7 +139,7 @@ public:
/**
* @return the time as a string to be displayed: "mm:ss".
*/
- QString pretty() const;
+ TQString pretty() const;
/**
* Set the time.
@@ -149,7 +149,7 @@ public:
/**
* Set the time (format should be "mm:ss").
*/
- void setTime(const QString &s);
+ void setTime(const TQString &s);
public slots:
/**
@@ -171,7 +171,7 @@ protected slots:
virtual void timeoutClock();
private:
- QTimer *_timerClock;
+ TQTimer *_timerClock;
uint _sec, _min;
class KGameLCDClockPrivate;
@@ -182,7 +182,7 @@ private:
//-----------------------------------------------------------------------------
/**
- * This widget holds a list of @ref QLCDNumber arranged in a vertical layout.
+ * This widget holds a list of @ref TQLCDNumber arranged in a vertical layout.
* It also shows a label at the top of the list.
*
* @since 3.2
@@ -195,55 +195,55 @@ public:
* Constructor.
*
* @param title is the content of the top label.
- * @param parent passed to the QWidget constructor
- * @param name passed to the QWidget constructor
+ * @param parent passed to the TQWidget constructor
+ * @param name passed to the TQWidget constructor
*/
- KGameLCDList(const QString &title,
- QWidget *parent = 0, const char *name = 0);
- KGameLCDList(QWidget *parent = 0, const char *name = 0);
+ KGameLCDList(const TQString &title,
+ TQWidget *parent = 0, const char *name = 0);
+ KGameLCDList(TQWidget *parent = 0, const char *name = 0);
~KGameLCDList();
/**
- * Append a QLCDNumber at the bottom of the list.
- * The QLCDNumber should have the KGameLCDList as parent.
+ * Append a TQLCDNumber at the bottom of the list.
+ * The TQLCDNumber should have the KGameLCDList as parent.
*/
- void append(QLCDNumber *lcd);
+ void append(TQLCDNumber *lcd);
/**
- * Append a QLCDNumber at the bottom of the list.
- * The QLCDNumber should have the KGameLCDList as parent.
+ * Append a TQLCDNumber at the bottom of the list.
+ * The TQLCDNumber should have the KGameLCDList as parent.
*/
- void append(const QString &leading, QLCDNumber *lcd);
+ void append(const TQString &leading, TQLCDNumber *lcd);
/**
- * Delete all @ref QLCDNumber and clear the list.
+ * Delete all @ref TQLCDNumber and clear the list.
*/
void clear();
/**
* @return the title label.
*/
- QLabel *title() const { return _title; }
+ TQLabel *title() const { return _title; }
/**
- * @return the QLCDNumber at index @param i
+ * @return the TQLCDNumber at index @param i
*/
- QLCDNumber *lcd(uint i) const { return _lcds[i]; }
+ TQLCDNumber *lcd(uint i) const { return _lcds[i]; }
/**
- * @return the number of QLCDNumber in the list.
+ * @return the number of TQLCDNumber in the list.
*/
uint size() const { return _lcds.size(); }
private:
- QLabel *_title;
- QValueVector<QLCDNumber *> _lcds;
+ TQLabel *_title;
+ TQValueVector<TQLCDNumber *> _lcds;
class KGameLCDListPrivate;
KGameLCDListPrivate *d;
- void init(const QString &title);
+ void init(const TQString &title);
};
#endif
diff --git a/libkdegames/kgamemisc.cpp b/libkdegames/kgamemisc.cpp
index bfedd11c..1c318476 100644
--- a/libkdegames/kgamemisc.cpp
+++ b/libkdegames/kgamemisc.cpp
@@ -20,7 +20,7 @@
$Id$
*/
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <krandomsequence.h>
#include <klocale.h>
@@ -48,9 +48,9 @@ KGameMisc::~KGameMisc()
// delete d;
}
-QString KGameMisc::randomName()// do we need i18n? I think yes
+TQString KGameMisc::randomName()// do we need i18n? I think yes
{
- QStringList names = QStringList::split( QChar(' '),
+ TQStringList names = TQStringList::split( TQChar(' '),
i18n( "A list of language typical names ( for games ), separated by spaces",
"Adam Alex Andreas Andrew Bart Ben Bernd Bill "
"Chris Chuck Daniel Don Duncan Ed Emily Eric "
diff --git a/libkdegames/kgamemisc.h b/libkdegames/kgamemisc.h
index 526bb0ae..694a6a00 100644
--- a/libkdegames/kgamemisc.h
+++ b/libkdegames/kgamemisc.h
@@ -22,7 +22,7 @@
#ifndef __KGAMEMISC_H__
#define __KGAMEMISC_H__
-#include <qstring.h>
+#include <tqstring.h>
#include <kdemacros.h>
class KGameMiscPrivate;
/**
@@ -36,7 +36,7 @@ public:
KGameMisc();
~KGameMisc();
- static QString randomName();
+ static TQString randomName();
private:
KGameMiscPrivate* d;
diff --git a/libkdegames/kgameprogress.cpp b/libkdegames/kgameprogress.cpp
index 861dd454..c9f122fb 100644
--- a/libkdegames/kgameprogress.cpp
+++ b/libkdegames/kgameprogress.cpp
@@ -19,36 +19,36 @@
* KGameProgress -- a progress indicator widget for KDE.
*/
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qstring.h>
-#include <qregexp.h>
-#include <qstyle.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqstring.h>
+#include <tqregexp.h>
+#include <tqstyle.h>
#include "kgameprogress.h"
#include <kapplication.h>
-KGameProgress::KGameProgress(QWidget *parent, const char *name)
- : QFrame(parent, name),
- QRangeControl(0, 100, 1, 10, 0),
+KGameProgress::KGameProgress(TQWidget *parent, const char *name)
+ : TQFrame(parent, name),
+ TQRangeControl(0, 100, 1, 10, 0),
orient(Horizontal)
{
initialize();
}
-KGameProgress::KGameProgress(Orientation orientation, QWidget *parent, const char *name)
- : QFrame(parent, name),
- QRangeControl(0, 100, 1, 10, 0),
+KGameProgress::KGameProgress(Orientation orientation, TQWidget *parent, const char *name)
+ : TQFrame(parent, name),
+ TQRangeControl(0, 100, 1, 10, 0),
orient(orientation)
{
initialize();
}
KGameProgress::KGameProgress(int minValue, int maxValue, int value,
- Orientation orientation, QWidget *parent, const char *name)
- : QFrame(parent, name),
- QRangeControl(minValue, maxValue, 1, 10, value),
+ Orientation orientation, TQWidget *parent, const char *name)
+ : TQFrame(parent, name),
+ TQRangeControl(minValue, maxValue, 1, 10, value),
orient(orientation)
{
initialize();
@@ -72,14 +72,14 @@ void KGameProgress::initialize()
bar_style = Solid;
text_enabled = TRUE;
setBackgroundMode( PaletteBackground );
- connect(kapp, SIGNAL(appearanceChanged()), this, SLOT(paletteChange()));
+ connect(kapp, TQT_SIGNAL(appearanceChanged()), this, TQT_SLOT(paletteChange()));
paletteChange();
}
void KGameProgress::paletteChange()
{
- QPalette p = kapp->palette();
- const QColorGroup &colorGroup = p.active();
+ TQPalette p = kapp->palette();
+ const TQColorGroup &colorGroup = p.active();
if (!use_supplied_bar_color)
bar_color = colorGroup.highlight();
bar_text_color = colorGroup.highlightedText();
@@ -90,17 +90,17 @@ void KGameProgress::paletteChange()
}
-void KGameProgress::setBarPixmap(const QPixmap &pixmap)
+void KGameProgress::setBarPixmap(const TQPixmap &pixmap)
{
if (pixmap.isNull())
return;
if (bar_pixmap)
delete bar_pixmap;
- bar_pixmap = new QPixmap(pixmap);
+ bar_pixmap = new TQPixmap(pixmap);
}
-void KGameProgress::setBarColor(const QColor &color)
+void KGameProgress::setBarColor(const TQColor &color)
{
bar_color = color;
use_supplied_bar_color = true;
@@ -128,7 +128,7 @@ void KGameProgress::setOrientation(Orientation orientation)
void KGameProgress::setValue(int value)
{
- QRangeControl::setValue(value);
+ TQRangeControl::setValue(value);
}
void KGameProgress::setTextEnabled(bool enable)
@@ -136,12 +136,12 @@ void KGameProgress::setTextEnabled(bool enable)
text_enabled = enable;
}
-const QColor & KGameProgress::barColor() const
+const TQColor & KGameProgress::barColor() const
{
return bar_color;
}
-const QPixmap * KGameProgress::barPixmap() const
+const TQPixmap * KGameProgress::barPixmap() const
{
return bar_pixmap;
}
@@ -151,9 +151,9 @@ bool KGameProgress::textEnabled() const
return text_enabled;
}
-QSize KGameProgress::sizeHint() const
+TQSize KGameProgress::sizeHint() const
{
- QSize s( size() );
+ TQSize s( size() );
if(orientation() == KGameProgress::Vertical) {
s.setWidth(24);
@@ -164,17 +164,17 @@ QSize KGameProgress::sizeHint() const
return s;
}
-QSize KGameProgress::minimumSizeHint() const
+TQSize KGameProgress::minimumSizeHint() const
{
return sizeHint();
}
-QSizePolicy KGameProgress::sizePolicy() const
+TQSizePolicy KGameProgress::sizePolicy() const
{
if ( orientation()==KGameProgress::Vertical )
- return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
+ return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding );
else
- return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed );
}
KGameProgress::Orientation KGameProgress::orientation() const
@@ -206,48 +206,48 @@ void KGameProgress::rangeChange()
emit percentageChanged(recalcValue(100));
}
-void KGameProgress::styleChange(QStyle&)
+void KGameProgress::styleChange(TQStyle&)
{
adjustStyle();
}
void KGameProgress::adjustStyle()
{
- switch (style().styleHint(QStyle::SH_GUIStyle)) {
+ switch (style().styleHint(TQStyle::SH_GUIStyle)) {
case WindowsStyle:
- setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
+ setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
break;
case MotifStyle:
default:
- setFrameStyle(QFrame::Panel | QFrame::Sunken);
+ setFrameStyle(TQFrame::Panel | TQFrame::Sunken);
setLineWidth( 2 );
break;
}
update();
}
-void KGameProgress::paletteChange( const QPalette &p )
+void KGameProgress::paletteChange( const TQPalette &p )
{
// This never gets called for global color changes
// because we call setPalette() ourselves.
- QFrame::paletteChange(p);
+ TQFrame::paletteChange(p);
}
-void KGameProgress::drawText(QPainter *p)
+void KGameProgress::drawText(TQPainter *p)
{
- QRect r(contentsRect());
- //QColor c(bar_color.rgb() ^ backgroundColor().rgb());
+ TQRect r(contentsRect());
+ //TQColor c(bar_color.rgb() ^ backgroundColor().rgb());
// Rik: Replace the tags '%p', '%v' and '%m' with the current percentage,
// the current value and the maximum value respectively.
- QString s(format_);
+ TQString s(format_);
- s.replace(QRegExp(QString::fromLatin1("%p")), QString::number(recalcValue(100)));
- s.replace(QRegExp(QString::fromLatin1("%v")), QString::number(value()));
- s.replace(QRegExp(QString::fromLatin1("%m")), QString::number(maxValue()));
+ s.replace(TQRegExp(TQString::fromLatin1("%p")), TQString::number(recalcValue(100)));
+ s.replace(TQRegExp(TQString::fromLatin1("%v")), TQString::number(value()));
+ s.replace(TQRegExp(TQString::fromLatin1("%m")), TQString::number(maxValue()));
p->setPen(text_color);
- QFont font = p->font();
+ TQFont font = p->font();
font.setBold(true);
p->setFont(font);
//p->setRasterOp(XorROP);
@@ -257,11 +257,11 @@ void KGameProgress::drawText(QPainter *p)
p->drawText(r, AlignCenter, s);
}
-void KGameProgress::drawContents(QPainter *p)
+void KGameProgress::drawContents(TQPainter *p)
{
- QRect cr = contentsRect(), er = cr;
+ TQRect cr = contentsRect(), er = cr;
fr = cr;
- QBrush fb(bar_color), eb(backgroundColor());
+ TQBrush fb(bar_color), eb(backgroundColor());
if (bar_pixmap)
fb.setPixmap(*bar_pixmap);
@@ -292,7 +292,7 @@ void KGameProgress::drawContents(QPainter *p)
if (orient == Horizontal) {
fr.setHeight(cr.height() - 2 * margin);
fr.setWidth((int)(0.67 * fr.height()));
- fr.moveTopLeft(QPoint(cr.left() + margin, cr.top() + margin));
+ fr.moveTopLeft(TQPoint(cr.left() + margin, cr.top() + margin));
dx = fr.width() + margin;
dy = 0;
max = (cr.width() - margin) / (fr.width() + margin) + 1;
@@ -300,7 +300,7 @@ void KGameProgress::drawContents(QPainter *p)
} else {
fr.setWidth(cr.width() - 2 * margin);
fr.setHeight((int)(0.67 * fr.width()));
- fr.moveBottomLeft(QPoint(cr.left() + margin, cr.bottom() - margin));
+ fr.moveBottomLeft(TQPoint(cr.left() + margin, cr.bottom() - margin));
dx = 0;
dy = - (fr.height() + margin);
max = (cr.height() - margin) / (fr.height() + margin) + 1;
@@ -332,12 +332,12 @@ void KGameProgress::drawContents(QPainter *p)
drawText(p);
}
-void KGameProgress::setFormat(const QString & format)
+void KGameProgress::setFormat(const TQString & format)
{
format_ = format;
}
-QString KGameProgress::format() const
+TQString KGameProgress::format() const
{
return format_;
}
diff --git a/libkdegames/kgameprogress.h b/libkdegames/kgameprogress.h
index d6a353ac..d4cebe7b 100644
--- a/libkdegames/kgameprogress.h
+++ b/libkdegames/kgameprogress.h
@@ -24,13 +24,13 @@
#ifndef _KPROGRES_H
#define _KPROGRES_H "$Id$"
-#include <qframe.h>
-#include <qrangecontrol.h>
+#include <tqframe.h>
+#include <tqrangecontrol.h>
#include <kdemacros.h>
/**
* @short A progress indicator widget.
*
- * KGameProgress is derived from QFrame and QRangeControl, so
+ * KGameProgress is derived from TQFrame and TQRangeControl, so
* you can use all the methods from those classes. The only difference
* is that setValue() is now made a slot, so you can connect
* stuff to it.
@@ -47,14 +47,14 @@
* @author Martynas Kunigelis
* @version $Id$
*/
-class KDE_EXPORT KGameProgress : public QFrame, public QRangeControl
+class KDE_EXPORT KGameProgress : public TQFrame, public QRangeControl
{
Q_OBJECT
Q_ENUMS( BarStyle )
Q_PROPERTY( int value READ value WRITE setValue)
Q_PROPERTY( BarStyle barStyle READ barStyle WRITE setBarStyle )
- Q_PROPERTY( QColor barColor READ barColor WRITE setBarColor )
- Q_PROPERTY( QPixmap barPixmap READ barPixmap WRITE setBarPixmap )
+ Q_PROPERTY( TQColor barColor READ barColor WRITE setBarColor )
+ Q_PROPERTY( TQPixmap barPixmap READ barPixmap WRITE setBarPixmap )
Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
Q_PROPERTY( bool textEnabled READ textEnabled WRITE setTextEnabled )
@@ -70,18 +70,18 @@ public:
/**
* Construct a horizontal progress bar.
*/
- KGameProgress(QWidget *parent=0, const char *name=0);
+ KGameProgress(TQWidget *parent=0, const char *name=0);
/**
* Construct a progress bar with orientation @p orient.
*/
- KGameProgress(Orientation orient, QWidget *parent=0, const char *name=0);
+ KGameProgress(Orientation orient, TQWidget *parent=0, const char *name=0);
/**
* Construct a progress bar with minimum, maximum and initial values.
*/
KGameProgress(int minValue, int maxValue, int value, Orientation,
- QWidget *parent=0, const char *name=0);
+ TQWidget *parent=0, const char *name=0);
/**
* Destruct the progress bar.
@@ -98,12 +98,12 @@ public:
/**
* Set the color of the progress bar.
*/
- void setBarColor(const QColor &);
+ void setBarColor(const TQColor &);
/**
* Set a pixmap to be shown in the progress bar.
*/
- void setBarPixmap(const QPixmap &);
+ void setBarPixmap(const TQPixmap &);
/**
* Set the orientation of the progress bar.
@@ -129,21 +129,21 @@ public:
* Retrieve the bar color.
* @see setBarColor()
*/
- const QColor &barColor() const;
+ const TQColor &barColor() const;
/**
* Retrieve the bar pixmap.
*
* @see setBarPixmap()
*/
- const QPixmap *barPixmap() const;
+ const TQPixmap *barPixmap() const;
/**
* Retrive the current status
*
* @see setValue()
*/
- int value() const { return QRangeControl::value(); }
+ int value() const { return TQRangeControl::value(); }
/**
* Retrive the orientation of the progress bar.
*
@@ -161,21 +161,21 @@ public:
/**
*/
- virtual QSize sizeHint() const;
+ virtual TQSize sizeHint() const;
/**
*/
- virtual QSize minimumSizeHint() const;
+ virtual TQSize minimumSizeHint() const;
/**
*/
- virtual QSizePolicy sizePolicy() const;
+ virtual TQSizePolicy sizePolicy() const;
/**
* Retrieve the current format for printing status text.
* @see setFormat()
*/
- QString format() const;
+ TQString format() const;
public slots:
@@ -187,7 +187,7 @@ public slots:
* @param format %p is replaced by percentage done, %v is replaced by actual
* value, %m is replaced by the maximum value.
*/
- void setFormat(const QString & format);
+ void setFormat(const TQString & format);
/**
* Set the current value of the progress bar to @p value.
@@ -220,31 +220,31 @@ protected:
void rangeChange();
/**
*/
- void styleChange( QStyle& );
+ void styleChange( TQStyle& );
/**
*/
- void paletteChange( const QPalette & );
+ void paletteChange( const TQPalette & );
/**
*/
- void drawContents( QPainter * );
+ void drawContents( TQPainter * );
private slots:
void paletteChange();
private:
- QPixmap *bar_pixmap;
+ TQPixmap *bar_pixmap;
bool use_supplied_bar_color;
- QColor bar_color;
- QColor bar_text_color;
- QColor text_color;
- QRect fr;
+ TQColor bar_color;
+ TQColor bar_text_color;
+ TQColor text_color;
+ TQRect fr;
BarStyle bar_style;
Orientation orient;
bool text_enabled;
- QString format_;
+ TQString format_;
void initialize();
int recalcValue(int);
- void drawText(QPainter *);
+ void drawText(TQPainter *);
void adjustStyle();
class KGameProgressPrivate;
diff --git a/libkdegames/kgrid2d.h b/libkdegames/kgrid2d.h
index f9dfd8dd..22a3c19d 100644
--- a/libkdegames/kgrid2d.h
+++ b/libkdegames/kgrid2d.h
@@ -22,9 +22,9 @@
#include <math.h>
-#include <qpair.h>
-#include <qvaluelist.h>
-#include <qvaluevector.h>
+#include <tqpair.h>
+#include <tqvaluelist.h>
+#include <tqvaluevector.h>
#include <kglobal.h>
@@ -42,7 +42,7 @@ namespace KGrid2D
* This type represents a list of @ref Coord.
* @since 3.2
*/
- typedef QValueList<Coord> CoordList;
+ typedef TQValueList<Coord> CoordList;
}
inline KGrid2D::Coord
@@ -72,11 +72,11 @@ minimum(const KGrid2D::Coord &c1, const KGrid2D::Coord &c2) {
return KGrid2D::Coord(kMin(c1.first, c2.first), kMin(c1.second, c2.second));
}
-inline QTextStream &operator <<(QTextStream &s, const KGrid2D::Coord &c) {
+inline TQTextStream &operator <<(TQTextStream &s, const KGrid2D::Coord &c) {
return s << '(' << c.second << ", " << c.first << ')';
}
-inline QTextStream &operator <<(QTextStream &s, const KGrid2D::CoordList &list)
+inline TQTextStream &operator <<(TQTextStream &s, const KGrid2D::CoordList &list)
{
for(KGrid2D::CoordList::const_iterator i=list.begin(); i!=list.end(); ++i)
s << *i;
@@ -200,19 +200,19 @@ class Generic
protected:
uint _width, _height;
- QValueVector<Type> _vector;
+ TQValueVector<Type> _vector;
};
}
template <class Type>
-QDataStream &operator <<(QDataStream &s, const KGrid2D::Generic<Type> &m) {
+TQDataStream &operator <<(TQDataStream &s, const KGrid2D::Generic<Type> &m) {
s << (Q_UINT32)m.width() << (Q_UINT32)m.height();
for (uint i=0; i<m.size(); i++) s << m[i];
return s;
}
template <class Type>
-QDataStream &operator >>(QDataStream &s, KGrid2D::Generic<Type> &m) {
+TQDataStream &operator >>(TQDataStream &s, KGrid2D::Generic<Type> &m) {
Q_UINT32 w, h;
s >> w >> h;
m.resize(w, h);
diff --git a/libkdegames/kstdgameaction.cpp b/libkdegames/kstdgameaction.cpp
index 53b8f16c..f37af6cb 100644
--- a/libkdegames/kstdgameaction.cpp
+++ b/libkdegames/kstdgameaction.cpp
@@ -32,7 +32,7 @@ KStdGameAction::KStdGameAction()
KStdGameAction::~KStdGameAction()
{}
-KAction *KStdGameAction::action(StdGameAction act_enum, const QObject *recvr,
+KAction *KStdGameAction::action(StdGameAction act_enum, const TQObject *recvr,
const char *slot, KActionCollection *parent,
const char *name)
{
@@ -96,14 +96,14 @@ static const KStdGameActionInfo* infoPtr( KStdGameAction::StdGameAction id )
KAction* KStdGameAction::create(StdGameAction id, const char *name,
- const QObject *recvr, const char *slot,
+ const TQObject *recvr, const char *slot,
KActionCollection* parent )
{
KAction* pAction = 0;
const KStdGameActionInfo* pInfo = infoPtr( id );
kdDebug(125) << "KStdGameAction::create( " << id << "=" << (pInfo ? pInfo->psName : (const char*)0) << ", " << parent << ", " << name << " )" << endl;
if( pInfo ) {
- QString sLabel = i18n(pInfo->psLabel);
+ TQString sLabel = i18n(pInfo->psLabel);
KShortcut cut = (pInfo->globalAccel==KStdAccel::AccelNone
? KShortcut(pInfo->shortcut)
: KStdAccel::shortcut(pInfo->globalAccel));
@@ -137,73 +137,73 @@ const char* KStdGameAction::name( StdGameAction id )
return (pInfo) ? pInfo->psName : 0;
}
-KAction *KStdGameAction::gameNew(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::gameNew(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(New, name, recvr, slot, parent); }
-KAction *KStdGameAction::load(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::load(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Load, name, recvr, slot, parent); }
-KRecentFilesAction *KStdGameAction::loadRecent(const QObject *recvr, const char *slot,
+KRecentFilesAction *KStdGameAction::loadRecent(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return static_cast<KRecentFilesAction *>(KStdGameAction::create(LoadRecent, name, recvr, slot, parent)); }
-KAction *KStdGameAction::save(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::save(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Save, name, recvr, slot, parent); }
-KAction *KStdGameAction::saveAs(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::saveAs(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(SaveAs, name, recvr, slot, parent); }
-KAction *KStdGameAction::end(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::end(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(End, name, recvr, slot, parent); }
-KToggleAction *KStdGameAction::pause(const QObject *recvr, const char *slot,
+KToggleAction *KStdGameAction::pause(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return static_cast<KToggleAction *>(KStdGameAction::create(Pause, name, recvr, slot, parent)); }
-KAction *KStdGameAction::highscores(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::highscores(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Highscores, name, recvr, slot, parent); }
-KAction *KStdGameAction::print(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::print(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Print, name, recvr, slot, parent); }
-KAction *KStdGameAction::quit(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::quit(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Quit, name, recvr, slot, parent); }
-KAction *KStdGameAction::repeat(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::repeat(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Repeat, name, recvr, slot, parent); }
-KAction *KStdGameAction::undo(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::undo(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Undo, name, recvr, slot, parent); }
-KAction *KStdGameAction::redo(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::redo(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Redo, name, recvr, slot, parent); }
-KAction *KStdGameAction::roll(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::roll(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Roll, name, recvr, slot, parent); }
-KAction *KStdGameAction::endTurn(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::endTurn(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(EndTurn, name, recvr, slot, parent); }
-KAction *KStdGameAction::carddecks(const QObject *recvr, const char *slot,
+KAction *KStdGameAction::carddecks(const TQObject *recvr, const char *slot,
KActionCollection *parent, const char *name )
{ return KStdGameAction::create(Carddecks, name, recvr, slot, parent); }
-KAction *KStdGameAction::configureHighscores(const QObject*recvr, const char *slot,
+KAction *KStdGameAction::configureHighscores(const TQObject*recvr, const char *slot,
KActionCollection *parent, const char *name)
{ return KStdGameAction::create(ConfigureHighscores, name, recvr, slot, parent); }
-KAction *KStdGameAction::hint(const QObject*recvr, const char *slot,
+KAction *KStdGameAction::hint(const TQObject*recvr, const char *slot,
KActionCollection *parent, const char *name)
{ return KStdGameAction::create(Hint, name, recvr, slot, parent); }
-KToggleAction *KStdGameAction::demo(const QObject*recvr, const char *slot,
+KToggleAction *KStdGameAction::demo(const TQObject*recvr, const char *slot,
KActionCollection *parent, const char *name)
{ return static_cast<KToggleAction *>(KStdGameAction::create(Demo, name, recvr, slot, parent)); }
-KAction *KStdGameAction::solve(const QObject*recvr, const char *slot,
+KAction *KStdGameAction::solve(const TQObject*recvr, const char *slot,
KActionCollection *parent, const char *name)
{ return KStdGameAction::create(Solve, name, recvr, slot, parent); }
-KSelectAction *KStdGameAction::chooseGameType(const QObject*recvr, const char *slot,
+KSelectAction *KStdGameAction::chooseGameType(const TQObject*recvr, const char *slot,
KActionCollection *parent, const char *name)
{ return static_cast<KSelectAction *>(KStdGameAction::create(ChooseGameType, name, recvr, slot, parent)); }
-KAction *KStdGameAction::restart(const QObject*recvr, const char *slot,
+KAction *KStdGameAction::restart(const TQObject*recvr, const char *slot,
KActionCollection *parent, const char *name)
{ return KStdGameAction::create(Restart, name, recvr, slot, parent); }
diff --git a/libkdegames/kstdgameaction.h b/libkdegames/kstdgameaction.h
index a38082af..dd653165 100644
--- a/libkdegames/kstdgameaction.h
+++ b/libkdegames/kstdgameaction.h
@@ -78,14 +78,14 @@ public:
* @since 3.2
*/
static KAction* create( StdGameAction id, const char *name,
- const QObject *recvr, const char *slot,
+ const TQObject *recvr, const char *slot,
KActionCollection* parent );
/**
* @since 3.2
*/
static KAction* create( StdGameAction id,
- const QObject *recvr, const char *slot,
+ const TQObject *recvr, const char *slot,
KActionCollection* parent )
{ return create( id, 0, recvr, slot, parent ); }
@@ -95,7 +95,7 @@ public:
* KStdGameAction::StdGameAction enum.
* @deprecated
*/
- static KAction *action(StdGameAction act_enum, const QObject *recvr = 0,
+ static KAction *action(StdGameAction act_enum, const TQObject *recvr = 0,
const char *slot = 0, KActionCollection *parent = 0,
const char *name = 0L );
@@ -114,43 +114,43 @@ public:
/**
* Start a new game
**/
- static KAction *gameNew(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *gameNew(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Load a previousely saved game
*/
- static KAction *load(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *load(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Load a recently loaded game.
*/
- static KRecentFilesAction *loadRecent(const QObject *recvr = 0, const char *slot = 0,
+ static KRecentFilesAction *loadRecent(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Save the current game.
*/
- static KAction *save(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *save(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Save the current game under a different filename.
*/
- static KAction *saveAs(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *saveAs(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Pause the game
**/
- static KToggleAction *pause(const QObject *recvr = 0, const char *slot = 0,
+ static KToggleAction *pause(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Show the highscores.
*/
- static KAction *highscores(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *highscores(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
@@ -158,20 +158,20 @@ public:
* End the current game, but do not quit the program. Think of a "close"
* entry.
*/
- static KAction *end(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *end(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Print the current screen? Game? Whatever - hardly used in games but there
* is at least one example (ktuberling)
*/
- static KAction *print(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *print(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Quit the game.
*/
- static KAction *quit(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *quit(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
@@ -179,81 +179,81 @@ public:
/**
* Repeat the last move.
**/
- static KAction *repeat(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *repeat(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Undo the last move
**/
- static KAction *undo(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *undo(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Redo the last move (which has been undone)
**/
- static KAction *redo(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *redo(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Roll die or dice
**/
- static KAction *roll(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *roll(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* End the current turn (not the game). Usually to let the next player
* start
**/
- static KAction *endTurn(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *endTurn(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Display configure carddecks dialog.
*/
- static KAction *carddecks(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *carddecks(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Display configure highscores dialog.
* @since 3.2
*/
- static KAction *configureHighscores(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *configureHighscores(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Give an advice/hint.
* @since 3.2
*/
- static KAction *hint(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *hint(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Show a demo.
* @since 3.2
*/
- static KToggleAction *demo(const QObject *recvr = 0, const char *slot = 0,
+ static KToggleAction *demo(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Solve the game.
* @since 3.2
*/
- static KAction *solve(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *solve(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Choose game type.
* @since 3.2
*/
- static KSelectAction *chooseGameType(const QObject *recvr = 0, const char *slot = 0,
+ static KSelectAction *chooseGameType(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
/**
* Restart game.
* @since 3.2
*/
- static KAction *restart(const QObject *recvr = 0, const char *slot = 0,
+ static KAction *restart(const TQObject *recvr = 0, const char *slot = 0,
KActionCollection *parent = 0, const char *name = 0L );
};