Improve appearance page more
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
#include "FileSystem.h"
|
||||
#include "Json.h"
|
||||
|
||||
QString BasicCatPack::path()
|
||||
QString BasicCatPack::path() const
|
||||
{
|
||||
const auto now = QDate::currentDate();
|
||||
const auto birthday = QDate(now.year(), 11, 1);
|
||||
@@ -100,12 +100,12 @@ QDate ensureDay(int year, int month, int day)
|
||||
return QDate(year, month, day);
|
||||
}
|
||||
|
||||
QString JsonCatPack::path()
|
||||
QString JsonCatPack::path() const
|
||||
{
|
||||
return path(QDate::currentDate());
|
||||
}
|
||||
|
||||
QString JsonCatPack::path(QDate now)
|
||||
QString JsonCatPack::path(QDate now) const
|
||||
{
|
||||
for (auto var : m_variants) {
|
||||
QDate startDate = ensureDay(now.year(), var.startTime.month, var.startTime.day);
|
||||
|
||||
@@ -43,18 +43,18 @@
|
||||
class CatPack {
|
||||
public:
|
||||
virtual ~CatPack() {}
|
||||
virtual QString id() = 0;
|
||||
virtual QString name() = 0;
|
||||
virtual QString path() = 0;
|
||||
virtual QString id() const = 0;
|
||||
virtual QString name() const = 0;
|
||||
virtual QString path() const = 0;
|
||||
};
|
||||
|
||||
class BasicCatPack : public CatPack {
|
||||
public:
|
||||
BasicCatPack(QString id, QString name) : m_id(id), m_name(name) {}
|
||||
BasicCatPack(QString id) : BasicCatPack(id, id) {}
|
||||
virtual QString id() override { return m_id; }
|
||||
virtual QString name() override { return m_name; }
|
||||
virtual QString path() override;
|
||||
virtual QString id() const override { return m_id; }
|
||||
virtual QString name() const override { return m_name; }
|
||||
virtual QString path() const override;
|
||||
|
||||
protected:
|
||||
QString m_id;
|
||||
@@ -65,7 +65,7 @@ class FileCatPack : public BasicCatPack {
|
||||
public:
|
||||
FileCatPack(QString id, QFileInfo& fileInfo) : BasicCatPack(id), m_path(fileInfo.absoluteFilePath()) {}
|
||||
FileCatPack(QFileInfo& fileInfo) : FileCatPack(fileInfo.baseName(), fileInfo) {}
|
||||
virtual QString path() { return m_path; }
|
||||
virtual QString path() const { return m_path; }
|
||||
|
||||
private:
|
||||
QString m_path;
|
||||
@@ -83,8 +83,8 @@ class JsonCatPack : public BasicCatPack {
|
||||
PartialDate endTime;
|
||||
};
|
||||
JsonCatPack(QFileInfo& manifestInfo);
|
||||
virtual QString path() override;
|
||||
QString path(QDate now);
|
||||
virtual QString path() const override;
|
||||
QString path(QDate now) const;
|
||||
|
||||
private:
|
||||
QString m_default_path;
|
||||
|
||||
@@ -47,6 +47,7 @@ struct LogColors {
|
||||
};
|
||||
|
||||
// TODO: rename to Theme; this is not an interface as it contains method implementations
|
||||
// TODO: make methods const
|
||||
class ITheme {
|
||||
public:
|
||||
virtual ~ITheme() {}
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include <QFile>
|
||||
#include <QSettings>
|
||||
|
||||
IconTheme::IconTheme(const QString& id, const QString& path) : m_id(id), m_path(path) {}
|
||||
|
||||
bool IconTheme::load()
|
||||
{
|
||||
const QString path = m_path + "/index.theme";
|
||||
@@ -36,18 +34,3 @@ bool IconTheme::load()
|
||||
settings.endGroup();
|
||||
return !m_name.isNull();
|
||||
}
|
||||
|
||||
QString IconTheme::id()
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
QString IconTheme::path()
|
||||
{
|
||||
return m_path;
|
||||
}
|
||||
|
||||
QString IconTheme::name()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
|
||||
class IconTheme {
|
||||
public:
|
||||
IconTheme(const QString& id, const QString& path);
|
||||
IconTheme(const QString& id, const QString& path) : m_id(id), m_path(path) {}
|
||||
IconTheme() = default;
|
||||
|
||||
bool load();
|
||||
QString id();
|
||||
QString path();
|
||||
QString name();
|
||||
QString id() const { return m_id; }
|
||||
QString path() const { return m_path; }
|
||||
QString name() const { return m_name; }
|
||||
|
||||
private:
|
||||
QString m_id;
|
||||
|
||||
Reference in New Issue
Block a user