libkdegames/highscore
khighscore.cpp
Go to the documentation of this file.
74 if ( d->global && lockedConfig->lock==0 ) //If we're doing global highscores but not KFileLock has been set up yet
102 /*if (!(QFile::permissions(filename) & QFile::WriteOwner)) kFatal(11002) << "cannot write to global highscore file \""
139 int res = KMessageBox::warningContinueCancel(widget, i18n("Cannot access the highscore file. Another user is probably currently writing to it."), QString(), item, KStandardGuiItem::cancel(), QLatin1String( "ask_lock_global_highscore_file" ));
195 QVariant KHighscore::readPropertyEntry(int entry, const QString& key, const QVariant& pDefault) const
255 if(group.contains( QLatin1String( "KHighscore")) ) //If it's one of _our_ groups (KHighscore or KHighscore_xxx)
QStringList readList(const QString &key, int lastEntry=20) const
Reads a list of entries from the highscore table starting at 1 until lastEntry.
Definition: khighscore.cpp:223
void setHighscoreGroup(const QString &groupname=QLatin1String(""))
Set the new highscore group.
Definition: khighscore.cpp:239
QString & remove(int position, int n)
int readNumEntry(int entry, const QString &key, int pDefault=-1) const
Read a numeric value.
Definition: khighscore.cpp:209
bool hasEntry(int entry, const QString &key) const
Definition: khighscore.cpp:216
int count(const T &value) const
QString fromLocal8Bit(const char *str, int size)
void append(const T &value)
static void init(const char *appname)
This method open the system-wide highscore file using the effective group id of the game executable (...
Definition: khighscore.cpp:93
QStringList groupList() const
Returns a list of group names without the KHighscore_ prexix.
Definition: khighscore.cpp:249
bool hasTable() const
You can use this function to indicate whether KHighscore created a highscore table before and - if no...
Definition: khighscore.cpp:277
void writeAndUnlock()
Effectively write and unlock the system-wide highscore file (.
Definition: khighscore.cpp:147
QVariant readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const
Read a QVariant entry.
Definition: khighscore.cpp:195
bool contains(QChar ch, Qt::CaseSensitivity cs) const
QString readEntry(int entry, const QString &key, const QString &pDefault=QLatin1String("")) const
Reads an entry from the highscore table.
Definition: khighscore.cpp:202
void writeList(const QString &key, const QStringList &list)
Writes a list of entries to the highscore table.
Definition: khighscore.cpp:232
QString fromLatin1(const char *str, int size)
bool lockForWriting(QWidget *widget=0)
Lock the system-wide highscore file for writing (does nothing and return true if the local file is us...
Definition: khighscore.cpp:119
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void writeEntry(int entry, const QString &key, const QString &value)
Definition: khighscore.cpp:187
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.