KDEGames
kgamehighscore.cpp
72 if (d->global && lockedConfig->lock == 0) // If we're doing global highscores but not KFileLock has been set up yet
102 const QString filename = QString::fromLocal8Bit("%1/%2.scores").arg(HIGHSCORE_DIRECTORY).arg(appname);
200 return (d->global ? lockedConfig->config : static_cast<KConfig *>(KSharedConfig::openConfig().data()));
227QVariant KGameHighscore::readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const
293 if (group.contains(QLatin1String("KHighscore"))) // If it's one of _our_ groups (KHighscore or KHighscore_xxx)
312 return (d->global ? highscoreGroup() : QStringLiteral("%1_%2").arg(QStringLiteral(GROUP), highscoreGroup()));
bool hasGroup(const QString &group) const
bool hasKey(const char *key) const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QString readEntry(const char *key, const char *aDefault=nullptr) const
QStringList groupList() const override
NoGlobals
QStringList groupList() const
Returns a list of group names without the KHighscore_ prexix.
Definition kgamehighscore.cpp:288
void writeList(const QString &key, const QStringList &list)
Writes a list of entries to the highscore table.
Definition kgamehighscore.cpp:267
bool hasEntry(int entry, const QString &key) const
Definition kgamehighscore.cpp:248
void writeAndUnlock()
Effectively write and unlock the system-wide highscore file (.
Definition kgamehighscore.cpp:175
bool lockForWriting(QWidget *widget=nullptr)
Lock the system-wide highscore file for writing (does nothing and return true if the local file is us...
Definition kgamehighscore.cpp:135
void writeEntry(int entry, const QString &key, const QString &value)
Definition kgamehighscore.cpp:219
static void init(const char *appname)
This method open the system-wide highscore file using the effective group id of the game executable (...
Definition kgamehighscore.cpp:99
int readNumEntry(int entry, const QString &key, int pDefault=-1) const
Read a numeric value.
Definition kgamehighscore.cpp:241
QString readEntry(int entry, const QString &key, const QString &pDefault=QString()) const
Reads an entry from the highscore table.
Definition kgamehighscore.cpp:234
QStringList readList(const QString &key, int lastEntry=20) const
Reads a list of entries from the highscore table starting at 1 until lastEntry.
Definition kgamehighscore.cpp:255
bool hasTable() const
You can use this function to indicate whether KGameHighscore created a highscore table before and - i...
Definition kgamehighscore.cpp:315
void readCurrentConfig()
Read the current state of the highscore file.
Definition kgamehighscore.cpp:91
QVariant readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const
Read a QVariant entry.
Definition kgamehighscore.cpp:227
void setHighscoreGroup(const QString &groupname=QString())
Set the new highscore group.
Definition kgamehighscore.cpp:274
void setText(const QString &text)
Q_SCRIPTABLE Q_NOREPLY void abort()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
Cancel
KGuiItem cont()
KGuiItem cancel()
void append(QList< T > &&value)
qsizetype count() const const
void reserve(qsizetype size)
QString arg(Args &&... args) const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
QString fromLocal8Bit(QByteArrayView str)
QString & remove(QChar ch, Qt::CaseSensitivity cs)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:56:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:56:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.