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

List:       kde-commits
Subject:    kdegames/katomic
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2003-07-22 19:34:50
[Download RAW message or body]

CVS commit by aacid: 

Not reuse the KScoreDialog, this fixes the bug # 58185
CCMAIL:58185-done@bugs.kde.org


  M +14 -11    gamewidget.cpp   1.18
  M +1 -2      gamewidget.h   1.8


--- kdegames/katomic/gamewidget.cpp  #1.17:1.18
@@ -86,9 +86,13 @@ void GameWidget::gameOver(int moves) {
     KMessageBox::information(this, i18n("You solved level %1 with %2 \
moves!").arg(level).arg(moves), i18n("Congratulations"));  
+    KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this);
+    high.setCaption(i18n("Level %1 High Scores").arg(level));
+    high.setConfigGroup(QString("High Scores Level %1").arg(level));
+
     KScoreDialog::FieldInfo scoreInfo;
 
-    if (high->addScore(moves, scoreInfo, true, true))
+    if (high.addScore(moves, scoreInfo, true, true))
     {
-       high->exec();
+       high.exec();
     }
     updateLevel(level+1);
@@ -113,9 +117,7 @@ void GameWidget::updateLevel (int l)
     feld->load(cfg);
 
-    QString group = QString("High Scores Level %1").arg(level);
-    high->setConfigGroup(group);
-    QString caption = i18n("Level %1 High Scores").arg(level);
-    high->setCaption(caption);
-    highest.setNum(high->highScore());
+    KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this);
+    high.setConfigGroup(QString("High Scores Level %1").arg(level));
+    highest.setNum(high.highScore());
 
     hs->setText(highest);
@@ -186,6 +188,4 @@ GameWidget::GameWidget ( QWidget *parent
     slay->addWidget(ys);
 
-    high = new KScoreDialog(KScoreDialog::Name | KScoreDialog::Score, this);
-
     updateLevel(1);
 
@@ -212,5 +212,8 @@ GameWidget::~GameWidget()
 void GameWidget::showHighscores ()
 {
-    high->exec();
+    KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this);
+    high.setCaption(i18n("Level %1 High Scores").arg(level));
+    high.setConfigGroup(QString("High Scores Level %1").arg(level));
+    high.exec();
 }
 

--- kdegames/katomic/gamewidget.h  #1.7:1.8
@@ -60,5 +60,4 @@ class GameWidget : public QWidget
     QLabel *hs, *ys;
     QString highest, current;
-    KScoreDialog *high;
     
     int nlevels;


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

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