summaryrefslogtreecommitdiff
path: root/noncore/games/kpacman/score.cpp
Unidiff
Diffstat (limited to 'noncore/games/kpacman/score.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kpacman/score.cpp61
1 files changed, 0 insertions, 61 deletions
diff --git a/noncore/games/kpacman/score.cpp b/noncore/games/kpacman/score.cpp
index 17dbf0a..b3ff3d9 100644
--- a/noncore/games/kpacman/score.cpp
+++ b/noncore/games/kpacman/score.cpp
@@ -480,30 +480,2 @@ void Score::write()
480{ 480{
481#ifndef QWS
482 if (!highscoreFile.exists() && highscoreFile.name() == systemHighscoreFileInfo.filePath())
483 KMessageBox::information(0,
484 tr("You're going to create the highscore-file\n"
485 "'%1'\n"
486 "for your maschine, that should be used systemwide.\n"
487 "\n"
488 "To grant access to the other users, set the appropriate rights (a+w)\n"
489 "on that file or ask your systemadministator for that favor.\n"
490 "\n"
491 "To use a different directory or filename for the highscores,"
492 "specify them in the configfile (kpacmanrc:highscoreFilePath)."
493 ).arg(systemHighscoreFileInfo.filePath()));
494
495 if (highscoreFile.name() == privateHighscoreFileInfo.filePath())
496 KMessageBox::information(0,
497 tr("You're using a private highscore-file, that's mostly because of\n"
498 "missing write-access to the systemwide file\n"
499 "'%1' .\n"
500 "\n"
501 "Ask your systemadministrator for granting you access to that file,\n"
502 "by setting the appropriate rights (a+w) on it.\n"
503 "\n"
504 "To use a different directory or filename for the highscores,"
505 "specify them in the configfile (kpacmanrc:highscoreFilePath)."
506 ).arg(systemHighscoreFileInfo.filePath()),
507 QString::null, "PrivateHighscore");
508#endif
509 if (highscoreFile.open(IO_WriteOnly)) { 481 if (highscoreFile.open(IO_WriteOnly)) {
@@ -607,35 +579,2 @@ QFileInfo Score::locateHighscoreFilePath()
607{ 579{
608#ifndef QWS
609 QFileInfo systemHighscoreDirPath;
610 QStringList systemHighscoreDirs;
611
612 // Schreibfähige "private" highscore-Datei ermitteln für den fallback.
613 privateHighscoreFileInfo.setFile(KGlobal::dirs()->saveLocation("appdata")+highscoreName);
614
615 // FilePath aus der Konfigurationsdatei benutzen
616 systemHighscoreFileInfo.setFile(cfg->readEntry("HighscoreFilePath"));
617
618 // Kein Wert aus der Konfiguration erhalten, dann die "system"-Datei suchen.
619 if (systemHighscoreFileInfo.filePath().isEmpty())
620 systemHighscoreDirs = KGlobal::dirs()->resourceDirs("appdata");
621 else
622 systemHighscoreDirs = QStringList(systemHighscoreFileInfo.filePath());
623
624 for (QStringList::Iterator i = systemHighscoreDirs.begin(); i != systemHighscoreDirs.end(); ++i) {
625
626 systemHighscoreFileInfo.setFile(*i);
627 if (systemHighscoreFileInfo.fileName().isEmpty())
628 systemHighscoreFileInfo.setFile(systemHighscoreFileInfo.dirPath()+"/"+highscoreName);
629
630 // privateHighscoreFileInfo für die "system" Suche ignorieren
631 if (systemHighscoreFileInfo.filePath() != privateHighscoreFileInfo.filePath())
632 if (!systemHighscoreFileInfo.exists()) {
633 systemHighscoreDirPath.setFile(systemHighscoreFileInfo.dirPath());
634 if (systemHighscoreDirPath.exists() && systemHighscoreDirPath.isWritable())
635 return systemHighscoreFileInfo;
636 } else
637 if (systemHighscoreFileInfo.isWritable())
638 return systemHighscoreFileInfo;
639 }
640#endif
641 return privateHighscoreFileInfo; 580 return privateHighscoreFileInfo;