[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_2_BRANCH: kdegames/kpoker
From:       Nicolas Hadacek <hadacek () kde ! org>
Date:       2004-02-24 3:53:10
Message-ID: 20040224035310.C3B369190 () office ! kde ! org
[Download RAW message or body]

CVS commit by hadacek: 

backport fix for memory leak (bug #73222) and layout (bug #65672) 


  M +13 -4     kpoker.cpp   1.68.2.1


--- kdegames/kpoker/kpoker.cpp  #1.68:1.68.2.1
@@ -588,8 +588,17 @@ void kpok::displayWinner_Computer(Player
 
  winner->setCash(winner->getCash() + pot);
+ QString label;
+ if (winner->getHuman())
+   label = i18n("You won %1").arg(KGlobal::locale()->formatMoney(pot));
+ else
+   label = i18n("%1 won \
%2").arg(winner->getName()).arg(KGlobal::locale()->formatMoney(pot)); + \
wonLabel->setText(label); + QFont waveFont;
+ waveFont.setBold(true);
+ waveFont.setPointSize(16);
+ QFontMetrics tmp(waveFont);
+ mWonWidget->setMinimumWidth(tmp.width(label) + 20);
  if (winner->getHuman()) {
         playSound("win.wav");
-        wonLabel->setText(i18n("You won \
                %1").arg(KGlobal::locale()->formatMoney(pot)));
-        wonLabel->show();
         wonLabel->hide();
         startWave();
@@ -597,5 +606,4 @@ void kpok::displayWinner_Computer(Player
  else {
         playSound("lose.wav");
-        wonLabel->setText(i18n("%1 won \
%2").arg(winner->getName()).arg(KGlobal::locale()->formatMoney(pot)));  \
wonLabel->show();  }
@@ -1035,4 +1043,5 @@ void kpok::toggleAdjust() { setAdjust(!a
 void kpok::slotPreferences()
 {
+ if ( mOptions==0 )
  mOptions = new OptionsDlg(this, 0, player.count() + removedPlayers.count());
  if (player.count() + removedPlayers.count() > 1)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic