Commit fc3e17ec authored by Ian Wadham's avatar Ian Wadham
Browse files

Add documentation, remove debug lines, tidy up comments and code layout.

svn path=/branches/work/kgoldrunner-qgv/; revision=1298062
parent bb018b1e
......@@ -19,16 +19,14 @@
#include <QFileInfo>
#include <QDir>
#include <QDebug>
#include "kgrthemetypes.h"
// Helper: finds the absolute path of a file pointed to by the .desktop file.
// Helper: Find the absolute path of a file pointed to by the .desktop file.
QString absolutePath (const QString & path, const QString & relativePath)
{
const QFileInfo file (path);
const QDir dir = file.dir();
QString result = "";
const QFileInfo file (path);
const QDir dir = file.dir();
QString result = "";
// Add the directory part of "path" to "relativePath".
if (!relativePath.isEmpty() && QFileInfo(relativePath).isRelative()) {
result = dir.absoluteFilePath(relativePath);
......@@ -40,23 +38,19 @@ KGrActorsTheme::KGrActorsTheme(const QByteArray &identifier, QObject *parent)
:
KgTheme(identifier, parent)
{
qDebug() << "KGrActorsTheme constructor";
}
KGrActorsTheme::~KGrActorsTheme()
{
qDebug() << "KGrActorsTheme destructor";
}
bool KGrActorsTheme::readFromDesktopFile(const QString& path)
{
qDebug() << "KGrActorsTheme::readFromDesktopFile" << path;
// Base class call.
// Base-class call.
if (!KgTheme::readFromDesktopFile(path))
return false;
// Customised behaviour: interprete "Actors" key as "FileName" for SVG file.
qDebug() << "Calling setGraphicsPath" << absolutePath (path, customData("Actors"));
setGraphicsPath (absolutePath (path, customData("Actors")));
return true;
}
......@@ -65,23 +59,19 @@ KGrSetTheme::KGrSetTheme(const QByteArray &identifier, QObject *parent)
:
KgTheme(identifier, parent)
{
qDebug() << "KGrSetTheme constructor";
}
KGrSetTheme::~KGrSetTheme()
{
qDebug() << "KGrSetTheme destructor";
}
bool KGrSetTheme::readFromDesktopFile(const QString& path)
{
qDebug() << "KGrSetTheme::readFromDesktopFile" << path;
// Base class call.
// Base-class call.
if (!KgTheme::readFromDesktopFile(path))
return false;
// Customised behaviour: interprete "Set" key as "FileName" for SVG file.
qDebug() << "Calling setGraphicsPath" << absolutePath (path, customData("Set"));
setGraphicsPath (absolutePath (path, customData("Set")));
return true;
}
......
......@@ -20,6 +20,9 @@
#include <KgTheme>
/**
* Class to locate KGoldrunner's "Actors" SVG files: derived from KgTheme.
*/
class KGrActorsTheme : public KgTheme
{
Q_OBJECT
......@@ -27,9 +30,18 @@ public:
Q_INVOKABLE KGrActorsTheme(const QByteArray &identifier, QObject *parent=0);
virtual ~KGrActorsTheme();
/*
* Re-defined from KgTheme. Finds a SVG file with config name "Actors".
*
* @param path The full path of the theme's .desktop file.
*/
bool readFromDesktopFile(const QString& path);
};
/**
* Class to locate KGoldrunner's "Set" SVG files: derived from KgTheme.
*/
class KGrSetTheme : public KgTheme
{
Q_OBJECT
......@@ -37,6 +49,11 @@ public:
Q_INVOKABLE KGrSetTheme(const QByteArray &identifier, QObject *parent=0);
virtual ~KGrSetTheme();
/*
* Re-defined from KgTheme. Finds a SVG file with config name "Set".
*
* @param path The full path of the theme's .desktop file.
*/
bool readFromDesktopFile(const QString& path);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment