diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:31:10 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:31:10 -0600 |
commit | 0e2b76239f354a9eead0b4e37d86d390ec57ffa9 (patch) | |
tree | cd20202507f54f61a4e58ae64fcd7cdb894abe19 /kmines | |
parent | 84ace1135cac57993b72fee7105b92def1638d32 (diff) | |
download | tdegames-0e2b76239f354a9eead0b4e37d86d390ec57ffa9.tar.gz tdegames-0e2b76239f354a9eead0b4e37d86d390ec57ffa9.zip |
Rename old tq methods that no longer need a unique name
Diffstat (limited to 'kmines')
-rw-r--r-- | kmines/field.cpp | 4 | ||||
-rw-r--r-- | kmines/field.h | 4 | ||||
-rw-r--r-- | kmines/frame.cpp | 12 | ||||
-rw-r--r-- | kmines/kzoommainwindow.cpp | 4 | ||||
-rw-r--r-- | kmines/kzoommainwindow.h | 2 | ||||
-rw-r--r-- | kmines/main.cpp | 2 | ||||
-rw-r--r-- | kmines/main.h | 4 | ||||
-rw-r--r-- | kmines/status.cpp | 52 | ||||
-rw-r--r-- | kmines/status.h | 6 |
9 files changed, 45 insertions, 45 deletions
diff --git a/kmines/field.cpp b/kmines/field.cpp index 035b3708..ff3b4e46 100644 --- a/kmines/field.cpp +++ b/kmines/field.cpp @@ -57,7 +57,7 @@ void Field::readSettings() if ( Settings::magicReveal() ) emit setCheating(); } -TQSize Field::tqsizeHint() const +TQSize Field::sizeHint() const { return TQSize(2*frameWidth() + _level.width()*Settings::caseSize(), 2*frameWidth() + _level.height()*Settings::caseSize()); @@ -117,7 +117,7 @@ void Field::changeCase(const Coord &p, CaseState newState) BaseField::changeCase(p, newState); TQPainter painter(this); drawCase(painter, p); - if ( isActive() ) emit updatetqStatus( hasMine(p) ); + if ( isActive() ) emit updateStatus( hasMine(p) ); } TQPoint Field::toPoint(const Coord &p) const diff --git a/kmines/field.h b/kmines/field.h index 2c21348b..3d443843 100644 --- a/kmines/field.h +++ b/kmines/field.h @@ -39,7 +39,7 @@ class Field : public FieldFrame, public BaseField public: Field(TQWidget *parent); - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() const; void setLevel(const Level &level); void setReplayField(const TQString &field); @@ -68,7 +68,7 @@ class Field : public FieldFrame, public BaseField SolvingState solvingState() const { return _solvingState; } signals: - void updatetqStatus(bool); + void updateStatus(bool); void gameStateChanged(GameState); void setMood(Mood); void setCheating(); diff --git a/kmines/frame.cpp b/kmines/frame.cpp index 5eee07ba..2b348694 100644 --- a/kmines/frame.cpp +++ b/kmines/frame.cpp @@ -36,7 +36,7 @@ FieldFrame::FieldFrame(TQWidget *parent) void FieldFrame::adjustSize() { - setFixedSize(tqsizeHint()); + setFixedSize(sizeHint()); _button.resize(Settings::caseSize(), Settings::caseSize()); TQBitmap mask; @@ -124,22 +124,22 @@ void FieldFrame::drawBox(TQPainter &painter, const TQPoint &p, bool hasFocus) const { qDrawShadePanel(&painter, p.x(), p.y(), _button.width(), _button.height(), - tqcolorGroup(), pressed, 2, - &tqcolorGroup().brush(TQColorGroup::Background)); + colorGroup(), pressed, 2, + &colorGroup().brush(TQColorGroup::Background)); if (hasFocus) { painter.translate(p.x(), p.y()); TQRect fbr = tqstyle().subRect(TQStyle::SR_PushButtonFocusRect, &_button); tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, &painter, fbr, - tqcolorGroup(), TQStyle::Style_Enabled); + colorGroup(), TQStyle::Style_Enabled); painter.resetXForm(); } TQRect r(p, _button.size()); const TQPixmap *pixmap = (type==NoPixmap ? 0 : &_pixmaps[type]); TQColor color = (nbMines==0 ? black : Settings::mineColor(nbMines-1)); - tqstyle().drawItem(&painter, r, AlignCenter, tqcolorGroup(), true, pixmap, + tqstyle().drawItem(&painter, r, AlignCenter, colorGroup(), true, pixmap, text, -1, &color); if ( advised!=-1 ) - tqstyle().drawItem(&painter, r, AlignCenter, tqcolorGroup(), true, + tqstyle().drawItem(&painter, r, AlignCenter, colorGroup(), true, &_advised[advised], TQString()); } diff --git a/kmines/kzoommainwindow.cpp b/kmines/kzoommainwindow.cpp index 1d0f5319..8d0521bc 100644 --- a/kmines/kzoommainwindow.cpp +++ b/kmines/kzoommainwindow.cpp @@ -58,7 +58,7 @@ void KZoomMainWindow::init(const char *popupName) void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - TQWidget *tlw = widget->tqtopLevelWidget(); + TQWidget *tlw = widget->topLevelWidget(); KZoomMainWindow *zm = static_cast<KZoomMainWindow *>(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); @@ -74,7 +74,7 @@ void KZoomMainWindow::widgetDestroyed() bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { if ( e->type()==TQEvent::LayoutHint ) - setFixedSize(tqminimumSize()); // because K/TQMainWindow + setFixedSize(minimumSize()); // because K/TQMainWindow // does not manage fixed central widget // with hidden menubar... return KMainWindow::eventFilter(o, e); diff --git a/kmines/kzoommainwindow.h b/kmines/kzoommainwindow.h index e4353c2d..00092183 100644 --- a/kmines/kzoommainwindow.h +++ b/kmines/kzoommainwindow.h @@ -50,7 +50,7 @@ public: /** Add a widget to be managed i.e. the adjustSize() method of the * widget is called whenever the zoom is changed. - * This function assumes that the tqtopLevelWidget() is the KZoomMainWindow. + * This function assumes that the topLevelWidget() is the KZoomMainWindow. */ static void addWidget(TQWidget *widget); diff --git a/kmines/main.cpp b/kmines/main.cpp index d1453b3f..9cdcec4d 100644 --- a/kmines/main.cpp +++ b/kmines/main.cpp @@ -62,7 +62,7 @@ MainWidget::MainWidget() { KNotifyClient::startDaemon(); - _status = new tqStatus(this); + _status = new Status(this); connect(_status, TQT_SIGNAL(gameStateChangedSignal(KMines::GameState)), TQT_SLOT(gameStateChanged(KMines::GameState))); connect(_status, TQT_SIGNAL(pause()), TQT_SLOT(pause())); diff --git a/kmines/main.h b/kmines/main.h index 7fb10eda..31221e76 100644 --- a/kmines/main.h +++ b/kmines/main.h @@ -26,7 +26,7 @@ class KAction; class KToggleAction; class KSelectAction; -class tqStatus; +class Status; class MainWidget : public KZoomMainWindow, public KMines { @@ -50,7 +50,7 @@ class MainWidget : public KZoomMainWindow, public KMines virtual bool queryExit(); private: - tqStatus *_status; + Status *_status; KToggleAction *_pause; KSelectAction *_levels; KAction *_advise, *_solve; diff --git a/kmines/status.cpp b/kmines/status.cpp index 31fd7b36..2d081628 100644 --- a/kmines/status.cpp +++ b/kmines/status.cpp @@ -45,7 +45,7 @@ #include "version.h" -tqStatus::tqStatus(TQWidget *parent) +Status::Status(TQWidget *parent) : TQWidget(parent, "status"), _oldLevel(Level::Easy) { _timer = new TQTimer(this); @@ -93,7 +93,7 @@ tqStatus::tqStatus(TQWidget *parent) _field = new Field(_fieldContainer); _field->readSettings(); g->addWidget(_field, 0, 0, AlignCenter); - connect( _field, TQT_SIGNAL(updatetqStatus(bool)), TQT_SLOT(updatetqStatus(bool)) ); + connect( _field, TQT_SIGNAL(updateStatus(bool)), TQT_SLOT(updateStatus(bool)) ); connect(_field, TQT_SIGNAL(gameStateChanged(GameState)), TQT_SLOT(gameStateChangedSlot(GameState)) ); connect(_field, TQT_SIGNAL(setMood(Mood)), smiley, TQT_SLOT(setMood(Mood))); @@ -120,13 +120,13 @@ tqStatus::tqStatus(TQWidget *parent) top->addMultiCellWidget(_stack, 1, 1, 0, 4); } -void tqStatus::smileyClicked() +void Status::smileyClicked() { if ( _field->gameState()==Paused ) emit pause(); else restartGame(); } -void tqStatus::newGame(int t) +void Status::newGame(int t) { if ( _field->gameState()==Paused ) emit pause(); Level::Type type = (Level::Type)t; @@ -135,7 +135,7 @@ void tqStatus::newGame(int t) else newGame( Settings::customLevel() ); } -void tqStatus::newGame(const Level &level) +void Status::newGame(const Level &level) { _timer->stop(); if ( level.type()!=Level::Custom ) @@ -143,14 +143,14 @@ void tqStatus::newGame(const Level &level) _field->setLevel(level); } -bool tqStatus::checkBlackMark() +bool Status::checkBlackMark() { bool bm = ( _field->gameState()==Playing ); if (bm) KExtHighscore::submitScore(KExtHighscore::Lost, this); return bm; } -void tqStatus::restartGame() +void Status::restartGame() { if ( _field->gameState()==Paused ) emit pause(); else if ( _field->gameState()==Replaying ) { @@ -162,7 +162,7 @@ void tqStatus::restartGame() } } -void tqStatus::settingsChanged() +void Status::settingsChanged() { _field->readSettings(); @@ -173,7 +173,7 @@ void tqStatus::settingsChanged() newGame(l); } -void tqStatus::updatetqStatus(bool mine) +void Status::updateStatus(bool mine) { int r = _field->nbMines() - _field->nbMarked(); TQColor color = (r<0 && !_field->isSolved() ? red : white); @@ -184,7 +184,7 @@ void tqStatus::updatetqStatus(bool mine) gameStateChanged(GameOver, true); // ends only for wins } -void tqStatus::setGameOver(bool won) +void Status::setGameOver(bool won) { if ( !won ) KNotifyClient::event(winId(), "explosion", i18n("Explosion!")); @@ -218,16 +218,16 @@ void tqStatus::setGameOver(bool won) f.appendChild(data); } -void tqStatus::setStopped() +void Status::setStopped() { smiley->setMood(Normal); - updatetqStatus(false); + updateStatus(false); bool custom = ( _field->level().type()==Level::Custom ); dg->reset(custom); _field->setSolvingState(Regular); } -void tqStatus::setPlaying() +void Status::setPlaying() { smiley->setMood(Normal); dg->start(); @@ -238,7 +238,7 @@ void tqStatus::setPlaying() _log = TQDomDocument("kmineslog"); _logRoot = _log.createElement("kmineslog"); _logRoot.setAttribute("version", SHORT_VERSION); - TQDateTime date = TQDateTime::tqcurrentDateTime(); + TQDateTime date = TQDateTime::currentDateTime(); _logRoot.setAttribute("date", date.toString(Qt::ISODate)); _logRoot.setAttribute("width", level.width()); _logRoot.setAttribute("height", level.height()); @@ -248,7 +248,7 @@ void tqStatus::setPlaying() _logRoot.appendChild(_logList); } -void tqStatus::gameStateChanged(GameState state, bool won) +void Status::gameStateChanged(GameState state, bool won) { TQWidget *w = _fieldContainer; @@ -280,7 +280,7 @@ void tqStatus::gameStateChanged(GameState state, bool won) emit gameStateChangedSignal(state); } -void tqStatus::addAction(const KGrid2D::Coord &c, Field::ActionType type) +void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type) { TQDomElement action = _log.createElement("Action"); action.setAttribute("time", dg->pretty()); @@ -291,7 +291,7 @@ void tqStatus::addAction(const KGrid2D::Coord &c, Field::ActionType type) dg->addAction(); } -void tqStatus::advise() +void Status::advise() { int res = KMessageBox::warningContinueCancel(this, i18n("When the solver gives " @@ -304,25 +304,25 @@ void tqStatus::advise() _field->setAdvised(c, probability); } -void tqStatus::solve() +void Status::solve() { dg->setCheating(); _solver->solve(*_field, false); _field->setSolvingState(Solved); } -void tqStatus::solvingDone(bool success) +void Status::solvingDone(bool success) { if ( !success ) gameStateChanged(GameOver, false); } -void tqStatus::solveRate() +void Status::solveRate() { SolvingRateDialog sd(*_field, this); sd.exec(); } -void tqStatus::viewLog() +void Status::viewLog() { KDialogBase d(this, "view_log", true, i18n("View Game Log"), KDialogBase::Close, KDialogBase::Close); @@ -335,7 +335,7 @@ void tqStatus::viewLog() d.exec(); } -void tqStatus::saveLog() +void Status::saveLog() { KURL url = KFileDialog::getSaveURL(TQString(), TQString(), this); if ( url.isEmpty() ) return; @@ -354,7 +354,7 @@ void tqStatus::saveLog() tmp.unlink(); } -void tqStatus::loadLog() +void Status::loadLog() { KURL url = KFileDialog::getOpenURL(TQString(), TQString(), this); if ( url.isEmpty() ) return; @@ -390,7 +390,7 @@ void tqStatus::loadLog() } } -bool tqStatus::checkLog(const TQDomDocument &doc) +bool Status::checkLog(const TQDomDocument &doc) { // check root element if ( doc.doctype().name()!="kmineslog" ) return false; @@ -435,7 +435,7 @@ bool tqStatus::checkLog(const TQDomDocument &doc) } -void tqStatus::replayLog() +void Status::replayLog() { uint w = _logRoot.attribute("width").toUInt(); uint h = _logRoot.attribute("height").toUInt(); @@ -454,7 +454,7 @@ void tqStatus::replayLog() _timer->start(500); } -void tqStatus::replayStep() +void Status::replayStep() { if ( _index>=_actions.count() ) { _timer->stop(); diff --git a/kmines/status.h b/kmines/status.h index a91fcda9..eec7b608 100644 --- a/kmines/status.h +++ b/kmines/status.h @@ -30,12 +30,12 @@ class Solver; class TQWidgetStack; class TQTimer; -class tqStatus : public TQWidget, public KMines +class Status : public TQWidget, public KMines { Q_OBJECT TQ_OBJECT public : - tqStatus(TQWidget *parent); + Status(TQWidget *parent); const Level ¤tLevel() const { return _field->level(); } bool isPlaying() const { return _field->gameState()==Playing; } @@ -51,7 +51,7 @@ class tqStatus : public TQWidget, public KMines public slots: void newGame(int type); void restartGame(); - void updatetqStatus(bool); + void updateStatus(bool); void pauseGame() { _field->pause(); } void moveUp() { _field->moveCursor(KGrid2D::SquareBase::Up); } |