rev 4862 - in trunk/packages/kdegames/debian: . patches

Josh Metzler jdmetz-guest at alioth.debian.org
Wed Nov 8 01:41:16 CET 2006


Author: jdmetz-guest
Date: 2006-11-08 01:41:16 +0100 (Wed, 08 Nov 2006)
New Revision: 4862

Removed:
   trunk/packages/kdegames/debian/katomic.preinst
Modified:
   trunk/packages/kdegames/debian/changelog
   trunk/packages/kdegames/debian/patches/10_fix_highscores_display.diff
Log:
A new patch that doesn't muck with users' config files on install.  It now looks for the old High Scores key if the new Highscores key is missing and copies over all the scores.

Modified: trunk/packages/kdegames/debian/changelog
===================================================================
--- trunk/packages/kdegames/debian/changelog	2006-11-07 23:22:47 UTC (rev 4861)
+++ trunk/packages/kdegames/debian/changelog	2006-11-08 00:41:16 UTC (rev 4862)
@@ -5,12 +5,10 @@
 
   [ Josh Metzler ]
   * Add 10_fix_highscores_display.diff to read the correct high scores config
-    key as part of a fix for #396563.
-  * Add a katomic.preinst that will update all users' katomicrc files to have
-    the new config keys for high scores, so that high scores are preserved
-    when upgrading from a pre 3.5 version of katomic.  Closes: #396563.
+    key and copy over high scores from the old config key if it exists and the
+    new one doesn't. Closes: #396563.
 
- -- Josh Metzler <josh at metzlers.org>  Tue,  7 Nov 2006 12:41:33 -0500
+ -- Josh Metzler <joshdeb at metzlers.org>  Tue,  7 Nov 2006 17:43:40 -0500
 
 kdegames (4:3.5.5-1) unstable; urgency=low
 

Deleted: trunk/packages/kdegames/debian/katomic.preinst

Modified: trunk/packages/kdegames/debian/patches/10_fix_highscores_display.diff
===================================================================
--- trunk/packages/kdegames/debian/patches/10_fix_highscores_display.diff	2006-11-07 23:22:47 UTC (rev 4861)
+++ trunk/packages/kdegames/debian/patches/10_fix_highscores_display.diff	2006-11-08 00:41:16 UTC (rev 4862)
@@ -1,11 +1,53 @@
 --- a/katomic/gamewidget.cpp	2005-10-10 10:56:03.000000000 -0400
-+++ b/katomic/gamewidget.cpp	2006-11-07 12:05:49.000000000 -0500
-@@ -127,7 +127,7 @@
++++ b/katomic/gamewidget.cpp	2006-11-07 17:37:34.000000000 -0500
+@@ -115,6 +115,25 @@
+     ys->setText(current);
+ }
+ 
++void GameWidget::mergeHighScores(int l)
++{
++    KConfigGroup oldConfig(kapp->config(), QString("High Scores Level %1").arg(l).utf8());
++    KConfigGroup newConfig(kapp->config(), QString("Highscores Level %1").arg(l).utf8());
++
++    newConfig.writeEntry("LastPlayer", oldConfig.readEntry("LastPlayer"));
++
++    QString num;
++    for (int i = 1; i <= 10; ++i)
++    {
++	num.setNum(i);
++	QString key = "Pos" + num + "Name";
++        newConfig.writeEntry(key, oldConfig.readEntry(key, "-"));
++	key = "Pos" + num + "Score";
++	newConfig.writeEntry(key, oldConfig.readEntry(key, "-"));
++    }
++    kapp->config()->sync();
++}
++
+ void GameWidget::updateLevel (int l)
+ {
+     level=l;
+@@ -127,7 +146,11 @@
      cfg.setGroup("Level");
      feld->load(cfg);
  
 -    highScore->setConfigGroup(QString("High Scores Level %1").arg(level));
++    if (!kapp->config()->hasGroup(QString("Highscores Level %1").arg(level)) &&
++            kapp->config()->hasGroup(QString("High Scores Level %1").arg(level)))
++	mergeHighScores(level);
++
 +    highScore->setConfigGroup(QString("Highscores Level %1").arg(level));
      highest.setNum(highScore->highScore());
  
      if (highest != "0" ) hs->setText(highest);
+--- a/katomic/gamewidget.h	2005-09-10 04:18:09.000000000 -0400
++++ b/katomic/gamewidget.h	2006-11-07 17:40:57.000000000 -0500
+@@ -28,6 +28,9 @@
+     // bringt level auf neuesten stand
+     void updateLevel (int);
+ 
++    // copy highscores from "High Scores" key to "Highscores" key
++    void mergeHighScores(int l);
++
+     // restart current level
+     void restartLevel();
+ 




More information about the pkg-kde-commits mailing list