summaryrefslogtreecommitdiffstats
path: root/kpat
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 /kpat
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 'kpat')
-rw-r--r--kpat/card.cpp26
-rw-r--r--kpat/card.h18
-rw-r--r--kpat/cardmaps.cpp46
-rw-r--r--kpat/cardmaps.h18
-rw-r--r--kpat/dealer.cpp218
-rw-r--r--kpat/dealer.h64
-rw-r--r--kpat/fortyeight.cpp14
-rw-r--r--kpat/fortyeight.h6
-rw-r--r--kpat/freecell.cpp32
-rw-r--r--kpat/freecell.h6
-rw-r--r--kpat/gamestatsimpl.cpp18
-rw-r--r--kpat/gamestatsimpl.h2
-rw-r--r--kpat/golf.cpp8
-rw-r--r--kpat/golf.h2
-rw-r--r--kpat/grandf.cpp6
-rw-r--r--kpat/grandf.h4
-rw-r--r--kpat/gypsy.cpp2
-rw-r--r--kpat/hint.h2
-rw-r--r--kpat/klondike.cpp6
-rw-r--r--kpat/mod3.cpp2
-rw-r--r--kpat/napoleon.cpp2
-rw-r--r--kpat/pile.cpp28
-rw-r--r--kpat/pile.h8
-rw-r--r--kpat/pwidget.cpp154
-rw-r--r--kpat/pwidget.h12
-rw-r--r--kpat/spider.cpp8
-rw-r--r--kpat/spider.h4
27 files changed, 358 insertions, 358 deletions
diff --git a/kpat/card.cpp b/kpat/card.cpp
index 983a901d..a6529bd1 100644
--- a/kpat/card.cpp
+++ b/kpat/card.cpp
@@ -21,7 +21,7 @@
#include <math.h>
#include <assert.h>
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kdebug.h>
@@ -38,14 +38,14 @@ static const char *rank_names[] = {"Ace", "Two", "Three", "Four", "Five", "Six"
const int Card::RTTI = 1001;
-Card::Card( Rank r, Suit s, QCanvas* _parent )
- : QCanvasRectangle( _parent ),
+Card::Card( Rank r, Suit s, TQCanvas* _parent )
+ : TQCanvasRectangle( _parent ),
m_suit( s ), m_rank( r ),
m_source(0), scaleX(1.0), scaleY(1.0), tookDown(false)
{
// Set the name of the card
// FIXME: i18n()
- m_name = QString("%1 %2").arg(suit_names[s-1]).arg(rank_names[r-1]).utf8();
+ m_name = TQString("%1 %2").arg(suit_names[s-1]).arg(rank_names[r-1]).utf8();
// Default for the card is face up, standard size.
m_faceup = true;
@@ -77,7 +77,7 @@ Card::~Card()
// Return the pixmap of the card
//
-QPixmap Card::pixmap() const
+TQPixmap Card::pixmap() const
{
return cardMap::self()->image( m_rank, m_suit );
}
@@ -96,9 +96,9 @@ void Card::turn( bool _faceup )
// Draw the card on the painter 'p'.
//
-void Card::draw( QPainter &p )
+void Card::draw( TQPainter &p )
{
- QPixmap side;
+ TQPixmap side;
// Get the image to draw (front / back)
if( isFaceUp() )
@@ -108,7 +108,7 @@ void Card::draw( QPainter &p )
// Rescale the image if necessary.
if (scaleX <= 0.98 || scaleY <= 0.98) {
- QWMatrix s;
+ TQWMatrix s;
s.scale( scaleX, scaleY );
side = side.xForm( s );
int xoff = side.width() / 2;
@@ -122,7 +122,7 @@ void Card::draw( QPainter &p )
void Card::moveBy(double dx, double dy)
{
- QCanvasRectangle::moveBy(dx, dy);
+ TQCanvasRectangle::moveBy(dx, dy);
}
@@ -215,7 +215,7 @@ int Card::Hz = 0;
void Card::setZ(double z)
{
- QCanvasRectangle::setZ(z);
+ TQCanvasRectangle::setZ(z);
if (z > Hz)
Hz = int(z);
}
@@ -293,7 +293,7 @@ void Card::flipTo(int x2, int y2, int steps)
// Advance a card animation one step. This function adds flipping of
-// the card to the translation animation that QCanvasRectangle offers.
+// the card to the translation animation that TQCanvasRectangle offers.
//
void Card::advance(int stage)
{
@@ -322,7 +322,7 @@ void Card::advance(int stage)
}
// Animate the translation of the card.
- QCanvasRectangle::advance(stage);
+ TQCanvasRectangle::advance(stage);
}
@@ -344,7 +344,7 @@ void Card::setAnimated(bool anim)
setZ(m_destZ);
}
- QCanvasRectangle::setAnimated(anim);
+ TQCanvasRectangle::setAnimated(anim);
}
diff --git a/kpat/card.h b/kpat/card.h
index 61f07399..8ec96bb9 100644
--- a/kpat/card.h
+++ b/kpat/card.h
@@ -27,7 +27,7 @@
#ifndef PATIENCE_CARD
#define PATIENCE_CARD
-#include <qcanvas.h>
+#include <tqcanvas.h>
// The following classes are defined in other headers:
class cardPos;
@@ -38,14 +38,14 @@ class Card;
// A list of cards. Used in many places.
-typedef QValueList<Card*> CardList;
+typedef TQValueList<Card*> CardList;
// In kpat, a Card is an object that has at least two purposes:
// - It has card properties (Suit, Rank, etc)
-// - It is a graphic entity on a QCanvas that can be moved around.
+// - It is a graphic entity on a TQCanvas that can be moved around.
//
-class Card: public QObject, public QCanvasRectangle {
+class Card: public TQObject, public TQCanvasRectangle {
Q_OBJECT
public:
@@ -53,19 +53,19 @@ public:
enum Rank { None = 0, Ace = 1, Two, Three, Four, Five, Six, Seven,
Eight, Nine, Ten, Jack, Queen, King };
- Card( Rank r, Suit s, QCanvas *parent=0);
+ Card( Rank r, Suit s, TQCanvas *parent=0);
virtual ~Card();
// Properties of the card.
Suit suit() const { return m_suit; }
Rank rank() const { return m_rank; }
- const QString name() const { return m_name; }
+ const TQString name() const { return m_name; }
// Some basic tests.
bool isRed() const { return m_suit==Diamonds || m_suit==Hearts; }
bool isFaceUp() const { return m_faceup; }
- QPixmap pixmap() const;
+ TQPixmap pixmap() const;
void turn(bool faceup = true);
@@ -95,14 +95,14 @@ signals:
void stoped(Card *c);
protected:
- void draw( QPainter &p ); // Redraw the card.
+ void draw( TQPainter &p ); // Redraw the card.
void advance(int stage);
private:
// The card values.
Suit m_suit;
Rank m_rank;
- QString m_name;
+ TQString m_name;
// Grapics properties.
bool m_faceup; // True if card lies with the face up.
diff --git a/kpat/cardmaps.cpp b/kpat/cardmaps.cpp
index 5a2decae..563f4bfe 100644
--- a/kpat/cardmaps.cpp
+++ b/kpat/cardmaps.cpp
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <unistd.h>
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kconfig.h>
@@ -35,7 +35,7 @@
#include <klocale.h>
#include "version.h"
#include <kstaticdeleter.h>
-#include <qimage.h>
+#include <tqimage.h>
#include <kimageeffect.h>
#include <kcarddialog.h>
#include <kglobalsettings.h>
@@ -44,7 +44,7 @@
cardMap *cardMap::_self = 0;
static KStaticDeleter<cardMap> cms;
-cardMap::cardMap(const QColor &dim) : dimcolor(dim)
+cardMap::cardMap(const TQColor &dim) : dimcolor(dim)
{
assert(!_self);
@@ -55,17 +55,17 @@ cardMap::cardMap(const QColor &dim) : dimcolor(dim)
KConfig *config = kapp->config();
KConfigGroupSaver cs(config, settings_group );
- QString bg = config->readEntry( "Back", KCardDialog::getDefaultDeck());
+ TQString bg = config->readEntry( "Back", KCardDialog::getDefaultDeck());
setBackSide( bg, false);
- QString dir = config->readEntry("Cards", KCardDialog::getDefaultCardDir());
+ TQString dir = config->readEntry("Cards", KCardDialog::getDefaultCardDir());
setCardDir( dir );
cms.setObject(_self, this);
// kdDebug(11111) << "card " << CARDX << " " << CARDY << endl;
}
-bool cardMap::setCardDir( const QString &dir)
+bool cardMap::setCardDir( const TQString &dir)
{
KConfig *config = kapp->config();
KConfigGroupSaver cs(config, settings_group );
@@ -74,13 +74,13 @@ bool cardMap::setCardDir( const QString &dir)
// may take a while (approx. 3 seconds on my AMD K6PR200)
bool animate = config->readBoolEntry( "Animation", true);
- QWidget* w = 0;
- QPainter p;
- QTime t1, t2;
+ TQWidget* w = 0;
+ TQPainter p;
+ TQTime t1, t2;
- QString imgname = KCardDialog::getCardPath(dir, 11);
+ TQString imgname = KCardDialog::getCardPath(dir, 11);
- QImage image;
+ TQImage image;
image.load(imgname);
if( image.isNull()) {
kdDebug(11111) << "cannot load card pixmap \"" << imgname << "\" in " << dir << "\n";
@@ -96,15 +96,15 @@ bool cardMap::setCardDir( const QString &dir)
card_height = image.height();
const int diff_x_between_cards = QMAX(card_width / 9, 1);
- QString wait_message = i18n("please wait, loading cards...");
- QString greeting = i18n("KPatience - a Solitaire game");
+ TQString wait_message = i18n("please wait, loading cards...");
+ TQString greeting = i18n("KPatience - a Solitaire game");
const int greeting_width = 20 + diff_x_between_cards * 52 + card_width;
if( animate ) {
- t1 = QTime::currentTime();
- w = new QWidget( 0, "", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
- QRect dg = KGlobalSettings::splashScreenDesktopGeometry();
+ t1 = TQTime::currentTime();
+ w = new TQWidget( 0, "", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
+ TQRect dg = KGlobalSettings::splashScreenDesktopGeometry();
w->setBackgroundColor( Qt::darkGreen );
w->setGeometry( dg.left() + ( dg.width() - greeting_width ) / 2, dg.top() + ( dg.height() - 180 ) / 2, greeting_width, 180);
w->show();
@@ -114,11 +114,11 @@ bool cardMap::setCardDir( const QString &dir)
p.drawText(0, 150, greeting_width, 20, Qt::AlignCenter,
wait_message );
- p.setFont(QFont("Times", 24));
+ p.setFont(TQFont("Times", 24));
p.drawText(0, 0, greeting_width, 40, Qt::AlignCenter,
greeting);
- p.setPen(QPen(QColor(0, 0, 0), 4));
+ p.setPen(TQPen(TQColor(0, 0, 0), 4));
p.setBrush(Qt::NoBrush);
p.drawRect(0, 0, greeting_width, 180);
p.flush();
@@ -181,7 +181,7 @@ bool cardMap::setCardDir( const QString &dir)
{
const int time_to_see = 900;
p.end();
- t2 = QTime::currentTime();
+ t2 = TQTime::currentTime();
if(t1.msecsTo(t2) < time_to_see)
usleep((time_to_see-t1.msecsTo(t2))*1000);
delete w;
@@ -190,7 +190,7 @@ bool cardMap::setCardDir( const QString &dir)
return true;
}
-bool cardMap::setBackSide( const QPixmap &pm, bool scale )
+bool cardMap::setBackSide( const TQPixmap &pm, bool scale )
{
if (pm.isNull())
return false;
@@ -202,7 +202,7 @@ bool cardMap::setBackSide( const QPixmap &pm, bool scale )
{
kdDebug(11111) << "scaling back!!\n";
// scale to fit size
- QWMatrix wm;
+ TQWMatrix wm;
wm.scale(((float)(card_width))/back.width(),
((float)(card_height))/back.height());
back = back.xForm(wm);
@@ -219,12 +219,12 @@ int cardMap::CARDY() {
return self()->card_height; // 96;
}
-QPixmap cardMap::backSide() const
+TQPixmap cardMap::backSide() const
{
return back;
}
-QPixmap cardMap::image( Card::Rank _rank, Card::Suit _suit, bool inverted) const
+TQPixmap cardMap::image( Card::Rank _rank, Card::Suit _suit, bool inverted) const
{
if( 1 <= _rank && _rank <= 13
&& 1 <= _suit && _suit <= 4 )
diff --git a/kpat/cardmaps.h b/kpat/cardmaps.h
index 8bc8d92c..0a2a284a 100644
--- a/kpat/cardmaps.h
+++ b/kpat/cardmaps.h
@@ -28,7 +28,7 @@ class cardMap
public:
static cardMap *self();
- cardMap(const QColor &dimcolor);
+ cardMap(const TQColor &dimcolor);
static int CARDX();
static int CARDY();
@@ -36,21 +36,21 @@ public:
static const int NumColors = 4;
static const int CardsPerColor = 13;
- QPixmap image( Card::Rank _rank, Card::Suit _suit, bool inverted = false) const;
- QPixmap backSide() const;
- bool setCardDir( const QString &dir);
- bool setBackSide( const QPixmap & _pix, bool scale = true);
+ TQPixmap image( Card::Rank _rank, Card::Suit _suit, bool inverted = false) const;
+ TQPixmap backSide() const;
+ bool setCardDir( const TQString &dir);
+ bool setBackSide( const TQPixmap & _pix, bool scale = true);
private:
cardMap();
struct
{
- QPixmap normal;
- QPixmap inverted;
+ TQPixmap normal;
+ TQPixmap inverted;
} img[ CardsPerColor ][ NumColors ];
- QPixmap back;
- QColor dimcolor;
+ TQPixmap back;
+ TQColor dimcolor;
int card_width, card_height;
static cardMap *_self;
diff --git a/kpat/dealer.cpp b/kpat/dealer.cpp
index 2100ae2e..365e7411 100644
--- a/kpat/dealer.cpp
+++ b/kpat/dealer.cpp
@@ -6,7 +6,7 @@
#include "kmainwindow.h"
#include <kapplication.h>
#include <kpixmapeffect.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <klocale.h>
#include "cardmaps.h"
@@ -56,7 +56,7 @@ Dealer *Dealer::s_instance = 0;
Dealer::Dealer( KMainWindow* _parent , const char* _name )
- : QCanvasView( 0, _parent, _name ),
+ : TQCanvasView( 0, _parent, _name ),
towait(0),
myActions(0),
ademo(0),
@@ -69,7 +69,7 @@ Dealer::Dealer( KMainWindow* _parent , const char* _name )
_autodrop(true),
_gameRecorded(false)
{
- setResizePolicy(QScrollView::Manual);
+ setResizePolicy(TQScrollView::Manual);
setVScrollBarMode(AlwaysOff);
setHScrollBarMode(AlwaysOff);
@@ -81,9 +81,9 @@ Dealer::Dealer( KMainWindow* _parent , const char* _name )
undoList.setAutoDelete(true);
- demotimer = new QTimer(this);
+ demotimer = new TQTimer(this);
- connect(demotimer, SIGNAL(timeout()), SLOT(demo()));
+ connect(demotimer, TQT_SIGNAL(timeout()), TQT_SLOT(demo()));
assert(!s_instance);
s_instance = this;
@@ -96,7 +96,7 @@ const Dealer *Dealer::instance()
}
-void Dealer::setBackgroundPixmap(const QPixmap &background, const QColor &midcolor)
+void Dealer::setBackgroundPixmap(const TQPixmap &background, const TQColor &midcolor)
{
_midcolor = midcolor;
canvas()->setBackgroundPixmap(background);
@@ -108,36 +108,36 @@ void Dealer::setBackgroundPixmap(const QPixmap &background, const QColor &midcol
void Dealer::setupActions() {
- QPtrList<KAction> actionlist;
+ TQPtrList<KAction> actionlist;
kdDebug(11111) << "setupActions " << actions() << endl;
if (actions() & Dealer::Hint) {
- ahint = new KAction( i18n("&Hint"), QString::fromLatin1("wizard"), Key_H, this,
- SLOT(hint()),
+ ahint = new KAction( i18n("&Hint"), TQString::fromLatin1("wizard"), Key_H, this,
+ TQT_SLOT(hint()),
parent()->actionCollection(), "game_hint");
actionlist.append(ahint);
} else
ahint = 0;
if (actions() & Dealer::Demo) {
- ademo = new KToggleAction( i18n("&Demo"), QString::fromLatin1("1rightarrow"), CTRL+Key_D, this,
- SLOT(toggleDemo()),
+ ademo = new KToggleAction( i18n("&Demo"), TQString::fromLatin1("1rightarrow"), CTRL+Key_D, this,
+ TQT_SLOT(toggleDemo()),
parent()->actionCollection(), "game_demo");
actionlist.append(ademo);
} else
ademo = 0;
if (actions() & Dealer::Redeal) {
- aredeal = new KAction (i18n("&Redeal"), QString::fromLatin1("queue"), 0, this,
- SLOT(redeal()),
+ aredeal = new KAction (i18n("&Redeal"), TQString::fromLatin1("queue"), 0, this,
+ TQT_SLOT(redeal()),
parent()->actionCollection(), "game_redeal");
actionlist.append(aredeal);
} else
aredeal = 0;
- parent()->guiFactory()->plugActionList( parent(), QString::fromLatin1("game_actions"), actionlist);
+ parent()->guiFactory()->plugActionList( parent(), TQString::fromLatin1("game_actions"), actionlist);
}
Dealer::~Dealer()
@@ -145,7 +145,7 @@ Dealer::~Dealer()
if (!_won)
countLoss();
clearHints();
- parent()->guiFactory()->unplugActionList( parent(), QString::fromLatin1("game_actions"));
+ parent()->guiFactory()->unplugActionList( parent(), TQString::fromLatin1("game_actions"));
while (!piles.isEmpty())
delete piles.first(); // removes itself
@@ -156,7 +156,7 @@ Dealer::~Dealer()
KMainWindow *Dealer::parent() const
{
- return dynamic_cast<KMainWindow*>(QCanvasView::parent());
+ return dynamic_cast<KMainWindow*>(TQCanvasView::parent());
}
@@ -252,7 +252,7 @@ bool Dealer::isMoving(Card *c) const
return movingCards.find(c) != movingCards.end();
}
-void Dealer::contentsMouseMoveEvent(QMouseEvent* e)
+void Dealer::contentsMouseMoveEvent(TQMouseEvent* e)
{
if (movingCards.isEmpty())
return;
@@ -266,9 +266,9 @@ void Dealer::contentsMouseMoveEvent(QMouseEvent* e)
}
PileList sources;
- QCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
+ TQCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
@@ -320,21 +320,21 @@ void Dealer::mark(Card *c)
void Dealer::unmarkAll()
{
- for (QCanvasItemList::Iterator it = marked.begin(); it != marked.end(); ++it)
+ for (TQCanvasItemList::Iterator it = marked.begin(); it != marked.end(); ++it)
{
(*it)->setSelected(false);
}
marked.clear();
}
-void Dealer::contentsMousePressEvent(QMouseEvent* e)
+void Dealer::contentsMousePressEvent(TQMouseEvent* e)
{
unmarkAll();
stopDemo();
if (waiting())
return;
- QCanvasItemList list = canvas()->collisions(e->pos());
+ TQCanvasItemList list = canvas()->collisions(e->pos());
kdDebug(11111) << "mouse pressed " << list.count() << " " << canvas()->allItems().count() << endl;
moved = false;
@@ -373,22 +373,22 @@ void Dealer::contentsMousePressEvent(QMouseEvent* e)
class Hit {
public:
Pile *source;
- QRect intersect;
+ TQRect intersect;
bool top;
};
-typedef QValueList<Hit> HitList;
+typedef TQValueList<Hit> HitList;
-void Dealer::contentsMouseReleaseEvent( QMouseEvent *e)
+void Dealer::contentsMouseReleaseEvent( TQMouseEvent *e)
{
if (!moved) {
if (!movingCards.isEmpty()) {
movingCards.first()->source()->moveCardsBack(movingCards);
movingCards.clear();
}
- QCanvasItemList list = canvas()->collisions(e->pos());
+ TQCanvasItemList list = canvas()->collisions(e->pos());
if (list.isEmpty())
return;
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasItemList::Iterator it = list.begin();
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
assert(c);
@@ -418,10 +418,10 @@ void Dealer::contentsMouseReleaseEvent( QMouseEvent *e)
unmarkAll();
- QCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
+ TQCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
HitList sources;
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
@@ -499,7 +499,7 @@ void Dealer::contentsMouseReleaseEvent( QMouseEvent *e)
canvas()->update();
}
-void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e )
+void Dealer::contentsMouseDoubleClickEvent( TQMouseEvent*e )
{
stopDemo();
unmarkAll();
@@ -510,10 +510,10 @@ void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e )
movingCards.first()->source()->moveCardsBack(movingCards);
movingCards.clear();
}
- QCanvasItemList list = canvas()->collisions(e->pos());
+ TQCanvasItemList list = canvas()->collisions(e->pos());
if (list.isEmpty())
return;
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasItemList::Iterator it = list.begin();
if ((*it)->rtti() != Card::RTTI)
return;
Card *c = dynamic_cast<Card*>(*it);
@@ -526,12 +526,12 @@ void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e )
}
}
-QSize Dealer::minimumCardSize() const
+TQSize Dealer::minimumCardSize() const
{
return minsize;
}
-void Dealer::resizeEvent(QResizeEvent *e)
+void Dealer::resizeEvent(TQResizeEvent *e)
{
int x = width();
int y = height();
@@ -570,7 +570,7 @@ void Dealer::resizeEvent(QResizeEvent *e)
if (!e)
updateScrollBars();
else
- QCanvasView::resizeEvent(e);
+ TQCanvasView::resizeEvent(e);
}
bool Dealer::cardClicked(Card *c) {
@@ -613,7 +613,7 @@ void Dealer::startNew()
if ( aredeal )
aredeal->setEnabled( true );
toldAboutLostGame = false;
- minsize = QSize(0,0);
+ minsize = TQSize(0,0);
_won = false;
_waiting = 0;
_gameRecorded=false;
@@ -622,8 +622,8 @@ void Dealer::startNew()
kdDebug(11111) << "startNew unmarkAll\n";
unmarkAll();
kdDebug(11111) << "startNew setAnimated(false)\n";
- QCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
+ TQCanvasItemList list = canvas()->allItems();
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
if ((*it)->rtti() == Card::RTTI)
static_cast<Card*>(*it)->disconnect();
@@ -638,7 +638,7 @@ void Dealer::startNew()
restart();
takeState();
Card *towait = 0;
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
if ((*it)->rtti() == Card::RTTI) {
towait = static_cast<Card*>(*it);
if (towait->animated())
@@ -650,7 +650,7 @@ void Dealer::startNew()
if (!towait)
takeState();
else
- connect(towait, SIGNAL(stoped(Card*)), SLOT(slotTakeState(Card *)));
+ connect(towait, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(slotTakeState(Card *)));
resizeEvent(0);
}
@@ -660,7 +660,7 @@ void Dealer::slotTakeState(Card *c) {
takeState();
}
-void Dealer::enlargeCanvas(QCanvasRectangle *c)
+void Dealer::enlargeCanvas(TQCanvasRectangle *c)
{
if (!c->isVisible() || c->animated())
return;
@@ -702,7 +702,7 @@ public:
y == rhs.y && z == rhs.z && faceup == rhs.faceup
&& source_index == rhs.source_index && tookdown == rhs.tookdown);
}
- void fillNode(QDomElement &e) const {
+ void fillNode(TQDomElement &e) const {
e.setAttribute("value", it->rank());
e.setAttribute("suit", it->suit());
e.setAttribute("source", source->index());
@@ -715,7 +715,7 @@ public:
}
};
-typedef class QValueList<CardState> CardStateList;
+typedef class TQValueList<CardState> CardStateList;
bool operator==( const State & st1, const State & st2) {
return st1.cards == st2.cards && st1.gameData == st2.gameData;
@@ -723,10 +723,10 @@ bool operator==( const State & st1, const State & st2) {
State *Dealer::getState()
{
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
State * st = new State;
- for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
@@ -758,9 +758,9 @@ State *Dealer::getState()
void Dealer::setState(State *st)
{
CardStateList * n = &st->cards;
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Pile::RTTI) {
Pile *p = dynamic_cast<Pile*>(*it);
@@ -827,32 +827,32 @@ void Dealer::takeState()
ademo->setEnabled( false );
if ( aredeal )
aredeal->setEnabled( false );
- QTimer::singleShot(400, this, SIGNAL(gameLost()));
+ TQTimer::singleShot(400, this, TQT_SIGNAL(gameLost()));
toldAboutLostGame = true;
return;
}
}
if (!demoActive() && !waiting())
- QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop()));
+ TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop()));
emit undoPossible(undoList.count() > 1 && !waiting());
}
-void Dealer::saveGame(QDomDocument &doc) {
- QDomElement dealer = doc.createElement("dealer");
+void Dealer::saveGame(TQDomDocument &doc) {
+ TQDomElement dealer = doc.createElement("dealer");
doc.appendChild(dealer);
dealer.setAttribute("id", _id);
- dealer.setAttribute("number", QString::number(gameNumber()));
- QString data = getGameState();
+ dealer.setAttribute("number", TQString::number(gameNumber()));
+ TQString data = getGameState();
if (!data.isEmpty())
dealer.setAttribute("data", data);
- dealer.setAttribute("moves", QString::number(getMoves()));
+ dealer.setAttribute("moves", TQString::number(getMoves()));
bool taken[1000];
memset(taken, 0, sizeof(taken));
- QCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ TQCanvasItemList list = canvas()->allItems();
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Pile::RTTI) {
Pile *p = dynamic_cast<Pile*>(*it);
@@ -863,7 +863,7 @@ void Dealer::saveGame(QDomDocument &doc) {
}
taken[p->index()] = true;
- QDomElement pile = doc.createElement("pile");
+ TQDomElement pile = doc.createElement("pile");
pile.setAttribute("index", p->index());
CardList cards = p->cards();
@@ -871,7 +871,7 @@ void Dealer::saveGame(QDomDocument &doc) {
it != cards.end();
++it)
{
- QDomElement card = doc.createElement("card");
+ TQDomElement card = doc.createElement("card");
card.setAttribute("suit", (*it)->suit());
card.setAttribute("value", (*it)->rank());
card.setAttribute("faceup", (*it)->isFaceUp());
@@ -886,20 +886,20 @@ void Dealer::saveGame(QDomDocument &doc) {
}
/*
- QDomElement eList = doc.createElement("undo");
+ TQDomElement eList = doc.createElement("undo");
- QPtrListIterator<State> it(undoList);
+ TQPtrListIterator<State> it(undoList);
for (; it.current(); ++it)
{
State *n = it.current();
- QDomElement state = doc.createElement("state");
+ TQDomElement state = doc.createElement("state");
if (!n->gameData.isEmpty())
state.setAttribute("data", n->gameData);
- QDomElement cards = doc.createElement("cards");
- for (QValueList<CardState>::ConstIterator it2 = n->cards.begin();
+ TQDomElement cards = doc.createElement("cards");
+ for (TQValueList<CardState>::ConstIterator it2 = n->cards.begin();
it2 != n->cards.end(); ++it2)
{
- QDomElement item = doc.createElement("item");
+ TQDomElement item = doc.createElement("item");
(*it2).fillNode(item);
cards.appendChild(item);
}
@@ -911,26 +911,26 @@ void Dealer::saveGame(QDomDocument &doc) {
// kdDebug(11111) << doc.toString() << endl;
}
-void Dealer::openGame(QDomDocument &doc)
+void Dealer::openGame(TQDomDocument &doc)
{
unmarkAll();
- QDomElement dealer = doc.documentElement();
+ TQDomElement dealer = doc.documentElement();
setGameNumber(dealer.attribute("number").toULong());
undoList.clear();
- QDomNodeList piles = dealer.elementsByTagName("pile");
+ TQDomNodeList piles = dealer.elementsByTagName("pile");
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
CardList cards;
- for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
if ((*it)->rtti() == Card::RTTI)
cards.append(static_cast<Card*>(*it));
Deck::deck()->collectAndShuffle();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Pile::RTTI)
{
@@ -939,13 +939,13 @@ void Dealer::openGame(QDomDocument &doc)
for (uint i = 0; i < piles.count(); ++i)
{
- QDomElement pile = piles.item(i).toElement();
+ TQDomElement pile = piles.item(i).toElement();
if (pile.attribute("index").toInt() == p->index())
{
- QDomNodeList pcards = pile.elementsByTagName("card");
+ TQDomNodeList pcards = pile.elementsByTagName("card");
for (uint j = 0; j < pcards.count(); ++j)
{
- QDomElement card = pcards.item(j).toElement();
+ TQDomElement card = pcards.item(j).toElement();
Card::Suit s = static_cast<Card::Suit>(card.attribute("suit").toInt());
Card::Rank v = static_cast<Card::Rank>(card.attribute("value").toInt());
@@ -953,7 +953,7 @@ void Dealer::openGame(QDomDocument &doc)
it2 != cards.end(); ++it2)
{
if ((*it2)->suit() == s && (*it2)->rank() == v) {
- if (QString((*it2)->name()) == "Diamonds Eight") {
+ if (TQString((*it2)->name()) == "Diamonds Eight") {
kdDebug(11111) << i << " " << j << endl;
}
p->add(*it2);
@@ -1034,7 +1034,7 @@ void Dealer::setWaiting(bool w)
void Dealer::setAutoDropEnabled(bool a)
{
_autodrop = a;
- QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop()));
+ TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop()));
}
bool Dealer::startAutoDrop()
@@ -1042,11 +1042,11 @@ bool Dealer::startAutoDrop()
if (!autoDrop())
return false;
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
if ((*it)->animated()) {
- QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop()));
+ TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop()));
return true;
}
@@ -1070,7 +1070,7 @@ bool Dealer::startAutoDrop()
t->move(x, y);
kdDebug(11111) << "autodrop " << t->name() << endl;
t->moveTo(int(t->source()->x()), int(t->source()->y()), int(t->z()), STEPS_AUTODROP);
- connect(t, SIGNAL(stoped(Card*)), SLOT(waitForAutoDrop(Card*)));
+ connect(t, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForAutoDrop(Card*)));
return true;
}
}
@@ -1160,20 +1160,20 @@ void Dealer::won()
{ // wrap in own scope to make KConfigGroupSave work
KConfig *config = kapp->config();
KConfigGroupSaver kcs(config, scores_group);
- unsigned int n = config->readUnsignedNumEntry(QString("won%1").arg(_id),0) + 1;
- config->writeEntry(QString("won%1").arg(_id),n);
- n = config->readUnsignedNumEntry(QString("winstreak%1").arg(_id),0) + 1;
- config->writeEntry(QString("winstreak%1").arg(_id),n);
- unsigned int m = config->readUnsignedNumEntry(QString("maxwinstreak%1").arg(_id),0);
+ unsigned int n = config->readUnsignedNumEntry(TQString("won%1").arg(_id),0) + 1;
+ config->writeEntry(TQString("won%1").arg(_id),n);
+ n = config->readUnsignedNumEntry(TQString("winstreak%1").arg(_id),0) + 1;
+ config->writeEntry(TQString("winstreak%1").arg(_id),n);
+ unsigned int m = config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(_id),0);
if (n>m)
- config->writeEntry(QString("maxwinstreak%1").arg(_id),n);
- config->writeEntry(QString("loosestreak%1").arg(_id),0);
+ config->writeEntry(TQString("maxwinstreak%1").arg(_id),n);
+ config->writeEntry(TQString("loosestreak%1").arg(_id),0);
}
// sort cards by increasing z
- QCanvasItemList list = canvas()->allItems();
- QValueList<CardPtr> cards;
- for (QCanvasItemList::ConstIterator it=list.begin(); it!=list.end(); ++it)
+ TQCanvasItemList list = canvas()->allItems();
+ TQValueList<CardPtr> cards;
+ for (TQCanvasItemList::ConstIterator it=list.begin(); it!=list.end(); ++it)
if ((*it)->rtti() == Card::RTTI) {
CardPtr p;
p.ptr = dynamic_cast<Card*>(*it);
@@ -1183,16 +1183,16 @@ void Dealer::won()
qHeapSort(cards);
// disperse the cards everywhere
- QRect can(0, 0, canvas()->width(), canvas()->height());
- QValueList<CardPtr>::ConstIterator it = cards.begin();
+ TQRect can(0, 0, canvas()->width(), canvas()->height());
+ TQValueList<CardPtr>::ConstIterator it = cards.begin();
for (; it != cards.end(); ++it) {
(*it).ptr->turn(true);
- QRect p(0, 0, (*it).ptr->width(), (*it).ptr->height());
+ TQRect p(0, 0, (*it).ptr->width(), (*it).ptr->height());
int x, y;
do {
x = 3*canvas()->width()/2 - kapp->random() % (canvas()->width() * 2);
y = 3*canvas()->height()/2 - (kapp->random() % (canvas()->height() * 2));
- p.moveTopLeft(QPoint(x, y));
+ p.moveTopLeft(TQPoint(x, y));
} while (can.intersects(p));
(*it).ptr->moveTo( x, y, 0, STEPS_WON);
@@ -1305,7 +1305,7 @@ Card *Dealer::demoNewCards()
void Dealer::newDemoMove(Card *m)
{
towait = m;
- connect(m, SIGNAL(stoped(Card*)), SLOT(waitForDemo(Card*)));
+ connect(m, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForDemo(Card*)));
}
void Dealer::waitForDemo(Card *t)
@@ -1344,8 +1344,8 @@ bool Dealer::checkAdd( int, const Pile *, const CardList&) const {
void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected)
{
- QPixmap bg = myCanvas.backgroundPixmap();
- QRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY());
+ TQPixmap bg = myCanvas.backgroundPixmap();
+ TQRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY());
pixmap.resize(bounding.width(), bounding.height());
pixmap.fill(Qt::white);
@@ -1401,24 +1401,24 @@ int Dealer::freeCells() const
return n;
}
-void Dealer::setAnchorName(const QString &name)
+void Dealer::setAnchorName(const TQString &name)
{
kdDebug(11111) << "setAnchorname " << name << endl;
ac = name;
}
-QString Dealer::anchorName() const { return ac; }
+TQString Dealer::anchorName() const { return ac; }
-void Dealer::wheelEvent( QWheelEvent *e )
+void Dealer::wheelEvent( TQWheelEvent *e )
{
- QWheelEvent ce( viewport()->mapFromGlobal( e->globalPos() ),
+ TQWheelEvent ce( viewport()->mapFromGlobal( e->globalPos() ),
e->globalPos(), e->delta(), e->state());
viewportWheelEvent(&ce);
if ( !ce.isAccepted() ) {
if ( e->orientation() == Horizontal && hScrollBarMode () == AlwaysOn )
- QApplication::sendEvent( horizontalScrollBar(), e);
+ TQApplication::sendEvent( horizontalScrollBar(), e);
else if (e->orientation() == Vertical && vScrollBarMode () == AlwaysOn )
- QApplication::sendEvent( verticalScrollBar(), e);
+ TQApplication::sendEvent( verticalScrollBar(), e);
} else {
e->accept();
}
@@ -1430,9 +1430,9 @@ void Dealer::countGame()
kdDebug(11111) << "counting game as played." << endl;
KConfig *config = kapp->config();
KConfigGroupSaver kcs(config, scores_group);
- unsigned int Total = config->readUnsignedNumEntry(QString("total%1").arg(_id),0);
+ unsigned int Total = config->readUnsignedNumEntry(TQString("total%1").arg(_id),0);
++Total;
- config->writeEntry(QString("total%1").arg(_id),Total);
+ config->writeEntry(TQString("total%1").arg(_id),Total);
_gameRecorded = true;
}
}
@@ -1443,12 +1443,12 @@ void Dealer::countLoss()
// update score
KConfig *config = kapp->config();
KConfigGroupSaver kcs(config, scores_group);
- unsigned int n = config->readUnsignedNumEntry(QString("loosestreak%1").arg(_id),0) + 1;
- config->writeEntry(QString("loosestreak%1").arg(_id),n);
- unsigned int m = config->readUnsignedNumEntry(QString("maxloosestreak%1").arg(_id),0);
+ unsigned int n = config->readUnsignedNumEntry(TQString("loosestreak%1").arg(_id),0) + 1;
+ config->writeEntry(TQString("loosestreak%1").arg(_id),n);
+ unsigned int m = config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(_id),0);
if (n>m)
- config->writeEntry(QString("maxloosestreak%1").arg(_id),n);
- config->writeEntry(QString("winstreak%1").arg(_id),0);
+ config->writeEntry(TQString("maxloosestreak%1").arg(_id),n);
+ config->writeEntry(TQString("winstreak%1").arg(_id),0);
}
}
diff --git a/kpat/dealer.h b/kpat/dealer.h
index c5593cbd..fef7e6ce 100644
--- a/kpat/dealer.h
+++ b/kpat/dealer.h
@@ -19,9 +19,9 @@ public:
static DealerInfoList *self();
void add(DealerInfo *);
- const QValueList<DealerInfo*> games() const { return list; }
+ const TQValueList<DealerInfo*> games() const { return list; }
private:
- QValueList<DealerInfo*> list;
+ TQValueList<DealerInfo*> list;
static DealerInfoList *_self;
};
@@ -40,12 +40,12 @@ public:
class CardState;
-typedef QValueList<CardState> CardStateList;
+typedef TQValueList<CardState> CardStateList;
struct State
{
CardStateList cards;
- QString gameData;
+ TQString gameData;
};
@@ -65,14 +65,14 @@ public:
static const Dealer *instance();
- void enlargeCanvas(QCanvasRectangle *c);
+ void enlargeCanvas(TQCanvasRectangle *c);
void setGameNumber(long gmn);
long gameNumber() const;
virtual bool isGameWon() const;
virtual bool isGameLost() const;
- void setViewSize(const QSize &size);
+ void setViewSize(const TQSize &size);
void addPile(Pile *p);
void removePile(Pile *p);
@@ -89,11 +89,11 @@ public:
void drawPile(KPixmap &, Pile *p, bool selected);
- QColor midColor() const { return _midcolor; }
- void setBackgroundPixmap(const QPixmap &background, const QColor &midcolor);
+ TQColor midColor() const { return _midcolor; }
+ void setBackgroundPixmap(const TQPixmap &background, const TQColor &midcolor);
- void saveGame(QDomDocument &doc);
- void openGame(QDomDocument &doc);
+ void saveGame(TQDomDocument &doc);
+ void openGame(TQDomDocument &doc);
void setGameId(int id) { _id = id; }
int gameId() const { return _id; }
@@ -103,13 +103,13 @@ public:
bool isMoving(Card *c) const;
- virtual QSize minimumCardSize() const;
- virtual void resizeEvent(QResizeEvent *);
+ virtual TQSize minimumCardSize() const;
+ virtual void resizeEvent(TQResizeEvent *);
int freeCells() const;
- QString anchorName() const;
- void setAnchorName(const QString &name);
+ TQString anchorName() const;
+ void setAnchorName(const TQString &name);
void setAutoDropEnabled(bool a);
bool autoDrop() const { return _autodrop; }
@@ -131,7 +131,7 @@ signals:
void gameWon(bool withhelp);
void gameLost();
void saveGame(); // emergency
- void gameInfo(const QString &info);
+ void gameInfo(const TQString &info);
void updateMoves();
public slots:
@@ -150,11 +150,11 @@ protected:
virtual void restart() = 0;
- virtual void contentsMousePressEvent(QMouseEvent* e);
- virtual void contentsMouseMoveEvent( QMouseEvent* );
- virtual void contentsMouseReleaseEvent( QMouseEvent* );
- virtual void contentsMouseDoubleClickEvent( QMouseEvent* );
- virtual void wheelEvent( QWheelEvent *e );
+ virtual void contentsMousePressEvent(TQMouseEvent* e);
+ virtual void contentsMouseMoveEvent( TQMouseEvent* );
+ virtual void contentsMouseReleaseEvent( TQMouseEvent* );
+ virtual void contentsMouseDoubleClickEvent( TQMouseEvent* );
+ virtual void wheelEvent( TQWheelEvent *e );
void unmarkAll();
void mark(Card *c);
@@ -182,26 +182,26 @@ protected:
void setState(State *);
// reimplement this to add game-specific information in the state structure
- virtual QString getGameState() const { return QString::null; }
+ virtual TQString getGameState() const { return TQString::null; }
// reimplement this to use the game-specific information from the state structure
- virtual void setGameState( const QString & ) {}
+ virtual void setGameState( const TQString & ) {}
virtual void newDemoMove(Card *m);
bool moved;
CardList movingCards;
- QCanvasItemList marked;
- QPoint moving_start;
+ TQCanvasItemList marked;
+ TQPoint moving_start;
Dealer( Dealer& ); // don't allow copies or assignments
void operator = ( Dealer& ); // don't allow copies or assignments
- QCanvas myCanvas;
- QSize minsize;
- QSize viewsize;
- QPtrList<State> undoList;
+ TQCanvas myCanvas;
+ TQSize minsize;
+ TQSize viewsize;
+ TQPtrList<State> undoList;
long gamenumber;
- QValueList<MoveHint*> hints;
+ TQValueList<MoveHint*> hints;
Card *towait;
- QTimer *demotimer;
+ TQTimer *demotimer;
int myActions;
bool toldAboutLostGame;
@@ -209,13 +209,13 @@ protected:
KAction *ahint, *aredeal;
KRandomSequence randseq;
- QColor _midcolor;
+ TQColor _midcolor;
Q_UINT32 _id;
bool takeTargets;
bool _won;
int _waiting;
bool stop_demo_next;
- QString ac;
+ TQString ac;
static Dealer *s_instance;
bool _autodrop;
bool _gameRecorded;
diff --git a/kpat/fortyeight.cpp b/kpat/fortyeight.cpp
index 1d867378..1747b647 100644
--- a/kpat/fortyeight.cpp
+++ b/kpat/fortyeight.cpp
@@ -12,12 +12,12 @@ HorLeftPile::HorLeftPile( int _index, Dealer* parent)
setHSpread( cardMap::CARDX() / 11 + 1 );
}
-QSize HorLeftPile::cardOffset( bool _spread, bool, const Card *) const
+TQSize HorLeftPile::cardOffset( bool _spread, bool, const Card *) const
{
if (_spread)
- return QSize(-hspread(), 0);
+ return TQSize(-hspread(), 0);
- return QSize(0, 0);
+ return TQSize(0, 0);
}
void HorLeftPile::initSizes()
@@ -35,7 +35,7 @@ Fortyeight::Fortyeight( KMainWindow* parent, const char* name)
const int dist_x = cardMap::CARDX() * 11 / 10 + 1;
const int dist_y = cardMap::CARDY() * 11 / 10 + 1;
- connect(deck, SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*)));
+ connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*)));
deck->move(10 + cardMap::CARDX() * 82 / 10, 10 + cardMap::CARDX() * 56 / 10);
deck->setZ(20);
@@ -124,12 +124,12 @@ void Fortyeight::deal()
pile->add(deck->nextCard(), false, false);
}
-QString Fortyeight::getGameState() const
+TQString Fortyeight::getGameState() const
{
- return QString::number(lastdeal);
+ return TQString::number(lastdeal);
}
-void Fortyeight::setGameState( const QString &s )
+void Fortyeight::setGameState( const TQString &s )
{
lastdeal = s.toInt();
}
diff --git a/kpat/fortyeight.h b/kpat/fortyeight.h
index 858e6e15..80303c0e 100644
--- a/kpat/fortyeight.h
+++ b/kpat/fortyeight.h
@@ -9,7 +9,7 @@ class HorLeftPile : public Pile
public:
HorLeftPile( int _index, Dealer* parent = 0);
- virtual QSize cardOffset( bool _spread, bool _facedown, const Card *before) const;
+ virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const;
virtual void initSizes();
};
@@ -29,8 +29,8 @@ public slots:
protected:
virtual bool checkAdd( int checkIndex, const Pile *c1, const CardList& c2) const;
virtual Card *demoNewCards();
- virtual QString getGameState() const;
- virtual void setGameState( const QString & stream );
+ virtual TQString getGameState() const;
+ virtual void setGameState( const TQString & stream );
private:
Pile *stack[8];
diff --git a/kpat/freecell.cpp b/kpat/freecell.cpp
index 7a72c1fc..ff8a5b1a 100644
--- a/kpat/freecell.cpp
+++ b/kpat/freecell.cpp
@@ -26,7 +26,7 @@
#include <kdebug.h>
#include <stdio.h>
#include <stdlib.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include "cardmaps.h"
#include "freecell-solver/fcs_user.h"
@@ -102,7 +102,7 @@ void FreecellBase::restart()
deal();
}
-QString suitToString(Card::Suit s) {
+TQString suitToString(Card::Suit s) {
switch (s) {
case Card::Clubs:
return "C";
@@ -113,10 +113,10 @@ QString suitToString(Card::Suit s) {
case Card::Spades:
return "S";
}
- return QString::null;
+ return TQString::null;
}
-QString rankToString(Card::Rank r)
+TQString rankToString(Card::Rank r)
{
switch (r) {
case Card::King:
@@ -128,7 +128,7 @@ QString rankToString(Card::Rank r)
case Card::Queen:
return "Q";
default:
- return QString::number(r);
+ return TQString::number(r);
}
}
@@ -211,7 +211,7 @@ void FreecellBase::findSolution()
{
kdDebug(11111) << "findSolution\n";
- QString output = solverFormat();
+ TQString output = solverFormat();
kdDebug(11111) << output << endl;
int ret;
@@ -313,7 +313,7 @@ void FreecellBase::resumeSolution()
}
solver_ret = freecell_solver_user_resume_solution(solver_instance);
- QTimer::singleShot(0, this, SLOT(resumeSolution()));
+ TQTimer::singleShot(0, this, TQT_SLOT(resumeSolution()));
}
MoveHint *FreecellBase::translateMove(void *m) {
@@ -369,17 +369,17 @@ MoveHint *FreecellBase::translateMove(void *m) {
return new MoveHint(c, to);
}
-QString FreecellBase::solverFormat() const
+TQString FreecellBase::solverFormat() const
{
- QString output;
- QString tmp;
+ TQString output;
+ TQString tmp;
for (uint i = 0; i < target.count(); i++) {
if (target[i]->isEmpty())
continue;
tmp += suitToString(target[i]->top()->suit()) + "-" + rankToString(target[i]->top()->rank()) + " ";
}
if (!tmp.isEmpty())
- output += QString::fromLatin1("Foundations: %1\n").arg(tmp);
+ output += TQString::fromLatin1("Foundations: %1\n").arg(tmp);
tmp.truncate(0);
for (uint i = 0; i < freecell.count(); i++) {
@@ -389,7 +389,7 @@ QString FreecellBase::solverFormat() const
tmp += rankToString(freecell[i]->top()->rank()) + suitToString(freecell[i]->top()->suit()) + " ";
}
if (!tmp.isEmpty())
- output += QString::fromLatin1("Freecells: %1\n").arg(tmp);
+ output += TQString::fromLatin1("Freecells: %1\n").arg(tmp);
for (uint i = 0; i < store.count(); i++)
{
@@ -602,7 +602,7 @@ void FreecellBase::moveCards(CardList &c, FreecellPile *from, Pile *to)
from->moveCardsBack(c);
waitfor = c.first();
- connect(waitfor, SIGNAL(stoped(Card*)), SLOT(waitForMoving(Card*)));
+ connect(waitfor, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForMoving(Card*)));
PileList fcs;
@@ -625,7 +625,7 @@ void FreecellBase::moveCards(CardList &c, FreecellPile *from, Pile *to)
movePileToPile(c, to, fss, fcs, 0, c.count(), 0);
if (!waitfor->animated())
- QTimer::singleShot(0, this, SLOT(startMoving()));
+ TQTimer::singleShot(0, this, TQT_SLOT(startMoving()));
}
struct MoveAway {
@@ -645,7 +645,7 @@ void FreecellBase::movePileToPile(CardList &c, Pile *to, PileList fss, PileList
}
kdDebug(11111) << debug_level << " moveaway " << moveaway << endl;
- QValueList<MoveAway> moves_away;
+ TQValueList<MoveAway> moves_away;
if (count - moveaway < (fcs.count() + 1) && (count <= 2 * (fcs.count() + 1))) {
moveaway = count - (fcs.count() + 1);
@@ -707,7 +707,7 @@ void FreecellBase::startMoving()
mh->pile()->moveCardsBack(empty, true);
waitfor = mh->card();
kdDebug(11111) << "wait for moving end " << mh->card()->name() << endl;
- connect(mh->card(), SIGNAL(stoped(Card*)), SLOT(waitForMoving(Card*)));
+ connect(mh->card(), TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForMoving(Card*)));
delete mh;
}
diff --git a/kpat/freecell.h b/kpat/freecell.h
index aba311b6..b2b94dad 100644
--- a/kpat/freecell.h
+++ b/kpat/freecell.h
@@ -39,7 +39,7 @@ public:
FreecellBase( int decks, int stores, int freecells, int es_filling, bool unlimited_move,
KMainWindow* parent=0, const char* name=0);
void moveCards(CardList &c, FreecellPile *from, Pile *to);
- QString solverFormat() const;
+ TQString solverFormat() const;
virtual ~FreecellBase();
public slots:
@@ -63,7 +63,7 @@ protected:
void movePileToPile(CardList &c, Pile *to, PileList fss, PileList &fcs,
uint start, uint count, int debug_level);
- Pile *pileForName(QString line) const;
+ Pile *pileForName(TQString line) const;
void findSolution();
virtual MoveHint *chooseHint();
@@ -75,7 +75,7 @@ protected:
virtual bool cardDblClicked(Card *c);
protected:
- QValueList<FreecellPile*> store;
+ TQValueList<FreecellPile*> store;
PileList freecell;
PileList target;
Deck *deck;
diff --git a/kpat/gamestatsimpl.cpp b/kpat/gamestatsimpl.cpp
index a3a67a43..11b95fee 100644
--- a/kpat/gamestatsimpl.cpp
+++ b/kpat/gamestatsimpl.cpp
@@ -2,18 +2,18 @@
#include "dealer.h"
#include "version.h"
-#include <qcombobox.h>
-#include <qlabel.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
#include <kapplication.h>
#include <kconfig.h>
#include <klocale.h>
-GameStatsImpl::GameStatsImpl(QWidget* aParent, const char* aname)
+GameStatsImpl::GameStatsImpl(TQWidget* aParent, const char* aname)
: GameStats(aParent, aname)
{
- QStringList list;
- QValueList<DealerInfo*>::ConstIterator it;
+ TQStringList list;
+ TQValueList<DealerInfo*>::ConstIterator it;
for (it = DealerInfoList::self()->games().begin();
it != DealerInfoList::self()->games().end(); ++it)
{
@@ -42,16 +42,16 @@ void GameStatsImpl::setGameType(int id)
languageChange();
KConfig *config = kapp->config();
KConfigGroupSaver kcs(config, scores_group);
- unsigned int t = config->readUnsignedNumEntry(QString("total%1").arg(id),0);
+ unsigned int t = config->readUnsignedNumEntry(TQString("total%1").arg(id),0);
Played->setText(Played->text().arg(t));
- unsigned int w = config->readUnsignedNumEntry(QString("won%1").arg(id),0);
+ unsigned int w = config->readUnsignedNumEntry(TQString("won%1").arg(id),0);
Won->setText(Won->text().arg(w));
if (t)
WonPerc->setText(WonPerc->text().arg(w*100/t));
else
WonPerc->setText(WonPerc->text().arg(0));
WinStreak->setText(
- WinStreak->text().arg(config->readUnsignedNumEntry(QString("maxwinstreak%1").arg(id),0)));
+ WinStreak->text().arg(config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(id),0)));
LooseStreak->setText(
- LooseStreak->text().arg(config->readUnsignedNumEntry(QString("maxloosestreak%1").arg(id),0)));
+ LooseStreak->text().arg(config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(id),0)));
}
diff --git a/kpat/gamestatsimpl.h b/kpat/gamestatsimpl.h
index 192b7793..5a884017 100644
--- a/kpat/gamestatsimpl.h
+++ b/kpat/gamestatsimpl.h
@@ -6,7 +6,7 @@
class GameStatsImpl : public GameStats
{
public:
- GameStatsImpl(QWidget* aParent, const char* aname);
+ GameStatsImpl(TQWidget* aParent, const char* aname);
virtual void setGameType(int i);
virtual void showGameType(int i);
diff --git a/kpat/golf.cpp b/kpat/golf.cpp
index 71bdfbb5..053525da 100644
--- a/kpat/golf.cpp
+++ b/kpat/golf.cpp
@@ -9,12 +9,12 @@ HorRightPile::HorRightPile( int _index, Dealer* parent)
{
}
-QSize HorRightPile::cardOffset( bool _spread, bool, const Card *) const
+TQSize HorRightPile::cardOffset( bool _spread, bool, const Card *) const
{
if (_spread)
- return QSize(+hspread(), 0);
+ return TQSize(+hspread(), 0);
- return QSize(0, 0);
+ return TQSize(0, 0);
}
//-------------------------------------------------------------------------//
@@ -27,7 +27,7 @@ Golf::Golf( KMainWindow* parent, const char* _name)
deck = Deck::new_deck( this);
deck->move(10, pile_dist);
- connect(deck, SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*)));
+ connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*)));
for( int r = 0; r < 7; r++ ) {
stack[r]=new Pile(1+r, this);
diff --git a/kpat/golf.h b/kpat/golf.h
index 9c3b6421..7729e8f4 100644
--- a/kpat/golf.h
+++ b/kpat/golf.h
@@ -9,7 +9,7 @@ class HorRightPile : public Pile
public:
HorRightPile( int _index, Dealer* parent = 0);
- virtual QSize cardOffset( bool _spread, bool _facedown, const Card *before) const;
+ virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const;
};
class Golf : public Dealer
diff --git a/kpat/grandf.cpp b/kpat/grandf.cpp
index 9756b840..c15c6103 100644
--- a/kpat/grandf.cpp
+++ b/kpat/grandf.cpp
@@ -146,12 +146,12 @@ bool Grandf::checkAdd( int checkIndex, const Pile *c1, const CardList& c2) const
&& c2.first()->suit() == c1->top()->suit();
}
-QString Grandf::getGameState() const
+TQString Grandf::getGameState() const
{
- return QString::number(numberOfDeals);
+ return TQString::number(numberOfDeals);
}
-void Grandf::setGameState( const QString &s)
+void Grandf::setGameState( const TQString &s)
{
numberOfDeals = s.toInt();
aredeal->setEnabled(numberOfDeals < 3);
diff --git a/kpat/grandf.h b/kpat/grandf.h
index db24483f..4c07abc1 100644
--- a/kpat/grandf.h
+++ b/kpat/grandf.h
@@ -50,8 +50,8 @@ public slots:
protected:
void collect();
virtual bool checkAdd ( int checkIndex, const Pile *c1, const CardList& c2) const;
- virtual QString getGameState() const;
- virtual void setGameState( const QString & stream );
+ virtual TQString getGameState() const;
+ virtual void setGameState( const TQString & stream );
virtual Card *demoNewCards();
private:
diff --git a/kpat/gypsy.cpp b/kpat/gypsy.cpp
index db58f7cd..5432336a 100644
--- a/kpat/gypsy.cpp
+++ b/kpat/gypsy.cpp
@@ -12,7 +12,7 @@ Gypsy::Gypsy( KMainWindow* parent, const char *name )
deck = Deck::new_deck(this, 2);
deck->move(10 + dist_x / 2 + 8*dist_x, 10 + 45 * cardMap::CARDY() / 10);
- connect(deck, SIGNAL(clicked(Card*)), SLOT(slotClicked(Card *)));
+ connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(slotClicked(Card *)));
for (int i=0; i<8; i++) {
target[i] = new Pile(i+1, this);
diff --git a/kpat/hint.h b/kpat/hint.h
index 1d1c2594..8ebf9ed5 100644
--- a/kpat/hint.h
+++ b/kpat/hint.h
@@ -22,7 +22,7 @@ private:
};
-typedef QValueList<MoveHint*> HintList;
+typedef TQValueList<MoveHint*> HintList;
#endif
diff --git a/kpat/klondike.cpp b/kpat/klondike.cpp
index ff561fa3..dcf4c1f8 100644
--- a/kpat/klondike.cpp
+++ b/kpat/klondike.cpp
@@ -40,11 +40,11 @@ public:
void addSpread(Card *c) {
cardlist.append(c);
}
- virtual QSize cardOffset( bool _spread, bool, const Card *c) const {
+ virtual TQSize cardOffset( bool _spread, bool, const Card *c) const {
kdDebug(11111) << "cardOffset " << _spread << " " << (c? c->name() : "(null)") << endl;
if (cardlist.contains(const_cast<Card * const>(c)))
- return QSize(+dspread(), 0);
- return QSize(0, 0);
+ return TQSize(+dspread(), 0);
+ return TQSize(0, 0);
}
private:
CardList cardlist;
diff --git a/kpat/mod3.cpp b/kpat/mod3.cpp
index c69aa8e4..45a8d026 100644
--- a/kpat/mod3.cpp
+++ b/kpat/mod3.cpp
@@ -37,7 +37,7 @@ Mod3::Mod3( KMainWindow* parent, const char* _name)
deck = Deck::new_deck( this, 2);
deck->move(8 + dist_x * 8 + 20, 8 + dist_y * 3 + margin);
- connect(deck, SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*)));
+ connect(deck, TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*)));
aces = new Pile(50, this);
aces->move(16 + dist_x * 8, 8 + dist_y / 2);
diff --git a/kpat/napoleon.cpp b/kpat/napoleon.cpp
index ffdf245c..7f7c7f95 100644
--- a/kpat/napoleon.cpp
+++ b/kpat/napoleon.cpp
@@ -26,7 +26,7 @@ Napoleon::Napoleon( KMainWindow* parent, const char* _name )
: Dealer( parent, _name )
{
deck = Deck::new_deck( this );
- connect(deck, SIGNAL(clicked(Card *)), SLOT(deal1(Card*)));
+ connect(deck, TQT_SIGNAL(clicked(Card *)), TQT_SLOT(deal1(Card*)));
pile = new Pile( 1, this );
pile->setAddFlags( Pile::disallow );
diff --git a/kpat/pile.cpp b/kpat/pile.cpp
index dd419580..50a15bab 100644
--- a/kpat/pile.cpp
+++ b/kpat/pile.cpp
@@ -1,7 +1,7 @@
#include "pile.h"
#include "dealer.h"
#include <kdebug.h>
-#include <qpainter.h>
+#include <tqpainter.h>
#include "cardmaps.h"
#include <assert.h>
#include "speeds.h"
@@ -22,7 +22,7 @@ const int Pile::wholeColumn = 0x0400;
Pile::Pile( int _index, Dealer* _dealer)
- : QCanvasRectangle( _dealer->canvas() ),
+ : TQCanvasRectangle( _dealer->canvas() ),
m_dealer(_dealer),
m_atype(Custom),
m_rtype(Custom),
@@ -32,13 +32,13 @@ Pile::Pile( int _index, Dealer* _dealer)
// Make the patience aware of this pile.
dealer()->addPile(this);
- QCanvasRectangle::setVisible(true); // default
+ TQCanvasRectangle::setVisible(true); // default
_checkIndex = -1;
m_addFlags = 0;
m_removeFlags = 0;
setBrush(Qt::black);
- setPen(QPen(Qt::black));
+ setPen(TQPen(Qt::black));
setZ(0);
initSizes();
@@ -119,7 +119,7 @@ void Pile::resetCache()
cache_selected.resize(0, 0);
}
-void Pile::drawShape ( QPainter & painter )
+void Pile::drawShape ( TQPainter & painter )
{
if (isSelected()) {
if (cache.isNull())
@@ -193,7 +193,7 @@ bool Pile::legalRemove(const Card *c) const
void Pile::setVisible(bool vis)
{
- QCanvasRectangle::setVisible(vis);
+ TQCanvasRectangle::setVisible(vis);
dealer()->enlargeCanvas(this);
for (CardList::Iterator it = m_cards.begin(); it != m_cards.end(); ++it)
@@ -205,7 +205,7 @@ void Pile::setVisible(bool vis)
void Pile::moveBy(double dx, double dy)
{
- QCanvasRectangle::moveBy(dx, dy);
+ TQCanvasRectangle::moveBy(dx, dy);
dealer()->enlargeCanvas(this);
for (CardList::Iterator it = m_cards.begin(); it != m_cards.end(); ++it)
@@ -277,20 +277,20 @@ void Pile::add( Card *_card, int index)
//
// Note: Default is to only have vertical spread (Y direction).
-QSize Pile::cardOffset( bool _spread, bool _facedown, const Card *before) const
+TQSize Pile::cardOffset( bool _spread, bool _facedown, const Card *before) const
{
if (_spread) {
if (_facedown)
- return QSize(0, dspread());
+ return TQSize(0, dspread());
else {
if (before && !before->isFaceUp())
- return QSize(0, dspread());
+ return TQSize(0, dspread());
else
- return QSize(0, spread());
+ return TQSize(0, spread());
}
}
- return QSize(0, 0);
+ return TQSize(0, 0);
}
/* override cardtype (for initial deal ) */
@@ -310,7 +310,7 @@ void Pile::add( Card* _card, bool _facedown, bool _spread )
_card->turn( !_facedown );
- QSize offset = cardOffset(_spread, _facedown, t);
+ TQSize offset = cardOffset(_spread, _facedown, t);
int x2, y2, z2;
@@ -408,7 +408,7 @@ void Pile::moveCardsBack(CardList &cl, bool anim)
Card *c = cl.first();
Card *before = 0;
- QSize off;
+ TQSize off;
int steps = STEPS_MOVEBACK;
if (!anim)
diff --git a/kpat/pile.h b/kpat/pile.h
index b2b553b0..7dd14f3c 100644
--- a/kpat/pile.h
+++ b/kpat/pile.h
@@ -15,7 +15,7 @@ class Dealer;
*
*/
-class Pile : public QObject, public QCanvasRectangle
+class Pile : public TQObject, public QCanvasRectangle
{
Q_OBJECT
@@ -73,7 +73,7 @@ public:
int index() const { return myIndex; }
bool isEmpty() const { return m_cards.count() == 0; }
- virtual void drawShape ( QPainter & p );
+ virtual void drawShape ( TQPainter & p );
static const int RTTI;
virtual int rtti() const { return RTTI; }
@@ -89,7 +89,7 @@ public:
void hideCards( const CardList & cards );
void unhideCards( const CardList & cards );
- virtual QSize cardOffset( bool _spread, bool _facedown, const Card *before) const;
+ virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const;
void resetCache();
virtual void initSizes();
@@ -149,6 +149,6 @@ private:
KPixmap cache_selected;
};
-typedef QValueList<Pile*> PileList;
+typedef TQValueList<Pile*> PileList;
#endif
diff --git a/kpat/pwidget.cpp b/kpat/pwidget.cpp
index dae69f60..eb12a1c8 100644
--- a/kpat/pwidget.cpp
+++ b/kpat/pwidget.cpp
@@ -20,9 +20,9 @@
#include <stdio.h>
-#include <qregexp.h>
-#include <qtimer.h>
-#include <qimage.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
+#include <tqimage.h>
#include <kapplication.h>
#include <klocale.h>
@@ -59,32 +59,32 @@ pWidget::pWidget()
{
current_pwidget = this;
// KCrash::setEmergencySaveFunction(::saveGame);
- KStdAction::quit(kapp, SLOT(quit()), actionCollection(), "game_exit");
+ KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection(), "game_exit");
- undo = KStdAction::undo(this, SLOT(undoMove()),
+ undo = KStdAction::undo(this, TQT_SLOT(undoMove()),
actionCollection(), "undo_move");
undo->setEnabled(false);
- (void)KStdAction::openNew(this, SLOT(newGame()),
+ (void)KStdAction::openNew(this, TQT_SLOT(newGame()),
actionCollection(), "new_game");
- (void)KStdAction::open(this, SLOT(openGame()),
+ (void)KStdAction::open(this, TQT_SLOT(openGame()),
actionCollection(), "open");
- recent = KStdAction::openRecent(this, SLOT(openGame(const KURL&)),
+ recent = KStdAction::openRecent(this, TQT_SLOT(openGame(const KURL&)),
actionCollection(), "open_recent");
recent->loadEntries(KGlobal::config());
- (void)KStdAction::saveAs(this, SLOT(saveGame()),
+ (void)KStdAction::saveAs(this, TQT_SLOT(saveGame()),
actionCollection(), "save");
- (void)new KAction(i18n("&Choose Game..."), 0, this, SLOT(chooseGame()),
+ (void)new KAction(i18n("&Choose Game..."), 0, this, TQT_SLOT(chooseGame()),
actionCollection(), "choose_game");
- (void)new KAction(i18n("Restart &Game"), QString::fromLatin1("reload"), 0,
- this, SLOT(restart()),
+ (void)new KAction(i18n("Restart &Game"), TQString::fromLatin1("reload"), 0,
+ this, TQT_SLOT(restart()),
actionCollection(), "restart_game");
- (void)KStdAction::help(this, SLOT(helpGame()), actionCollection(), "help_game");
+ (void)KStdAction::help(this, TQT_SLOT(helpGame()), actionCollection(), "help_game");
games = new KSelectAction(i18n("&Game Type"), 0, this,
- SLOT(newGameType()),
+ TQT_SLOT(newGameType()),
actionCollection(), "game_type");
- QStringList list;
- QValueList<DealerInfo*>::ConstIterator it;
+ TQStringList list;
+ TQValueList<DealerInfo*>::ConstIterator it;
uint max_type = 0;
for (it = DealerInfoList::self()->games().begin();
@@ -105,18 +105,18 @@ pWidget::pWidget()
KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "kpat/backgrounds/");
KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "ksnake/backgrounds/");
wallpapers = new KSelectAction(i18n("&Change Background"), 0, this,
- SLOT(changeWallpaper()),
+ TQT_SLOT(changeWallpaper()),
actionCollection(), "wallpaper");
list.clear();
wallpaperlist.clear();
- QStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", QString::null,
+ TQStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", TQString::null,
false, true, list);
- QStringList list2;
- for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
- QString file = *it;
+ TQStringList list2;
+ for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ TQString file = *it;
int rindex = file.findRev('.');
if (rindex != -1) {
- QString ext = file.mid(rindex + 1).lower();
+ TQString ext = file.mid(rindex + 1).lower();
if (ext == "jpeg" || ext == "png" || ext == "jpg") {
list2.append(file.left(rindex));
wallpaperlist.append( file );
@@ -132,27 +132,27 @@ pWidget::pWidget()
(void)new cardMap(midcolor);
backs = new KAction(i18n("&Switch Cards..."), 0, this,
- SLOT(changeBackside()),
+ TQT_SLOT(changeBackside()),
actionCollection(), "backside");
- stats = new KAction(i18n("&Statistics"), 0, this, SLOT(showStats()),
+ stats = new KAction(i18n("&Statistics"), 0, this, TQT_SLOT(showStats()),
actionCollection(),"game_stats");
animation = new KToggleAction(i18n( "&Animation on Startup" ),
- 0, this, SLOT(animationChanged()),
+ 0, this, TQT_SLOT(animationChanged()),
actionCollection(), "animation");
dropaction = new KToggleAction(i18n("&Enable Autodrop"),
- 0, this, SLOT(enableAutoDrop()),
+ 0, this, TQT_SLOT(enableAutoDrop()),
actionCollection(), "enable_autodrop");
dropaction->setCheckedState(i18n("Disable Autodrop"));
KConfig *config = kapp->config();
KConfigGroupSaver cs(config, settings_group );
- QString bgpath = config->readPathEntry("Background");
+ TQString bgpath = config->readPathEntry("Background");
kdDebug(11111) << "bgpath '" << bgpath << "'" << endl;
if (bgpath.isEmpty())
bgpath = locate("wallpaper", "No-Ones-Laughing-3.jpg");
- background = QPixmap(bgpath);
+ background = TQPixmap(bgpath);
bool animate = config->readBoolEntry( "Animation", true);
animation->setChecked( animate );
@@ -167,7 +167,7 @@ pWidget::pWidget()
statusBar()->insertItem( "", 1, 0, true );
- createGUI(QString::null, false);
+ createGUI(TQString::null, false);
KAcceleratorManager::manage(menuBar());
newGameType();
@@ -201,13 +201,13 @@ void pWidget::changeBackside() {
KConfig *config = kapp->config();
KConfigGroupSaver kcs(config, settings_group);
- QString deck = config->readEntry("Back", KCardDialog::getDefaultDeck());
- QString cards = config->readEntry("Cards", KCardDialog::getDefaultCardDir());
- if (KCardDialog::getCardDeck(deck, cards, this, KCardDialog::Both) == QDialog::Accepted)
+ TQString deck = config->readEntry("Back", KCardDialog::getDefaultDeck());
+ TQString cards = config->readEntry("Cards", KCardDialog::getDefaultCardDir());
+ if (KCardDialog::getCardDeck(deck, cards, this, KCardDialog::Both) == TQDialog::Accepted)
{
- QString imgname = KCardDialog::getCardPath(cards, 11);
+ TQString imgname = KCardDialog::getCardPath(cards, 11);
- QImage image;
+ TQImage image;
image.load(imgname);
if( image.isNull()) {
kdDebug(11111) << "cannot load card pixmap \"" << imgname << "\" in " << cards << "\n";
@@ -234,16 +234,16 @@ void pWidget::changeBackside() {
void pWidget::changeWallpaper()
{
- QString bgpath=locate("wallpaper", wallpaperlist[wallpapers->currentItem()]);
+ TQString bgpath=locate("wallpaper", wallpaperlist[wallpapers->currentItem()]);
if (bgpath.isEmpty())
return;
- background = QPixmap(bgpath);
+ background = TQPixmap(bgpath);
if (background.isNull()) {
KMessageBox::sorry(this, i18n("<qt>Couldn't load wallpaper<br/>%1</qt>").arg(bgpath));
return;
}
- QImage bg = background.convertToImage().convertDepth(8, 0);
+ TQImage bg = background.convertToImage().convertDepth(8, 0);
if (bg.isNull() || !bg.numColors())
return;
long r = 0;
@@ -259,14 +259,14 @@ void pWidget::changeWallpaper()
r /= bg.numColors();
b /= bg.numColors();
g /= bg.numColors();
- midcolor = QColor(r, b, g);
+ midcolor = TQColor(r, b, g);
if (dill) {
KConfig *config = kapp->config();
KConfigGroupSaver kcs(config, settings_group);
- QString deck = config->readEntry("Back", KCardDialog::getDefaultDeck());
- QString dummy = config->readEntry("Cards", KCardDialog::getDefaultCardDir());
+ TQString deck = config->readEntry("Back", KCardDialog::getDefaultDeck());
+ TQString dummy = config->readEntry("Cards", KCardDialog::getDefaultCardDir());
setBackSide(deck, dummy);
config->writePathEntry("Background", bgpath);
@@ -322,12 +322,12 @@ void pWidget::restart()
void pWidget::setGameCaption()
{
- QString name = games->currentText();
- QString newname;
- QString gamenum;
+ TQString name = games->currentText();
+ TQString newname;
+ TQString gamenum;
gamenum.setNum( dill->gameNumber() );
for (uint i = 0; i < name.length(); i++)
- if (name.at(i) != QChar('&'))
+ if (name.at(i) != TQChar('&'))
newname += name.at(i);
setCaption( newname + " - " + gamenum );
@@ -340,18 +340,18 @@ void pWidget::newGameType()
slotUpdateMoves();
uint id = games->currentItem();
- for (QValueList<DealerInfo*>::ConstIterator it = DealerInfoList::self()->games().begin(); it != DealerInfoList::self()->games().end(); ++it) {
+ for (TQValueList<DealerInfo*>::ConstIterator it = DealerInfoList::self()->games().begin(); it != DealerInfoList::self()->games().end(); ++it) {
if ((*it)->gameindex == id) {
dill = (*it)->createGame(this);
- QString name = (*it)->name;
- name = name.replace(QRegExp("[&']"), "");
- name = name.replace(QRegExp("[ ]"), "_").lower();
+ TQString name = (*it)->name;
+ name = name.replace(TQRegExp("[&']"), "");
+ name = name.replace(TQRegExp("[ ]"), "_").lower();
dill->setAnchorName("game_" + name);
- connect(dill, SIGNAL(saveGame()), SLOT(saveGame()));
- connect(dill, SIGNAL(gameInfo(const QString&)),
- SLOT(slotGameInfo(const QString &)));
- connect(dill, SIGNAL(updateMoves()),
- SLOT(slotUpdateMoves()));
+ connect(dill, TQT_SIGNAL(saveGame()), TQT_SLOT(saveGame()));
+ connect(dill, TQT_SIGNAL(gameInfo(const TQString&)),
+ TQT_SLOT(slotGameInfo(const TQString &)));
+ connect(dill, TQT_SIGNAL(updateMoves()),
+ TQT_SLOT(slotUpdateMoves()));
dill->setGameId(id);
dill->setupActions();
dill->setBackgroundPixmap(background, midcolor);
@@ -365,9 +365,9 @@ void pWidget::newGameType()
dill = DealerInfoList::self()->games().first()->createGame(this);
}
- connect(dill, SIGNAL(undoPossible(bool)), SLOT(undoPossible(bool)));
- connect(dill, SIGNAL(gameWon(bool)), SLOT(gameWon(bool)));
- connect(dill, SIGNAL(gameLost()), SLOT(gameLost()));
+ connect(dill, TQT_SIGNAL(undoPossible(bool)), TQT_SLOT(undoPossible(bool)));
+ connect(dill, TQT_SIGNAL(gameWon(bool)), TQT_SLOT(gameWon(bool)));
+ connect(dill, TQT_SIGNAL(gameLost()), TQT_SLOT(gameLost()));
dill->setAutoDropEnabled(dropaction->isChecked());
@@ -381,7 +381,7 @@ void pWidget::newGameType()
KConfigGroupSaver kcs(config, settings_group);
config->writeEntry("DefaultGame", id);
- QSize min(700,400);
+ TQSize min(700,400);
min = min.expandedTo(dill->minimumCardSize());
dill->setMinimumSize(min);
dill->resize(min);
@@ -390,14 +390,14 @@ void pWidget::newGameType()
dill->show();
}
-void pWidget::showEvent(QShowEvent *e)
+void pWidget::showEvent(TQShowEvent *e)
{
if (dill)
- dill->setMinimumSize(QSize(0,0));
+ dill->setMinimumSize(TQSize(0,0));
KMainWindow::showEvent(e);
}
-void pWidget::slotGameInfo(const QString &text)
+void pWidget::slotGameInfo(const TQString &text)
{
statusBar()->message(text, 3000);
}
@@ -409,11 +409,11 @@ void pWidget::slotUpdateMoves()
statusBar()->changeItem( i18n("1 move", "%n moves", moves), 1 );
}
-void pWidget::setBackSide(const QString &deck, const QString &cards)
+void pWidget::setBackSide(const TQString &deck, const TQString &cards)
{
KConfig *config = kapp->config();
KConfigGroupSaver kcs(config, settings_group);
- QPixmap pm(deck);
+ TQPixmap pm(deck);
if(!pm.isNull()) {
cardMap::self()->setBackSide(pm, false);
config->writeEntry("Back", deck);
@@ -437,7 +437,7 @@ void pWidget::setBackSide(const QString &deck, const QString &cards)
void pWidget::chooseGame()
{
bool ok;
- long number = KInputDialog::getText(i18n("Game Number"), i18n("Enter a game number (FreeCell deals are the same as in the FreeCell FAQ):"), QString::number(dill->gameNumber()), 0, this).toLong(&ok);
+ long number = KInputDialog::getText(i18n("Game Number"), i18n("Enter a game number (FreeCell deals are the same as in the FreeCell FAQ):"), TQString::number(dill->gameNumber()), 0, this).toLong(&ok);
if (ok) {
dill->setGameNumber(number);
setGameCaption();
@@ -447,7 +447,7 @@ void pWidget::chooseGame()
void pWidget::gameWon(bool withhelp)
{
- QString congrats;
+ TQString congrats;
if (withhelp)
congrats = i18n("Congratulations! We have won!");
else
@@ -455,7 +455,7 @@ void pWidget::gameWon(bool withhelp)
#if TEST_SOLVER == 0
KMessageBox::information(this, congrats, i18n("Congratulations!"));
#endif
- QTimer::singleShot(0, this, SLOT(newGame()));
+ TQTimer::singleShot(0, this, TQT_SLOT(newGame()));
#if TEST_SOLVER == 1
dill->demo();
#endif
@@ -463,17 +463,17 @@ void pWidget::gameWon(bool withhelp)
void pWidget::gameLost()
{
- QString dontAskAgainName = "gameLostDontAskAgain";
+ TQString dontAskAgainName = "gameLostDontAskAgain";
// The following code is taken out of kmessagebox.cpp in kdeui.
// Is there a better way?
KConfig *config = 0;
- QString grpNotifMsgs = QString::fromLatin1("Notification Messages");
+ TQString grpNotifMsgs = TQString::fromLatin1("Notification Messages");
config = KGlobal::config();
KConfigGroupSaver saver(config,
- QString::fromLatin1("Notification Messages"));
- QString dontAsk = config->readEntry(dontAskAgainName).lower();
+ TQString::fromLatin1("Notification Messages"));
+ TQString dontAsk = config->readEntry(dontAskAgainName).lower();
// If we are ordered never to ask again and to continue the game,
// then do so.
@@ -482,7 +482,7 @@ void pWidget::gameLost()
// If it says yes, we ask anyway. Just starting a new game would
// be incredibly annoying.
if (dontAsk == "yes")
- dontAskAgainName = QString::null;
+ dontAskAgainName = TQString::null;
if (KMessageBox::questionYesNo(this, i18n("You could not win this game, "
"but there is always a second try.\nStart a new game?"),
@@ -491,19 +491,19 @@ void pWidget::gameLost()
KStdGuiItem::cont(),
dontAskAgainName) == KMessageBox::Yes) {
- QTimer::singleShot(0, this, SLOT(newGame()));
+ TQTimer::singleShot(0, this, TQT_SLOT(newGame()));
}
}
void pWidget::openGame(const KURL &url)
{
- QString tmpFile;
+ TQString tmpFile;
if( KIO::NetAccess::download( url, tmpFile, this ) )
{
- QFile of(tmpFile);
+ TQFile of(tmpFile);
of.open(IO_ReadOnly);
- QDomDocument doc;
- QString error;
+ TQDomDocument doc;
+ TQString error;
if (!doc.setContent(&of, &error))
{
KMessageBox::sorry(this, error);
@@ -538,9 +538,9 @@ void pWidget::saveGame()
{
KURL url = KFileDialog::getSaveURL();
KTempFile file;
- QDomDocument doc("kpat");
+ TQDomDocument doc("kpat");
dill->saveGame(doc);
- QTextStream *stream = file.textStream();
+ TQTextStream *stream = file.textStream();
*stream << doc.toString();
file.close();
KIO::NetAccess::upload(file.name(), url, this);
diff --git a/kpat/pwidget.h b/kpat/pwidget.h
index 8781960f..36b2272b 100644
--- a/kpat/pwidget.h
+++ b/kpat/pwidget.h
@@ -57,7 +57,7 @@ public slots:
void gameWon(bool withhelp);
void gameLost();
void changeWallpaper();
- void slotGameInfo(const QString &);
+ void slotGameInfo(const TQString &);
void slotUpdateMoves();
void helpGame();
void enableAutoDrop();
@@ -65,8 +65,8 @@ public slots:
private:
void setGameCaption();
- void setBackSide(const QString &deck, const QString &dir);
- virtual void showEvent(QShowEvent *e);
+ void setBackSide(const TQString &deck, const TQString &dir);
+ virtual void showEvent(TQShowEvent *e);
private:
// Members
@@ -81,9 +81,9 @@ private:
KToggleAction *dropaction;
KAction *stats;
- QPixmap background;
- QColor midcolor;
- QStringList wallpaperlist;
+ TQPixmap background;
+ TQColor midcolor;
+ TQStringList wallpaperlist;
KRecentFilesAction *recent;
};
diff --git a/kpat/spider.cpp b/kpat/spider.cpp
index 262c49b9..c8e6abc5 100644
--- a/kpat/spider.cpp
+++ b/kpat/spider.cpp
@@ -68,7 +68,7 @@ Spider::Spider(int suits, KMainWindow* parent, const char* _name)
redeals[column]->setCheckIndex(0);
redeals[column]->setAddFlags(Pile::disallow);
redeals[column]->setRemoveFlags(Pile::disallow);
- connect(redeals[column], SIGNAL(clicked(Card*)), SLOT(deckClicked(Card*)));
+ connect(redeals[column], TQT_SIGNAL(clicked(Card*)), TQT_SLOT(deckClicked(Card*)));
}
// The 10 playing piles
@@ -245,12 +245,12 @@ MoveHint *Spider::chooseHint()
//-------------------------------------------------------------------------//
-QString Spider::getGameState() const
+TQString Spider::getGameState() const
{
- return QString::number(m_leg*10 + m_redeal);
+ return TQString::number(m_leg*10 + m_redeal);
}
-void Spider::setGameState(const QString &stream)
+void Spider::setGameState(const TQString &stream)
{
int i = stream.toInt();
diff --git a/kpat/spider.h b/kpat/spider.h
index ea2cc165..055502ff 100644
--- a/kpat/spider.h
+++ b/kpat/spider.h
@@ -49,8 +49,8 @@ public slots:
protected:
virtual bool checkRemove(int /*checkIndex*/, const Pile *p, const Card *c) const;
virtual bool checkAdd(int /*checkIndex*/, const Pile *c1, const CardList &c2) const;
- virtual QString getGameState() const;
- virtual void setGameState(const QString &stream);
+ virtual TQString getGameState() const;
+ virtual void setGameState(const TQString &stream);
virtual void getHints();
virtual MoveHint *chooseHint();
virtual Card *demoNewCards();